-
Notifications
You must be signed in to change notification settings - Fork 0
/
worker-nodes.txt
42 lines (26 loc) · 1.87 KB
/
worker-nodes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Kubernetes worker nodes, or simply nodes, provide the runtime environment for Kubernetes. Nodes maintain running pods in the Kubernetes cluster. Kubernetes clusters can have one node to thousands of nodes. Each node is configured with several components:
kubelet: Primary agent of the node. Responsible for watching pods assigned to it, running the pod's containers, reporting pod status, etc.
kube-proxy: Enables the Kubernetes service abstraction by maintaining network rules and connection forwarding
Docker: Runs containers
Setting up multiple worker nodes follows a similar process with additional steps for installing an addon to set up a pod network.
2. In the Kubernetes common config file, change the KUBE_MASTER API server address to use the master's DNS name:
sudo sed -i 's/\(KUBE_MASTER.*\)127.0.0.1\(.*\)/\1ca-lab-vm\2/g' /etc/kubernetes/config
This is the same modification made to the master node config file. All servers in a cluster should have the same config file.
3. Enter the following commands to configure the kubelet:
# Listen on all interfaces
sudo sed -i 's/\(KUBELET_ADDRESS.*\)127.0.0.1\(.*\)/\10.0.0.0\2/g' /etc/kubernetes/kubelet
# Use the DNS hostname for the node
sudo sed -i 's/\(KUBELET_HOSTNAME.*\)127.0.0.1\(.*\)/\1k8s-node\2/g' /etc/kubernetes/kubelet
# Use the master's DNS name for the API server address
sudo sed -i 's/\(KUBELET_API_SERVER.*\)127.0.0.1\(.*\)/\1ca-lab-vm\2/g' /etc/kubernetes/kubelet
4. Start, enable on reboot, and show the status of the required worker node services:
for SERVICE in kube-proxy kubelet docker; do
sudo systemctl restart $SERVICE
sudo systemctl enable $SERVICE
sudo systemctl status $SERVICE
done
You should see a green active (running) status listed for each service:
alt
5. Return to your ca-lab-vm SSH session, and re-run the following command:
kubectl get nodes
This time, the STATUS will show as Ready: