Skip to main content

Kubernetes Commands

minikube version

minikube status

minikube start # it will start the cluster.

minikube status

kubectl cluster-info

kubectl get componentsstatus

kubectl get nodes -o wide

minikube help

minikube ssh

minikube dashboard # It will open minikube dashboard.

minikube stop will shutdown the dashboard.

minikube delete.

pod-http.yml
---
apiVersion: v1
kind: Pod
metadata:
  name: pod-httpd
  labels:
    app: apache_webserver
spec:
  containers:
    - name: cntr-httpd
      image: httpd:latest
      ports:
        - containerPort: 80
    - name: nginx
      image: nginx
      ports:81
--------------------
kubectl apply -f configs/pod-httpd.yml

kubectl get pods

kubectl get pods -o wide

curl http://ip

minikube ssh

curl http://ip

kubectl exec pod-http -c cntr -httpd --ls -labels

kubectl exec -it pod-httpd -c cntr-http --/bin/bash

root@prod-http://ust/local/apache/

apt-get-y update
get -get install -y curl
curl http://localhost
curl http://ip
hostname --ip -address

kubectl get pods  pod-http -o yaml | less

kubectl describe pods pod-httpd | less
--> Event logs will be there at bottom -> these can be used for troubleshooting

kubectl delete pod pod-http




Comments

Popular posts from this blog