The following must be done on both master and nodes. I’ll be demonstrating on two servers: One master and one node.
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). If you choose not to, please prepend the commands with sudo. sudo usermod-aG docker username The rest of this article assumes you are running the docker command as a user in the docker group. 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. If you need to add a user to the docker group that you’re not logged in as, declare that username explicitly using. 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. Then add following lines in the file.It’s almost impossible to avoid the siren song of Kubernetes these days. For the same create a YAML file by passing the following command.
INSTALLING DOCKER AND KUBERNETES ON UBUNTU HOW TO
In this video I actually install Docker and then show how to install Portainer. So, with Ansible we will create a non-root user called “ ubuntu” in all the nodes. This is the first follow-on video to creating a Ubuntu 18.04 based LXC container in Proxmox to run Docker. Kubernetes need to be installed with a non-root user. Where “ masters” group will have the Kubernetes master node and “ worker” will have worker clusters nodes. In this, We have grouped two clusters called master and workers. Worker2 ansible_host=172.168.0.12 ansible_user=rootĪnsible_python_interpreter=/usr/bin/python3 Master ansible_host=172.168.0.10 ansible_user=root Add the following lines in the hosts file. Then add the node groups in the hosts file. Then Create hosts file by passing following command nano ~/kube-ansible /hosts This folder is going to be the workspace for Ansible. First, create the workspace folder for the Kubernetes. This is having the following components.įor hosting Ansible orchestration, either take machine which will communicate with all the nodes we selected or configure Ansible in local machine. If you do not have an Ubuntu machine to install on, you can still read about the installation steps, as each step will be explained and does not require that you have a running system to understand the process. Worker Node is responsible for maintaining the runtime or workload of the application or service. In this chapter, we will install Docker on an Ubuntu 18.04 system. Volume Controller – This is for maintaining the volumes in terms of creating, attaching mounting and interacting with the cloud provider.Service Controller – This is basically a load-balancer controller from the cloud.Route Controller – This will create network level routing in cloud infrastructure. Although familiar with Docker containers and superficially played with Kubernetes in the past, I’ve not taken the required time to learn the core concepts of Kubernetes to really grasp all the possibilities the technology offers.Node Controller – Checks if a node in the cloud is down or not and it will notify and response for the situation.This includes the following sub-components. This feature is available only after Kubernetes 1.6. Cloud – Control Manager – Cloud control Manager will interact with Cloud providers to run and control the cloud-based containers.Service Account Controller – This will take care of account management for API and other RBAC.Endpoint Controller – It will take care of endpoints of all services.Replication Controller – This will take care of the number of pods per replication.Node Controller – When a node is going down, this component will notify and respond.The resources were not that much requested so I decided to install Kubernetes on that server to add a second master node to my k8s cluster. This Control manager includes following sub-components I had an Ubuntu 20.04 server which was used for CI/CD and it was using Docker on it to build and publish images. Kube – Control Manager – Kube control manager is for Kubernetes native components.Scheduler – This component watches newly created pods that are not assigned to any workload or service and assign it for the same.Etcd – This is the Key-Value storage which stores the state at any point of any cluster.API Server – It creates an interface between Cluster nodes and other components of the Kubernetes master nodes.Master Node is having following components.