![ubuntu docker and kubernetes ubuntu docker and kubernetes](https://miro.medium.com/max/1200/1*t5TbINIv1vbTYCTraPy16g.png)
# apt-get update & apt-get install -y apt-transport-https curl # curl -s | apt-key add - # cat /etc/apt//kubernetes.listĮOF # apt-get update Install kubeadm, Kubelet And Kubectl Run the following commands before installing the Kubernetes environment. Next we have to install these 3 essential components for setting up Kubernetes environment: kubeadm, kubectl, and kubelet. Now we have to install Docker because Docker images will be used for managing the containers in the cluster. Run the following command: # sudo apt-get install openssh-server Install Docker Then press ‘Ctrl+X’, then press ‘Y’ and then press ‘Enter’ to Save the file.Īfter this, restart your machine(s). It will look something like the below screenshot. Now enter the following lines in the file. Run the following command to open the file: # nano /etc/network/interfaces We can do that by modifying the network interfaces file. Next, we will make the IP addresses used above, static for the VMs. Then press ‘Ctrl+X’, then press ‘Y’ and then press ‘Enter’ to Save the file. It should look like the below screenshot on both the machines. This is used for referencing them in the cluster. Now go to the ‘hosts’ file on both the master and node and add an entry specifying their respective IP addresses along with their names ‘kmaster’ and ‘knode’. The IP address which has to be copied should be under “enp0s8”, as shown in the screenshot below. Make a note of the IP address from the output of the above command. Run the following command on both machines to note the IP addresses of each. Update The Hosts File With IPs Of Master & Node To change the hostname of both machines, run the below command to open the file and subsequently rename the master machine to ‘kmaster’ and your node machine to ‘knode’. After that you need to open the ‘fstab’ file and comment out the line which has mention of swap partition.
![ubuntu docker and kubernetes ubuntu docker and kubernetes](http://30ux233xk6rt3h0hse1xnq9f-wpengine.netdna-ssl.com/wp-content/uploads/2017/03/dood-1-1.png)
![ubuntu docker and kubernetes ubuntu docker and kubernetes](https://metavrse.files.wordpress.com/2021/03/ubuntu2004_3esct03e46.png)
Next, we have to turn off the swap space because Kubernetes will start throwing random errors otherwise. Note: After logging-in as ‘sudo’ user, note that your shell symbol will change to ‘#’ from ‘$’. Let’s call the the master as ‘ kmaster‘ and node as ‘ knode‘.įirst, login as ‘sudo’ user because the following set of commands need to be executed with ‘sudo’ permissions. The following steps have to be executed on both the master and node machines. Pre-Installation Steps On Both Master & Slave (To Install Kubernetes) So, I’l just get along with the installation process. Since we are dealing with VMs, we recommend the following settings for the VMs:-īy this point of time, I have assumed you have 2 plain Ubuntu VMs imported onto your Oracle Virtual Box. Starting the Kubernetes cluster from master.To install Kubernetes, you have to diligently follow the 3 phases that come as part of the installation process: If your installation fails at any time, then execute all the steps mentioned from the very beginning in a fresh VM, because debugging would take longer. Note : For this installation, we recommend a fresh Ubuntu 16.04 image since Kubernetes can take up a lot of resources. You can then replicate the same steps to deploy the Kubernetes cluster onto your prod. Here, one VM will act as the master and the other VM will be the node. This blog is a step by step guide to install Kubernetes on top of Ubuntu VMs (Virtual Machines). The first step towards Kubernetes Course is installing Kubernetes.