Pre-requisites

For Lab setup please allow everything in firewall using following commands

iptables -I INPUT -j ACCEPT

Internet Connection on all 3 VMs

My Environment Setup

I have 3 VMs

1 – Photon Master (hostname – photon-os)

2 – Worker or Minion Nodes (hostname(s) – photon-node, photon-node01)

Installation of Kubernetes

Execute following command on all 3 nodes. You can also use –y switch to accept by default

tdnf install kubernetes

Size of the package is about 500MB so it will take time depending upon Internet Speed. I haven’t tried offline method

Configuration

Modify /etc/hosts on all hosts

Add master and node to /etc/hosts on all machines (not needed if the hostnames are already in DNS). Make sure that communication works between photon-master and photon-node by using a utility such as ping

Modify Kubernetes Config on all hosts

Edit /etc/kubernetes/config on all machines as per following

Before

After

Configure Kubernetes on Master

Edit /etc/kubernetes/apiserver as per following

Before

After

Start Kubernetes Services on Master

I will be enabling following services on master as I want Master to be worker/minion node as well

etcd

kube-apiserver

kube-controller-manager

kube-scheduler

kube-proxy

kubelet

If you don’t require master to be worker/minion node then don’t include following 2 service

kube-proxy

kubelet

for SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler kube-proxy kubelet; do

systemctl restart $SERVICES

systemctl enable $SERVICES

systemctl status $SERVICES

done

In case you run into issues with kube-apiserver you will need to reboot the VM

Create node.json for worker/minion nodes

Create Node objects

Make a node object internally in your Kubernetes cluster by running the following command

Verify Node objects

Status will show Unknown and its normal behavior as we have not done any configuration on worker/minion node