- Installing docker and kubernetes on ubuntu how to#
- Installing docker and kubernetes on ubuntu update#
Now when you run the following command on the master node, it will confirm that two nodes, the master node and the server nodes are running on your system. sudo kubeadm join tuip -token tutoken -discovery-token-ca-cert-hash sha256:tuhash Once this is done, now it is time to add the slave node to the network to form a cluster, in the same way they must complement the information as in the master node.
To know the status of the network, just type: kubectl get pods -all-namespaces In this tutorial, we are implementing a Flannel pod network in our cluster via the following command: sudo kubectl apply -f To see the list we only have to execute: kubectl get nodesĭeploying a pod network through the master nodeĪ pod network is a means of communication between the nodes of a network. This is because no pod has yet been deployed on the master node and therefore the Container Network Interface is empty. You will see that the status of the master node is not ready yet. Where they will replace the information of tutoken, tuip and your hash with the information that was said a few moments ago that they will write down. Now they can join any number of machines by running the following on each node as root users: kubeadm join tuip -token tutoken -discovery-token-ca-cert-hash sha256:tuhash Sudo chown $(id -u):$(id -g) $HOME/.kube/config Sudo cp -i /etc/kubernetes/nf $HOME/.kube/config
To start using your cluster, they need to run the following as a regular user: mkdir -p $HOME/.kube The output of this command is very important so you should write down the information in the output, as it contains the ip, token and others. The process may take a minute or more depending on your Internet connection. While for the slave node we must type: sudo hostnamectl set-hostname slave-nodeĭone this now v Let's proceed to initialize the master node with the following command: sudo kubeadm init -pod-network-cidr = 10.244.0.0/16 Now the next step is run the following command on the master node to give it a unique hostname: sudo hostnamectl set-hostname master-node They should disable swap memory on both nodesas Kubernetes does not work properly on a system that uses swap memory. Now to implement the Kubernetes deployment in the system we must disable swap memory (if it is running) in both nodes They can check the Kubeadm version number and also verify the installation via the following command: kubeadm version Kubernetes deployment Configure Pod Network and Verify Pod namespaces. Initialize the Master node using kubeadm (on Master Node) 6.
Installing docker and kubernetes on ubuntu how to#
How to Install Kubernetes Cluster on Ubuntu 20.04 LTS with kubeadm. Install Kubeadm,Kubelet and Kubectl on All Node. The last step in the installation process is to install Kubeadm on both nodes via the following command: Add Kubernetes APT Repository on All node. The next step is to add the following repository to both systems: sudo apt-add-repository "deb kubernetes-xenial main" Now the next step is to add the Kubernetes key to both nodes, we do this with the following command: curl -s | sudo apt-key add Now let's proceed to enable docker on both nodes: sudo systemctl enable docker To verify that docker is installed, you can run the following command on both nodes: The first thing we are going to do is install docker on both of them, for this we just need to execute the following command on them: sudo apt install docker.io Kubernetes installation on Ubuntu and derivativesįor a practical installation, we are going to use a two node cluster that we will form in this article will consist of a master node and a slave node.īoth nodes need to have Kubernetes installed on them.
Installing docker and kubernetes on ubuntu update#
You’ll want to make sure all machines are updated (using the commands sudo apt-get update and sudo apt-get upgrade -y). All you will need to make this work are a minimum of 2 Ubuntu Server 18.04 instances and a user account with sudo privileges. I’m going to walk you through the process of doing just that, with the help of Ubuntu Server 18.04. Once this is complete, you’ll have the ability to deploy, scale, and manage your containerized applications. In order to actually use Kubernetes to deploy and manage your containers, you first have to unleash a cluster of Kubernetes servers. This container orchestration tool makes expanding your operations with an unheard of agility almost too easy to believe, once you have everything up and running. It’s almost impossible to avoid the siren song of Kubernetes these days.