Forum Topic

Thanks for your participation and contribution.


Back to Kubernetes

kubectl Cheat Sheet

Post a reply
721 views
i90runner1
i90runner1

List of Namespaces

$ kubectl get namespaces

Delete Namespace

kubectl delete namespace cpu-example-ns

Get Deployment details

$ kubectl get deployment -n di-dev --output=json kubectl get deployment -n di-dev

Node Info

$ kubectl get nodes
$ kubectl describe nodes

Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ------------  ----------  ---------------  -------------
  1650m (10%)   1550m (9%)  3525Mi (10%)     3325Mi (10%)
Events:         <none>

Read Container Logs

$ kubectl logs container-abc -n namespace123

Drain Nodes

$ kubectl get nodes $ kubectl drain aks-agentpool-node-name --ignore-daemonsets --delete-local-data

Last updated

1-1 of 1

Reply to this discussion

You cannot edit posts or make replies: You should be logged in before you can post.