

Next, install it: :~# yum install kubeadm dockerġ3.- Installing Docker and kubernetes on Node1 :~# firewall-cmd -permanent -add-port=6783/tcp First, change the hostname and set the firewall rules: :~# setenforce 0 In this case, it will be only one, but remember that they can be more.Īt each node, run the following. In this step, you must work on the number of nodes you want to configure. :~# kubectl get pods -all-namespacesĮverything is going OK.

Now, re-run the command to show all the pods. To ensure that there is communication between the nodes of the cluster, you have to run the following: :~# export kubever=$(kubectl version | base64 | tr -d '\n') The next step is to check the status of the clusters and pods :~# kubectl get nodes :~# cp -i /etc/kubernetes/nf $HOME/.kube/config If you see something like this, everything is OK.Īs you can see from the image, you must now execute these commands: :~# mkdir -p $HOME/.kube Now you can start Kubernetes with the next command. Then, start and enable both docker and kubectl services: :~# systemctl enable dockerĦ.- Enabling the required services 3. Also, you have to install docker: :~# yum install kubeadm docker With this, the installation will be quick and easy. In order to install Kubernetes on CentOS 7, you must add its repository. Of course, replace the configuration with yours depending on the IP addresses and hostname chosen. :~# nano /etc/hostsĪnd add the following: 192.168.1.8 osradar Edit the file /etc/hosts and add the information of your node and server. In case you don’t have a DNS server configured.

:~# echo '1' > /proc/sys/net/bridge/bridge-nf-call-iptables :~# firewall-cmd -permanent -add-port=10255/tcp :~# firewall-cmd -permanent -add-port=10252/tcp :~# firewall-cmd -permanent -add-port=10251/tcp :~# firewall-cmd -permanent -add-port=10250/tcp Next, set the firewall rules: :~# firewall-cmd -permanent -add-port=6443/tcp :~# sed -i -follow-symlinks 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux Note: all commands must be run as root user. First, you have to disable SELinux and apply various rules in the Firewall for everything to work well. Install Kubernetes on the serverĪs I said before the idea is to make a cluster, for it, first we must configure the server where you will run Kubernetes. Both computers run CentOS 7 and it’s on a local network.
