forked from Ashfaque-9x/Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kubeadm Installation Steps
- Loading branch information
0 parents
commit 1f36b27
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
-------------------------------------- Both Master & Worker Node --------------------------------------- | ||
sudo apt update -y | ||
sudo apt install docker.io -y | ||
|
||
sudo systemctl start docker | ||
sudo systemctl enable docker | ||
|
||
sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg | ||
|
||
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list | ||
|
||
sudo apt update -y | ||
sudo apt install kubeadm=1.20.0-00 kubectl=1.20.0-00 kubelet=1.20.0-00 -y | ||
--------------------------------------------- Master Node -------------------------------------------------- | ||
sudo su | ||
====== Disable swap if it is enabled ======== | ||
sudo swapon --show | ||
sudo swapoff -a | ||
vi /etc/fstab | ||
============================================ | ||
kubeadm init | ||
export KUBECONFIG=/etc/kubernetes/admin.conf | ||
kubectl apply -f https://github.com/weaveworks/weave/releases/download/v2.8.1/weave-daemonset-k8s.yaml | ||
kubeadm token create --print-join-command | ||
--------------------------------------------- Worker Node -------------------------------------------------- | ||
sudo su | ||
====== Disable swap if it is enabled ====== | ||
sudo swapon --show | ||
sudo swapoff -a | ||
vi /etc/fstab | ||
============================================ | ||
kubeadm reset pre-flight checks | ||
complete-output-of-join-command --v=5 | ||
---------------------------------------------------------------------------------------------------------------------------------------- | ||
If getting below message as output of command "kubectl get nodes", | ||
The connection to the server localhost:8080 was refused - did you specify the right host or port? Then perform the following on Master | ||
root@ubuntuvm22:/home/vadmin# export KUBECONFIG=/etc/kubernetes/admin.conf | ||
root@ubuntuvm22:/home/vadmin# cp /etc/kubernetes/admin.conf $HOME/ | ||
root@ubuntuvm22:/home/vadmin# chown $(id -u):$(id -g) $HOME/admin.conf | ||
root@ubuntuvm22:/home/vadmin# export KUBECONFIG=$HOME/admin.conf | ||
root@ubuntuvm22:/home/vadmin# kubectl get nodes | ||
---------------------------------------------------------------------------------------------------------------------------------------- |