Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
docker_advanced_k8s_join [2020/04/21 10:49] – andonovj | docker_advanced_k8s_join [2020/05/02 12:38] (current) – andonovj | ||
---|---|---|---|
Line 5: | Line 5: | ||
So let's get going. | So let's get going. | ||
- | =====Joint to the cluster===== | ||
- | Be sure that you installed the necessary packages from the introduction section. Once this is done we can add the node to the cluster as follow: | ||
- | |||
- | < | ||
- | root@node-1: | ||
- | W0421 10: | ||
- | [preflight] Running pre-flight checks | ||
- | [WARNING IsDockerSystemdCheck]: | ||
- | [preflight] Reading configuration from the cluster... | ||
- | [preflight] FYI: You can look at this config file with ' | ||
- | [kubelet-start] Downloading configuration for the kubelet from the " | ||
- | [kubelet-start] Writing kubelet configuration to file "/ | ||
- | [kubelet-start] Writing kubelet environment file with flags to file "/ | ||
- | [kubelet-start] Starting the kubelet | ||
- | [kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap... | ||
- | |||
- | This node has joined the cluster: | ||
- | * Certificate signing request was sent to apiserver and a response was received. | ||
- | * The Kubelet was informed of the new secure connection details. | ||
- | |||
- | Run ' | ||
- | |||
- | root@node-1: | ||
- | </ | ||
- | |||
- | As with the master node, it might take sometime until you see the node as Ready and all components running from the Control Panel Machine: | ||
- | |||
- | < | ||
- | ubuntu@k8s-master: | ||
- | NAME | ||
- | k8s-master | ||
- | node-1 | ||
- | ubuntu@k8s-master: | ||
- | ubuntu@k8s-master: | ||
- | NAMESPACE | ||
- | kube-system | ||
- | kube-system | ||
- | kube-system | ||
- | kube-system | ||
- | kube-system | ||
- | kube-system | ||
- | kube-system | ||
- | kube-system | ||
- | kube-system | ||
- | kube-system | ||
- | kube-system | ||
- | </ | ||
- | |||
- | Please execute that step on all nodes. In the end you should have something like this: | ||
- | |||
- | < | ||
- | ubuntu@k8s-master: | ||
- | NAME | ||
- | k8s-master | ||
- | node-1 | ||
- | node-2 | ||
- | ubuntu@k8s-master: | ||
- | NAMESPACE | ||
- | kube-system | ||
- | kube-system | ||
- | kube-system | ||
- | kube-system | ||
- | kube-system | ||
- | kube-system | ||
- | kube-system | ||
- | kube-system | ||
- | kube-system | ||
- | kube-system | ||
- | kube-system | ||
- | kube-system | ||
- | kube-system | ||
- | </ | ||
- | |||
- | =====Assign role to a Node===== | ||
- | You saw that our nodes have no roles. We have 1 master and that is that :) | ||
- | |||
- | < | ||
- | ubuntu@k8s-master: | ||
- | NAME | ||
- | k8s-master | ||
- | node-1 | ||
- | node-2 | ||
- | </Code | ||
- | |||
- | So, how to assign roles to the node. Well, in Kubernetes, we assign labels. Labels are assigned as follows: | ||
- | |||
- | < | ||
- | kubectl label node <node name> node-role.kubernetes.io/< | ||
- | kubectl label node <node name> node-role.kubernetes.io/< | ||
- | </ | ||
- | |||
- | So let's assign worker to our node-1 and node-2 | ||
- | |||
- | < | ||
- | ubuntu@k8s-master: | ||
- | node/node-1 labeled | ||
- | ubuntu@k8s-master: | ||
- | node/node-2 labeled | ||
- | ubuntu@k8s-master: | ||
- | NAME | ||
- | k8s-master | ||
- | node-1 | ||
- | node-2 | ||
- | ubuntu@k8s-master: | ||
- | </ | ||
- | |||
- | Alternatively we can remove a label from a node. So let's remove and add that label again on Node-2: | ||
- | |||
- | < | ||
- | ubuntu@k8s-master: | ||
- | node/node-2 labeled | ||
- | ubuntu@k8s-master: | ||
- | NAME | ||
- | k8s-master | ||
- | node-1 | ||
- | node-2 | ||
- | ubuntu@k8s-master: | ||
- | node/node-2 labeled | ||
- | ubuntu@k8s-master: | ||
- | NAME | ||
- | k8s-master | ||
- | node-1 | ||
- | node-2 | ||
- | ubuntu@k8s-master: | ||
- | </ | ||