Skip to content

Commit 1eb3fc0

Browse files
authored
Update READme.md
1 parent 785c0d0 commit 1eb3fc0

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

kubeadm/READme.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,19 +118,20 @@ apt-mark hold kubelet kubeadm kubectl
118118
systemctl daemon-reload
119119
systemctl start kubelet
120120
systemctl enable kubelet.service
121-
122121
```
123-
## exit as root user & execute the below commands as normal ubuntu user
124-
```sh
125-
sudo su - ubuntu
126-
```
127-
128122
## Initialised the control plane.
129123
``` sh
130-
# Initialize Kubernates master by executing below commond.
131-
124+
# Initialize Kubernetes control plane by running the below commond as root user.
132125
sudo kubeadm init
126+
```
133127

128+
## exit as root user
129+
```sh
130+
sudo su - ubuntu
131+
```
132+
133+
## execute the below commands as a normal ubuntu user
134+
```sh
134135
mkdir -p $HOME/.kube
135136
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
136137
sudo chown $(id -u):$(id -g) $HOME/.kube/config
@@ -155,6 +156,15 @@ kubeadm join 172.31.10.12:6443 --token cdm6fo.dhbrxyleqe5suy6e \
155156
--discovery-token-ca-cert-hash sha256:1fc51686afd16c46102c018acb71ef9537c1226e331840e7d401630b96298e7d
156157
```
157158

158-
159+
## Generate the master join token on the master node
160+
```sh
161+
kubeadm token create --print-join-command
162+
```
163+
## Copy the token and run it on worker nodes to add them to the control plane
164+
# Replace the token below with yours. This step is important when you restart your nodes
165+
```sh
166+
kubeadm join 172.31.10.12:6443 --token cdm6fo.dhbrxyleqe5suy6e \
167+
--discovery-token-ca-cert-hash sha256:1fc51686afd16c46102c018acb71ef9537c1226e331840e7d401630b96298e7d
168+
```
159169

160170

0 commit comments

Comments
 (0)