# Get nodes
$- kubectl get nodes
# Get pods
$- kubectl get pods
# Get services
$- kubectl get services
# Get deployments
$- kubectl get deployment
# Get replicaset
$- kubectl get replicaset
# Create deployment
$- kubectl create deployment <deployment-name>
# Get yaml file for deployment
# this way you can change anything in default deployment
# created by command above
$- kubectl get deployment <deployment-name> -o yaml > /tmp/nginx.yaml
# After any changes in yaml file, apply the changes
$- kubectl apply -f <path-to-yaml-file>
# Edit deployment
$- kubectl edit deployment <deployment-name>
# Gives all the state information
$- kubectl describe pods <pod-name>
# Get the logs of pod and what all applications has printing
$- kubectl logs <pod-name>
# Get appliation container from the pod, it looks pretty much like docker exec
$- kubectl exec -it <pod-name> -- bin/bash
# Delete all the replicasets and pods
# leave deployment-name empty to delete all deployments
$- kubectl delete deployment <deployment-name>