Create a Kubernetes Docker Cluster on Ubuntu Server
i12bretro
#Docker #Kubernetes #Ubuntu
Full steps can be found at https://i12bretro.github.io/tutorials/0421.html
Preparing the VMs
- Log into a freshly installed Ubuntu VM
- Run the following commands
set the hostname
sudo hostnamectl set-hostname kubernetesupdate hosts file
sudo nano /etc/hosts - Update the 127.0.01 to the new hostname, kubernetes
- Press CTRL+O, Enter, CTRL+X to write the changes to hosts
- Continue with the following commands
disable the firewall
sudo ufw disabledisable the swap file
sudo swapoff -adisable swap partition
sudo sed -i '/ swap / s/^(.*)$/#\1/g' /etc/fstab sudo echo "vm.swappiness=0" | sudo tee --append /etc/sysctl.confupdate sysctl networking
cat EOF | sudo tee /etc/sysctl.d/kubernetes.conf net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1 EOF sudo sysctl --systemapply the changes
sudo sysctl -p
Installing Docker
- Continue with the following commands in terminal
install prerequisites
sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg-agent -yadd docker gpg key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -add docker software repository
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"install docker
sudo apt install docker-ce docker-compose containerd.io -yenable and start docker service
sudo systemctl enable docker && sudo systemctl start dockeradd the current user to the docker group
sudo usermod -aG docker $USERreauthenticate for the new group membership to take effect
su - $USER
Installing Kubernetes
- Continue with the following commands in terminal
add kubernetes gpg key
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -add the kubernetes software repo
echo 'deb http://apt.kubernetes.io/ kubernetes-xenial main' | sudo tee /etc/apt/sources.list.d/kubernetes.listupdate software repositories
sudo a ... https://www.youtube.com/watch?v=8q9uPjDF59Q
2022-01-10
0.13744068 LBC
Copyrighted (contact publisher)
59923128 Bytes