Lab3 - Deploying The Kubernetes Cluster - Node2
Lab3 - Deploying The Kubernetes Cluster - Node2
1 Login into Worker node kube-node2 as root user with the password linux if not already.
1.1 Add an entry to /etc/hosts for local name resolution.
SELinux has three basic modes of operation, of which Enforcing is set as the
installation default mode.
• Enforcing: The default mode which will enable and enforce the SELinux
security policy on the system, denying access and logging actions
• Permissive: In Permissive mode, SELinux is enabled but will not enforce
the security policy, only warn and log actions. Permissive mode is useful
for troubleshooting SELinux issues.
• Disabled: SELinux is turned off
Output:
Output:
Note: If you wish to work along with the Firewall, open kubernetes services ports by running
below commands.
firewall-cmd --permanent --add-port=6443/tcp
firewall-cmd --permanent --add-port=2379-2380/tcp
firewall-cmd --permanent --add-port=10250/tcp
firewall-cmd --permanent --add-port=10251/tcp
firewall-cmd --permanent --add-port=10252/tcp
firewall-cmd --permanent --add-port=10255/tcp
firewall-cmd –reload
# chronyc sources -v
Output:
1.6 You must turn off the swap space as Kubernetes does not support it.
# swapoff -a
1.8 Turn the feature on so that the packets traversing the bridge are sent to iptables
# modprobe br_netfilter
# sysctl --system
2 Update and Reboot the server to get the latest packages installed.
# yum update -y
# reboot
Login back to the kube-node2 as root user to proceed with next steps.
4 Let us setup the repository for docker, by executing the below commands.
# yum-config-manager --add-repo
https://download.docker.com/linux/centos/docker-ce.repo
Student Material – Do Not Re-distribute. For any queries contact:
[email protected] or https://www.linkedin.com/in/naushadpasha/
4.1 Let us install and configure Docker, by executing the below commands.
# mkdir /etc/docker
# mkdir -p /etc/systemd/system/docker.service.d
4.2 Kubernetes packages are not available in the default CentOS 7 repositories, Use
the below command to configure its package repositories.
Output:
Output:
Output:
Output:
Note: If in case you forgot/lost the token, run below command on master to
regenerate the token.
4.8 Login to the kube-master and execute the below commands to add labels to the worker
nodes.
# kubectl label node kube-node2 node-role.kubernetes.io/node=
Output:
Output: