Kubernetes and friends - theartusz/config GitHub Wiki
- delete context from config
kubectl config delete-context <context-name>
- port forward
kubectl -n <namespace> port-forward svc/<svc name> <svc port>:<local port>
- test if user has access to perform specific action
kubectl auth can-i create deployments --as bob --namespace developer
- change name og kubectl context
kubectl config rename-context old-name new-name
- create generic secret
kubectl create secret generic <secret-name> --from-literal=<key>=<value>
- spin up pod with busybox image which includes curl, log into it and delete after you exit the pod
kubectl run curl-pod --image=radial/busyboxplus:curl -i --tty --rm
- go into pod and start bash shell
kubectl exec --stdin --tty <pod-name> -- /bin/bash
- delete all pods in namespace
kubectl delete pod -n <namespace> all
- connnect to node from debug pod - microsoft documentation
- create pod with sqlcmd installed
kubectl run -it sqlcmd --image=mcr.microsoft.com/mssql-tools
- send command to login to the sql database
sqlcmd -S credit-ability-u-db-server.database.windows.net,1433 -d credit-ability-u-stacc-api-db -U stacc-db-api-user -P <skrivpassordher>
k get secrets/alertmanager-slack-webhook -n=zeebe -o=json | jq -r '.data.webhookUrl' | base64 -d
or
k get secrets/alertmanager-slack-webhook -n=zeebe -o=yaml | yq e '.data.webhookUrl' - | base64 -d
or
kubectl get secret <secret name> -o jsonpath="{.data.<secret key>}" | base64 -d