Skip to content

Instantly share code, notes, and snippets.

@a1mzone
Last active January 23, 2024 11:17
Show Gist options
  • Save a1mzone/fd74afdb9a53c72edadadf57d3629673 to your computer and use it in GitHub Desktop.
Save a1mzone/fd74afdb9a53c72edadadf57d3629673 to your computer and use it in GitHub Desktop.
K8S & Helm

HELM

Install

curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh

Add Repo

helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add superset https://apache.github.io/superset

Search Repo

helm search repo bitnami helm search repo superset

Update Repo

helm repo update superset

Install Dependencies

helm dep up ./helm/superset

Install / Upgrade

helm upgrade --install --values values.yaml superset superset/superset
helm install --install --values values.yaml superset superset/superset

Dry Run

helm upgrade --install --create-namespace --namespace superset superset superset/superset --version 0.10.10 --values values.yaml --dry-run --debug > dryrun.out

K8S

Autocomplete ZSH

source <(kubectl completion zsh)

Cluster Info

kubectl cluster-info

Version

kubectl version --client && kubeadm version

Set Namespace

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

Apply File

kubectl apply -f

Get Namespaces

kubectl get namespaces

Get all Nodes

kubectl get nodes -o wide

Get all in Namespace

kubectl get all

Get Pods

kubectl get pods --all-namespaces

Delete all in Namespace

kubectl delete all --all -n superset

Logs

kubectl logs superset-postgresql-0 -n superset

Describe Pod

kubectl describe pod

Interactive Mode into Container

kubectl exec -it postgresdb-7b475497d6-tn757 -- psql -h localhost -U superset --password superset -p 5432

Scale Deployment

kubectl scale deployment superset --replicas=0

PostgreSQL

kubectl apply -f db-persistent-volume.yaml
kubectl apply -f db-volume-claim.yaml
kubectl apply -f db-configmap.yaml
kubectl apply -f db-deployment.yaml
kubectl apply -f db-service.yaml

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