Kubernetes Setup
Kubernetes Setup
OR
mikube
echo port
minikube ip
mikube dashboard
minikube ip
================================
While excuting the above command , if any error we need to reset the cluster again.
kubeadm reset
minkube
kubectl
=============================
kubernet installations:
=================================
- Install Docker CE
=====================
yum install -y yum-utils device-mapper-persistent-data lvm2
yum install
http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.68-1.el7.noarch.rp
m
======================
- Install Kubernetes
reboot the server. Once the server is on start the sevices. reboot or init 6
docker is using the cgroupfs same thing need to be updated in the kubernetes as well.
sed -i 's/cgroup-driver=systemd/cgroup-driver=cgroupfs/g'
/etc/systemd/system/kubelet.service.d/10-kubeadm.conf
==> With this kubernetes is installed. Cluster initialization starts from here:
on master sever
Note: minimum 2 cpus required otherwise the above command does not work.
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl apply -f
https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
wget https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
---- to download this file
vi kube-flannel.yml and
go to /10 network change the subnet id
wait for sometime and check the nodes and pods:
=============================================
The above command list the cluster node status ( ready ) and the cluster pod informations.
copy paste the commands from the kubeadm command output( when initializing the commands
will give to add the nodes to the cluster).
(In this step, we will do a test by deploying the Nginx pod to the kubernetes cluster. A pod is a
group of one or more containers with shared storage and network that runs under Kubernetes.
A Pod contains one or more containers, such as Docker container.)
https://IPaddressed:<port>