Skip to content

Instantly share code, notes, and snippets.

@claudioacioli
Last active April 9, 2020 01:00
Show Gist options
  • Save claudioacioli/8ca7b678913b72616447df8cd314581a to your computer and use it in GitHub Desktop.
Save claudioacioli/8ca7b678913b72616447df8cd314581a to your computer and use it in GitHub Desktop.
Kubectl commands to remember!!

Kubectl reference

Get the contexts:

$ kubectl config get-contexts

Switch between contexts:

$ kubectl config use-context [CONTEXT_NAME]

Delete Context:

$ kubectl config delete-context [CONTEXT_NAME]

Get Pods

$ kubectl get pods

Get Services

$ kubectl get service

Get Deployments

$ kubectl get deployments

Create something base in file:

$ kubectl create -f [FILE_NAME]

Create port forward for a service:

kubectl port-forward service/reverseproxy 8080:8080

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment