k8s相关命令
kubectl delete pod myapp-pod
kubectl get pod -o wide
kubectl get pod
kubectl describe pod myapp-pod
kubectl log myapp-pod -c test
kubectl describe pod kubernetes-dashboard-849cd79b75-s2snt --namespace kube-system
curl -k https://172.18.8.31:30001
kubectl get pods -n kube-system -o wide
kubectl create -f kubernetes-dashboard.yaml
kubectl delete -f kubernetes-dashboard.yaml
netstat -lntp
mkdir -p $HOME /.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME /.kube/config
sudo chown $( id -u) : $( id -g) $HOME /.kube/config
kubectl get pods -l app= mysql -n kube-system
kubectl get endpoints mysql -n kube-system
wget -qO- 10.244.1.4:3306
ps auxw | grep kube-proxy
例子:
[ root@k8s-lau-master01 etc]
NAME READY STATUS RESTARTS AGE
mysql-d8dd64c94-cm59w 1/1 Running 0 3h20m
[ root@k8s-lau-master01 etc]
NAME ENDPOINTS AGE
mysql 10.244.1.4:3306 23m
[ root@k8s-lau-master01 etc]
5.7.30
[ root@k8s-lau-master01 etc]
root 14631 0.0 0.6 139528 27068 ? Ssl 7月02 4:50 /usr/local/bin/kube-proxy --config= /var/lib/kube-proxy/config.conf --hostname-override= k8s-lau-master01
root 28990 0.0 0.0 112828 980 pts/0 S+ 14:02 0:00 grep --color= auto kube-proxy
官方文档: http://docs.kubernetes.org.cn/819.html