devops commands

kubectl delete deploy <deploy-name>
kubectl delete svc <svc-name>
kubectl delete cm <cm-name>
kubectl delete pod <pod-name>

vim Dockerfile    # add steps
docker build -t <name> .

vim deployment.yml   # add steps in yml -> (template → metadata →labels →app: sample-python-app)
kubectl apply -f deployment.yml  # create deploy

vim service.yml    # add steps in yml -> same label(deployment) -> (spec →selecter →app: sample-python-app)
kubectl apply -f service.yml  # create service

vim cm.yml
kubectl apply -f cm.yml

kubectl get deploy  # running deploy 
kubectl get svc     #  running service 
kubectl get cm      #  running configmap
kubectl get pods    # running pods 
kubectl get pods -w # running pods -> status
kubectl get pods -o wide # running pods -> ip address
kubectl get pods -v=7  # internal communication

kubectl edit svc  / vim service.yml

kubectl describe cm <cm-name> # similar to cat -> prints the data to terminal

kubectl exec -it <pod-name> -- /bin/bash # open it in terminal