# check kubernetes inner ip kubectl get svc kubernetes -n default # check api server kubectl get componentstatuses # check crd kubectl get crd | grep cert-manager # check all pods kubectl get pods -A
label
1 2
# check node label kubectl get nodes --show-labels
namespace
1
kubectl get namespaces
pod
1 2 3 4 5
# list namespace's pod kubectl get pod -n {namespace} # force delete pod kubectl delete pod {pod_name} --grace-period=0 --force -n {namespace}
expose yaml
1
kubectl get pod <pod-name> -n <namespace> -o yaml > pod-config.yaml
daemonsets
1
kubectl get daemonsets --all-namespaces
log
• -c : Specify which container to retrieve logs from.
• -f: Stream the logs in real-time.
• –previous: Show logs from the last terminated container.
• –since=: Return logs for the last period (e.g., 1h, 30m).
• –tail=: Limit the number of log lines returned.
• –all-containers=true: Get logs from all containers in the pod.