Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 1002 Bytes

common_command.md

File metadata and controls

47 lines (35 loc) · 1002 Bytes

Mostly used commands in k8s cluster

Reconfiguring a kubeadm cluster

# edit ClusterConfiguration (vim)
kubectl edit cm -n kube-system kubeadm-config

get nodes/pods/services

# all
kubectl get [nodes/pods/services/deployments/namespaces] [-A/-n <namespace>]
# single
kubectl get [node/pod/service/deployment/namespace] <name> -n <namespace>

# available tags:
#   nodes: --show-labels
#   -o wide # out with more info

get description

# all
kubectl describe pods -A > tmp
kubectl describe [nodes/pods/services] [-A/-n <namespace>]
# single
kubectl describe [node/pod/service] <name> -n <namespace>

remove pods with namespace

# all
kubectl delete [nodes/pods/services] --all -n <namespace>
# single
kubectl delete pod [node/pod/service] <name> -n <namespace>

print join command

kubeadm token create --print-join-command kubeadm token list

cheat sheet