k8s deployment command code example
Example 1: kubernetes get deployments
kubectl get deployments
kubectl get deployments -n my-namespace
kubectl get deployments --all-namespaces
Example 2: scale deployment
kubectl scale deployment/myDeploymentName --replicas=3
kubectl scale deployment/myDeploymentName --replicas=3 -n myNamespace
Example 3: kubernetes while true sleep
apiVersion: v1
kind: Pod
metadata:
name: ubuntu
spec:
containers:
- name: ubuntu
image: ubuntu:latest
command: [ "/bin/bash", "-c", "--" ]
args: [ "while true; do sleep 30; done;" ]