:~# kubeadm join -token xnxlx4.k6qupcvb9g7tq2ti 192.168.1.8 ConclusionĪs you can see, the process of installing Kubernetes on CentOS 7 is simple and we are talking about a very powerful tool in the Linux world. Then, enable and start the services: :~# systemctl enable dockerįinally, join to the master node.
#Install kubernetes cluster on centos linuxacademy install
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. Run below command to set kubernetes repositories. On the remote machine first, we must install kubectl package. Let’s try to connect to the cluster from remote machine (CentOS system) using load balancer dns name and port.
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. Step 8) Test Highly available Kubernetes cluster. In a few minutes the cluster will be created.Both computers run CentOS 7 and it’s on a local network.
Go to the Credentials tab and add the SSH private key for the master VM Kublr UI will be available at Add SSH keys It takes a few minutes to create the VMs and install Kublr provision "shell", inline: "docker exec -i kublr /bin/bash -c 'echo \" KUBLR_HOST= # :9080 \" > /ip.external' docker restart kublr" end run "kublr", # -name kublr image: "kublr/kublr:1.18.0",ĭaemonize: true, #-d restart: "unless-stopped", # -restart=unless-stopped args: "-p 9080:9080" end network "private_network", ip: KUBLR_IPĭ.