Skip to content

Instantly share code, notes, and snippets.

@yijia2413 yijia2413/

Last active Oct 31, 2019
What would you like to do?
k8s operations
# start proxy allow remote access
kubectl proxy --address= --port=80 --accept-hosts='^*$'
# port forward
kubectl --address port-forward redis-test1-xxxx 6379:6379
# check pod startup issue
kubectl describe pod [my-pod-name] -n [kube-system](namespace)
# show all pods
kubectl get pods --all-namespaces
# delete pod and restart again
kubectl delete pod [pod-name] -n [pod-namespace]
# delte pod permanently
kubectl get deployments --all-namespaces
kubectl delete -n NAMESPACE deployment DEPLOYMENT
# delete by yaml
kubectl delete -f xxx.yml
kubectl get svc --all-namespaces=true
# delete all
kubectl --namespace=kube-system delete deployment,service,role,rolebinding,sa,secret -l k8s-app=kubernetes-dashboard
# get with more content
kubectl get secret,sa,role,rolebinding,services,deployments -n kube-system
# after deply ingress nginx, try
curl -k -v http://ip:port -H 'host: your.hostname.defined'
# by proxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.