Difference between revisions of "Kubectl"

From John Freier
Jump to: navigation, search
Line 16: Line 16:
 
This gets all the pods.
 
This gets all the pods.
 
   kubectl get pods --namespace cs
 
   kubectl get pods --namespace cs
 +
 +
 +
Delete a pod
 +
  kubectl delete pod [pod_name]

Revision as of 14:00, 11 April 2022

Kubectl is an application that interacts with Kubernetes clusters.

Check the context

This checks who kubectl is connected to.

 kubectl config current-context


Apply a configuration yaml file.

 kubectl apply -f [name_of_file]


Pods

Get Pods

This gets all the pods.

 kubectl get pods --namespace cs


Delete a pod

 kubectl delete pod [pod_name]