Skip to content

Instantly share code, notes, and snippets.

@bcambl
Last active February 15, 2025 20:11
Show Gist options
  • Select an option

  • Save bcambl/52723c98959c2bc93588eeb80c48d09d to your computer and use it in GitHub Desktop.

Select an option

Save bcambl/52723c98959c2bc93588eeb80c48d09d to your computer and use it in GitHub Desktop.
kube-fu

Kube-fu

A collection of helpful kubernetes related commands.

kubectl

switch namespace

kubectl config set-context --current --namespace=example

tail cluster event logs

kubectl get events --sort-by=.metadata.creationTimestamp -w

restart a deployment

kubectl rollout restart deployment/example

scale up a deployment to 3

kubectl scale --replicas=3 deployment/example

stop a deployment

kubectl scale --replicas=0 deployment/example

cleanup all non-running pods

kubectl delete pods --field-selector status.phase!=Running --all-namespaces

helm

using hashicorp/vault for examples

add repo

helm repo add hashicorp https://helm.releases.hashicorp.com

update repo

helm repo update

get chart values

helm inspect values hashicorp/vault > values.yaml

install chart using values

helm install vault hashicorp/vault -f values.yaml

uninstall chart

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