Kubernetes configure kubectl to use multiple clusters

First of all, you need to have kubectl CLI in your host machine. So, follow the below steps.

Install with Chocolatey on Windows

choco install kubernetes-cli

Install with Homebrew on MacOS

brew install kubernetes-cli

Install with Kubernetes Official Documentation(with Curl)

Follow this link https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-macos

Test to ensure the version you installed

kubectl version

Checking kubectl config

When you run below command, you will see output as shown in the following screenshot. I didn’t configure yet so, it shows an empty config.

kubectl config view
Continue reading

Creating, Starting, Stopping, Packaging and Publishing a Vagrant Box

I use Vagrant for local development in order to build any development environment. For example, when I need a Kubernetes multi node cluster, I can demonstrate with Vagrant quickly(https://kenanhancer.com/2019/09/08/kubernetes-multi-node-cluster-with-one-updated-vagrant-file/). After I complete my exercise about any technology, I also publish to Vagrant Cloud so that it can be used later without wasting time. But, I am not using only Vagrant, there are different technologies and there are different CLI for them. So, if I don’t use one technology sometime, I can forget some important commands. That’s why, this post is important for me to remember Vagrant CLI ๐Ÿ™‚

To read more information about Vagrant CLI https://www.vagrantup.com/docs/cli/ follow official link.

Continue reading

Oracle Docker Container Exercise

You can up and run Oracle Docker container in your local machine and later connect from sqlplus CLI to query your database.

Follow the following Oracle GitHub link for more details

https://github.com/oracle/docker-images/tree/master/OracleDatabase/SingleInstance

After cloning Oracle docker-images repository from GitHub, run the following command in your terminal to build a Oracle Docker XE image.

docker build --force-rm=true --no-cache=true --shm-size=1G --build-arg DB_EDITION=xe -t oracle/database:18.4.0-xe -f Dockerfile.xe .

When build is done, run the following command to start a Oracle XE Database container.

docker run -d --name oracleXe --network=oracle_xe_network -p 1521:1521 -p 5500:5500 -e ORACLE_PWD="Pass_123456" oracle/database:18.4.0-xe

LoopBack 3 โ€“ Simple API with Redis Example

Expose your Redis NoSQL as a REST service with LoopBack 3 (Node.js Open API Framework)

This post is continuation of previous post https://kenanhancer.com/2019/09/13/loopback-3-simple-api-with-mysql-example/

So if you want to start from beginning, read that one as well.

You can find LoopBack 3 project in the following repository. After clonning switch to mongodb branch ๐Ÿ™‚ or run the following command.

git checkout redis

https://github.com/kenanhancer/loopback3-simple-api.git

LoopBack 3 โ€“ Simple API with MongoDB Example

Expose your MongoDB NoSQL as a REST service with LoopBack 3 (Node.js Open API Framework)

This post is continuation of previous post https://kenanhancer.com/2019/09/13/loopback-3-simple-api-with-mysql-example/

So if you want to start from beginning, read that one as well.

Follow this link https://kenanhancer.com/2019/09/13/mongodb-docker-container-exercise/ to create a MySQL container ๐Ÿ™‚

You can find LoopBack 3 project in the following repository. After clonning switch to mongodb branch ๐Ÿ™‚ or run the following command.

git checkout mongodb

https://github.com/kenanhancer/loopback3-simple-api.git

LoopBack 3 โ€“ Simple API with MySQL Example

Expose your MySQL Database as a REST service with LoopBack 3 (Node.js Open API Framework)

This post is continuation of previous post https://kenanhancer.com/2019/09/09/loopback-3-simple-api-example/

So if you want to start from beginning, read that one as well.

Follow this link https://kenanhancer.com/2019/09/12/mysql-docker-container-exercise/ to create a MySQL container ๐Ÿ™‚

LoopBack MySQL example will not start wihout running the following code in MySQL Database container. So, run the following command in it.

ALTER USER root IDENTIFIED WITH mysql_native_password BY 'password';

You can find LoopBack 3 project in the following repository. After clonning switch to mysql branch ๐Ÿ™‚ or run the following command.

git checkout mysql

https://github.com/kenanhancer/loopback3-simple-api.git

MySQL Docker Container Exercise

You can up and run MySQL Docker container in your local machine and later connect from mysql CLI to query your database.

Run the following command in your terminal to up and run a MySQL Database Docker container.

docker run -p 3306:3306 --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:latest

Follow the following link for more details

https://hub.docker.com/_/mysql

There are more practice in this video ๐Ÿ™‚

LoopBack 3 – Simple API Example

I am developing APIs with Node.js and LoopBack during last one year. So, it is time to create a post about it. ๐Ÿ™‚ I try to build a detailed project. I hope that this post will be a good reference for developers.

Install LoopBack CLI Tools

There are two LoopBack CLI Tools.

You can also use the legacy StrongLoop CLI tool slc

Install LoopBack CLI Tool

$ npm install -g loopback-cli

This installs the lb command-line tool for scaffolding and modifying LoopBack applications.

Continue reading