Kubernetes Installation Guide - YuntechNet/Kubernetes-Deployment GitHub Wiki
Kubernetes 1.14
Version | |
---|---|
Storage | 10GB |
Memory | 4GB |
OS | ubuntu 18.04 LTS |
Docker | 18.09.7 |
If the hostname requires to change, please follow the following instruction.
- Use hostnamectl to replace your hostname.
(* Replace
sudo hostnamectl set-hostname k8s-hostname
k8s-hostname
with the hostname you want) - After changing the hostname, open
/etc/cloud/cloud.cfg
and setpreserve_hostname
totrue
.preserve_hostname: true
- Turn off the swap file by running the following command:
sudo swapoff -a
- Disable the swap file in '/etc/fstab'. In '/etc/fstab' file, please comment 'swapfile'. (have a '#' in front of '/swapfile')
- Remove '/swapfile' if exist. If exist, running the following command:
sudo rm -f /swapfile
- Install Docker
sudo apt-get install -y docker.io
- Start the service
sudo systemctl start docker
- Enable the service
sudo systemctl enable docker
- Set the cgroup driver to systemd
- open
/etc/docker/daemon.json
and paste the following json.{ "exec-opt": ["native.cgroupdriver=systemd"] }
- Reload the daemon
sudo systemctl daemon-reload
- Restart the service
sudo systemctl restart docker
- Update list of available packages
sudo apt-get update
- Install apt-transport-https curl
sudo apt-get install apt-transport-https curl
- Add key
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add
- Add the repository of Kubernetes
cat << EOF > /etc/apt/source.list.d/kubernetes.list deb https://apt.kubernetes.io/kubernetes-xenial main EOF
- Update list of available packages
sudo apt-get update
- Install kubeadm, kubelet, kubectl
sudo apt-get install kubelet kubeadm kubectl -y
- Keep the current version and keep not updating
sudo apt-mark hold kubelet kubeadm kubectl