Kubernetes Deployment Operations

From NovaOrdis Knowledge Base
Revision as of 02:53, 5 September 2020 by Ovidiu (talk | contribs) (→‎Creating Deployments)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Internal

Getting a Deployment

kubectl get deployment <deployment-name>

Get All Deployments from a Namespace

kubectl -n <namespace> get deployments

Get All Deployments from All Namespaces

kubectl get -A deployments

Creating Deployments

With CLI

kubectl -n <namespace> create deployment <name> --image=ovidiufeodorov/httpd

Updating Deployments

kubectl get deployment ... -o yaml → modify → kubectl apply -f

Scaling Up and Down

kubectl scale --replicas=0 deployment <my-deployment>
kubectl scale --replicas=2 deployment <my-deployment>