Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

CommandDescription
kubectl create -f <yaml file>Create a deployment
kubectl delete -f <yaml file>Delete a deployment
kubectl apply -f <yaml file>Update a deployment
kubectl edit -f <yaml file>Edit and update a deployment


kubectl exec -it <pod> bash

log into a pod



$ kubectl exec -it cloudservice-bcc6c69ff-bnzcv bashkubectl scale --replicas=3 deployment/<deployment>

Scale the number of pods for a deployment

$ kubectl scale --replicas=3 deployment/cloudservice

kubectl scale --replicas=1 -f <yaml file>Scale the number of pods referenced in a yaml file


kubectl delete deployment <deployment>

Delete all pods for a deploymentie. kubectl delete deployment redis

kubectl delete pod <pod instance>

Delete a pod


kubectl expose deployment cloudservice --type=LoadBalancer --name=cloud

Expose deployment

...