

- #Docker and kubernetes for java developers install#
- #Docker and kubernetes for java developers update#
We will use kubeadm which helps bootstrap Kubernetes cluster. Check if Docker and Kubernetes were installed using the commands:ĭocker version 18.09.7, build $ kubectl versionĬlient Version: version.Info Creating Single Node Kubernetes Cluster with Kubeadm

In the end, turn off the swap on Ubuntu Server because it is required in the changelog: sudo swapoff -a sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
#Docker and kubernetes for java developers install#
Sudo apt install -y kubeadm kubelet kubernetes-cni
#Docker and kubernetes for java developers update#
Then use the following commands to install Kubernetes: sudo apt-get update & sudo apt-get install -y apt-transport-https & curl -s | sudo apt-key add -Įcho "deb kubernetes-xenial main" | sudo tee -a /etc/apt//kubernetes.list & sudo apt-get update Sudo add-apt-repository "deb $(lsb_release -cs ) stable" sudo apt update & sudo apt install docker-ce First, use the following commands to install Docker: Let’s start with turning on the VM with Ubuntu Server and connecting via SSH to the machine (I described this in the previous post). Installing Docker and Kubernetes on Ubuntu Server Now we will be installing and configuring Docker and Kubernetes on our Ubuntu Server. In the previous post, we have prepared an environment for work.

On the slave node and to let the slave node join the cluster, use the command copied earlier from the output of Kubernetes initialization step, which should look something like this: kubectl get pods -all-namespaces Check Status Join the Kubernetes Clusterįor now, everything should be ready for the master and slave nodes to join the Kubernetes Cluster. On the master node, ensure that everything is up and running. On master node, use the following command to deploy a pod network. To enable communication between cluster nodes, we have to deploy a pod network. mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/nf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config Pod Network Deployment Also, as per the previous output its recommended to use the following commands to start using the Kubernetes cluster. Take a copy from the last line “kubeadm join 10.0.2.15:6443 –token edvbbv.51hy5e2hgaxr1b4h –discovery-token-ca-cert-hash sha256:01db7c5913e363c099dc7a711550b8399c41f7cc92bda6b5ff06d6b8382a73e2” in the previous screenshot as we will be using it in the slave node to make it join the cluster. sudo kubeadm init -pod-network-cidr=10.244.0.0/16 Initialize Kubernetes On your master node, use the next command to initialize the Kubernetes master node. sudo apt install kubeadm Kubernetes Master Server Initialization

Before installing Kubernetes, make sure that your system is not using the swap memory because Kubernetes will refuse to operate if your Ubuntu is using the swap memory. Verify your installation, use the command: kubeadm version Kubeadm Version Note that at the time of writing this tutorial only the Xenial Kubernetes repository is available so it will be the one we will use for our installation. sudo apt-add-repository "deb kubernetes-xenial main" curl -s | sudo apt-key add Add Kubernetes Signing Key Install curl package using the next command. Perform the following steps on Master as well as slave. sudo systemctl enable docker Enable Docker Service Kubernetes Installation So, once the installation completes successfully, execute the following command on both nodes to enable the docker service. By default, the docker service is not enabled.
