kubectl quickstart
This guide assumes you’ve already set up your kubeconfig.
First commands
Section titled “First commands”List the namespaces in your cluster:
kubectl get nsYou’ll see the built-in Kubernetes namespaces (default, kube-system,
kube-public, kube-node-lease).
List pods in a namespace:
# pods in the default namespacekubectl get pods
# pods across every namespacekubectl get pods -ACheck the nodes backing your cluster:
kubectl get nodes -o wideDeploy something
Section titled “Deploy something”A quick smoke test:
kubectl create deployment hello-world --image=nginxkubectl get pods -wOnce the pod reports Running, your cluster is serving workloads.
Next, expose a service to the internet over HTTPS with Ingress or the Gateway API.
Clean up
Section titled “Clean up”kubectl delete deployment hello-world