Installing Kubernetes on Ubuntu 18.04



Pertama ubah semua hostname pada semua node

----semua node----

#sudo apt-get install docker.io -y

#sudo systemctl start docker

#sudo systemctl enable docker


#sudo apt-get install apt-transport-https curl -y

#curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add

#sudo apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main"

 #sudo swapoff -a

# sudo apt-get install kubeadm -y

#kubeadm version


---Master Node Only -----

---rekomendasi begini saja----

#sudo kubeadm init --apiserver-advertise-address=[Ip Node]


----bisa juga----

 #sudo kubeadm init --pod-network-cidr=172.168.10.0/24 --apiserver-advertise-address=[Ip Node]


setelah diatas kita disuruh untuk jalankan perintah start cluster dan join copy itu


-------CONTOH---------

Your Kubernetes master has initialized successfully!

To start using your cluster, you need to run the following as a regular user:

  #mkdir -p $HOME/.kube

 # sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config

 # sudo chown $(id -u):$(id -g) $HOME/.kube/config

You should now deploy a pod network to the cluster.

Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:

  https://kubernetes.io/docs/concepts/cluster-administration/addons/

You can now join any number of machines by running the following on each node

as root:

#kubeadm join --token 62b281.f819128770e900a3 192.168.0.103:6443 --discovery-token-ca-cert-hash sha256:68ce767b188860676e6952fdeddd4e9fd45ab141a3d6d50c02505fa0d4d44686

-------------------


#kubectl get nodes

maka node status notready contoh:


NAME          STATUS     ROLES     AGE       VERSION

master-node   NotReady   master    14m       v1.9.4


-----install interface calico CNI---------

#sudo kubectl apply -f https://docs.projectcalico.org/v3.14/manifests/calico.yaml

#sudo kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml


#sudo kubectl get pods --all-namespaces


---DAshboard----

#kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml


------Untuk Slave Node--------

------jOIN KAN--------

#kubeadm join --token 62b281.f819128770e900a3 192.168.0.103:6443 --discovery-token-ca-cert-hash sha256:68ce767b188860676e6952fdeddd4e9fd45ab141a3d6d50c02505fa0d4d44686


Post a Comment

0 Comments