Difference between revisions of "Kubectl"
From John Freier
Line 40: | Line 40: | ||
Get the logs from a pod. | Get the logs from a pod. | ||
kubectl logs -p [pod_name] --namespace=cs | kubectl logs -p [pod_name] --namespace=cs | ||
+ | |||
+ | |||
+ | == Events == | ||
+ | Get a list of events. | ||
+ | |||
+ | kubectl get events | ||
+ | |||
+ | |||
+ | == Extra commands to help.== | ||
+ | If you have to include a name space. | ||
+ | --namespace scdf-jf | ||
+ | |||
+ | To be past any SSL issues. | ||
+ | --insecure-skip-tls-verify |
Revision as of 09:55, 17 May 2024
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]
Deploy
Get Deployments
kubectl get deployments --namespace=cs
Delete Deployments
kubectl delete deployment [name_of_deployment] --namespace=cs
Pods
Get Pods
This gets all the pods.
kubectl get pods --namespace cs
Delete a pod
kubectl delete pod [pod_name]
Volume
List Persistent Volumes Claims
kubectl describe pvc --namespace=cs
Logs
Get the logs from a pod.
kubectl logs -p [pod_name] --namespace=cs
Events
Get a list of events.
kubectl get events
Extra commands to help.
If you have to include a name space.
--namespace scdf-jf
To be past any SSL issues.
--insecure-skip-tls-verify