Skip to content

Instantly share code, notes, and snippets.

@yijia2413 yijia2413/k8s_op.sh
Last active Mar 1, 2019

Embed
What would you like to do?
k8s operations
# start proxy allow remote access
kubectl proxy --address=0.0.0.0 --port=80 --accept-hosts='^*$'
# 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'
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.