Kubernetes
Kubernetes
• DNS
• Web UI (Dashboard)
• Dashboard is a general purpose, web-based UI for
Kubernetes clusters. It allows users to manage and
troubleshoot applications running in the cluster, as
well as the cluster itself
Kubernetes Architecture
• Container Resource Monitoring
• Container Resource Monitoring records generic time-
series metrics about containers in a central database,
and provides a UI for browsing that data.
• Cluster-level Logging
• A Cluster-level logging mechanism is responsible for
saving container logs to a central log store with
search/browsing interface.
Kubernetes Components
• Pod
• Disable SELINUX
vi /etc/selinux/config and change
SELINUX=enforcing to SELINUX=disabled and save
the file.
• Disable firewalld.
systemctl disable firewalld
Minikube
• Restart the system once.
• init 6 or restart
• Install minikube
1. wget
https://storage.googleapis.com/minikube/releases/late
st/minikube-linux-amd64
2. mv minikube-linux-amd64
/usr/local/bin/minikube
3. chmod +x /usr/local/bin/minikube
Minikube
• Start minikube cluster
1. minikube start
This command creates and configures a Virtual
Machine that runs a single-node Kubernetes cluster.
This command also configures your kubectl installation
to communicate with this cluster.
Minikube
• Check Minikube
use command minikube status
Minikube
• Get list of minikube services
• minikube service list
Minikube
• Minikube cluster info
kubectl cluster-info
Minikube
• Deploy nginx application on minikube
• Create a pod for the application
kubectl run firstapp1 --image=nginx --
port=80
Minikube
• Create a service for the pod
kubectl expose deployment firstapp --type=NodePort
• Copy this join token in a file and save it for later use on
the nodes.
Deploy Kubernetes Cluster
• Copy and configure the admin token to root user home
directory so as to manage the kubernetes cluster.
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf
$HOME/.kube/config
• You can use scp command to copy file to all the worker
nodes.
Deploy Kubernetes
Cluster
• Once the file is copied execute the join command.
• kubectl apply -f
https://raw.githubusercontent.com/kubernetes/dash
board/master/aio/deploy/recommended/kubernetes-
dashboard.yaml
Deploy Kubernetes
Dashboard
• Create a dashboard-admin.yaml file.
• Add following to the file.
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: kubernetes-dashboard
labels:
k8s-app: kubernetes-dashboard
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: kubernetes-dashboard
namespace: kube-system
Deploy Kubernetes
Dashboard
• Assign full admin privileges to the service account for
dashboard
kubectl create -f dashboard-admin.yaml
To access dashboard only on the master node you can
give the command kubectl proxy.
• To access dashboard from anywhere give
• nohup kubectl proxy --address="Master-node-ip" -p 443 --
accept-hosts='^*$' &
• Access dashboard using following URL
• http://Master-node-ip:443/api/v1/namespaces/kube-system/
services/https:kubernetes-dashboard:/proxy/
Thanks!