41
loading...
This website collects cookies to deliver better user experience
kubectl
commands in the sections below as a quick reference to work with Kubernetes.kubectl get namespaces
kubectl get pods
kubectl get pods -o wide
kubectl get pods --field-selector=spec.nodeName=[server-name]
kubectl get replicationcontroller,services
kubectl get daemonset
kubectl create namespace [namespace-name]
kubectl create –f [filename]
kubectl apply
command.kubectl apply -f [service-config].yaml
kubectl apply -f [controller-config].yaml
kubectl apply -f [yaml-file/directory-name]
kubectl edit svc/[service-name]
KUBE_EDITOR=”[editor-name]” kubectl edit svc/[service-name]
kubectl describe nodes [node-name]
kubectl describe pods [pod-name]
pod.json
kubectl describe –f pod.json
kubectl describe pods [replication-controller-name]
kubectl describe pods
kubectl delete -f pod.yaml
kubectl delete pods,services -l [label-key]=[label-value]
kubectl delete pods --all
kubectl exec [pod-name] -- [command]
kubectl exec [pod-name] -c [container-name] -- [command]
kubectl exec -ti [pod-name] -- /bin/bash
kubectl logs [pod-name]
kubectl logs -f [pod-name]
kubectl logs --tail=200 [pod-name]
kubectl config
command lets you view and modify kubeconfig files.kubectl config current-context
kubectl config set-cluster [cluster-name] --server=[server-name]
kubectl config unset [property-name]