Validating the Kubernetes cluster

  1. Validating CMD Tools
$ kubeadm version
$ kubeadm version --short 
$ kubectl get nodes 
$ kubectl get nodes -o wide
$ kubectl get pods -n kube-system
$ kubectl get pods -n kube-system -o wide
$ systemctl status docker 
$ systemctl status kubelet
$ vi nginx-deploy.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx-app
spec:
replicas: 1
selector:
matchLabels:
app: nginx-app
template:
metadata:
labels:
app: nginx-app
spec:
containers:
- name: nginx-container
image: nginx:latest
ports:
- containerPort: 80
$ kubectl apply -f nginx-deploy.yaml
$ kubectl get pods
$ kubectl get pods -o wide
$ vi nginx-service.yaml
apiVersion: v1
kind: Service
metadata:
name: nginx-app
spec:
selector:
app: nginx-app
type: NodePort
ports:
- port: 80
targetPort: 80
nodePort: 32001
$ kubectl apply -f nginx-service.yaml
$ kubectl get service

Kubernetes Tutorials

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store