k8s常用命令演示

kubectl run --image=xxx name_xx --port
  kubectl run --image=nginx nginx-app --port=80

kubectl expose
  kubectl expose deployment nginx-app --type="NodePort" --port=80
    in default,pods only deploy on node,not on master, please use the node ip to access.

kubectl get
  kubectl get deployment
  kubectl get pods
  kubectl get service

kubectl attach
  kubectl attach -it nginx-app-5jyvm

kubectl exec
  kubectl exec -it nginx-app-5jyvm -- /bin/bash

kubectl logs
  kubectl logs -f nginx-app-zibvs

kubectl delete
  kubectl delete deployment xxx
  kubectl delete pods xxx
  kubectl delete service xxx

上一篇:MQTT for UWP


下一篇:k8s常用命令记录