kubectl get po
kubectl get configmaps
kubectl get configmaps name-cm -o yaml
kubectl get deploy
kubectl delete deploy name
kubectl apply -f /path/to/file.yaml
kubectl logs -f name-pod
kubectl scale deploy name-deploy --replicas=0
kubectl edit cm/po/deploy name
kubectl describe pods name-po
kubectl exec -it name-po sh
kubectl logs name-po
kubectl delete pods name-po
kubectl port-forward name-po 777:80
kubectl apply -f ./manifest.yaml
manifest.yaml:
apiVersion: v1 kind: Pod metadata: name: my-web spec: containers: - name: container-apache image: httpd:latest ports: - containerPort: 80
kubectl delete -f ./manifest.yaml
kubectl scale deploy name --replicas 4
kubectl rollout history deployment name-deploy
kubectl set image deployment name image=new-image:latest --record
kubectl rollout undo deployment name
kubectl rollout undo deployment name --to-revision=4
kubectl rollout undo deployment name