0% found this document useful (0 votes)
7 views

running k8s commands

The document provides a series of commands for managing a Kubernetes cluster using 'kind' and 'kubectl'. It includes instructions for creating and deleting clusters, deploying applications, checking deployment status, accessing pod logs, and rolling back deployments. Additionally, it explains how to access a service via a web browser after deployment.

Uploaded by

Suresh
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

running k8s commands

The document provides a series of commands for managing a Kubernetes cluster using 'kind' and 'kubectl'. It includes instructions for creating and deleting clusters, deploying applications, checking deployment status, accessing pod logs, and rolling back deployments. Additionally, it explains how to access a service via a web browser after deployment.

Uploaded by

Suresh
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

kind create cluster --config 01-cluster.

yaml
kind delete cluster --name dev-cluster

kubectl apply -f 01-simple-deploy.yaml

kubectl get all

exec inside pod


kubectl exec -it pod/my-deploy-5c5b7bc6d7-bvwpc bash

kubectl get deployment

describe deployment:
kubectl describe deploy

getting logs of specific container that is inside a pod:


kubectl logs deploy/my-deploy will show log of any one container that is
running inside a pod
kubectl logs pod/my-deploy-5c5b7bc6d7-bvwpc

Rollout history
---------------
Switching from 1.1 to 1.2

kubectl rollout history deploy

let assume there is bug in 1.2 and we want to migrate from 1.2 to 1.1
kubectl rollout undo deploy/empapp-deploy

if you want to see more details:


kubectl rollout history deploy --revision=4

looks for service information:


--------------------------------
service/empapp-svc NodePort 10.96.120.99 <none> 8080:30001/TCP 6s

now we can connect to the service using go to the browser and req for:
---------------------------------------
http://localhost:30001/emps

You might also like