Sunday, August 25, 2019

Kubernetes Local setup: Ubuntu

Below steps need to be done at both Master and also on other (slave)nodes in the K8s network.


  • update the repositories
  • Turn Off Swap Space(if it is on, K8S won't work)
  • Update Hostname(on each machine, self and other machines), Hosts & set Static IP
  • Install OpenSSH Server and Docker: sudo apt-get install openssh-server,apt-get install -y docker.io 


Prereqs for k8s:
-----------------
apt-get update && apt-get install -y apt-transport-https curl
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -

cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF

apt-get update

Install k8s env:
---------------
Install Kubeadm, Kubelet and Kubectl: apt-get install -y kubelet,kubeadm,kubectl

Update K8s configuration:
---------------------------
nano /etc/systemd/system/kubelet.service.d/10-kubeadm.conf

//Add the below after the last line
Environment="cgroup-driver=systemd/cgroup-driver=cgroupfs"





Only at Master:
--------------
Initiate Kubernetes Cluster:

different types of networks are there, choose one,say Calico CNI.



To get list of pods.
kubectl get pods -o wide --all-namespaces

After creating dashboard, run below commands.


No comments:

Post a Comment