k8s 常用命令


[root@master ~]# kubectl get nodes

NAME      STATUS    ROLES     AGE       VERSION

master    Ready     master    1h        v1.8.1

node1     Ready     <none>    1h        v1.8.1

node2     Ready     <none>    1h        v1.8.1

[root@master network]#  kubectl get po --all-namespaces

NAMESPACE     NAME                             READY     STATUS    RESTARTS   AGE

kube-system   etcd-master                      /       Running             3m

kube-system   kube-apiserver-master            /       Running             4m

kube-system   kube-controller-manager-master   /       Running             4m

kube-system   kube-dns-545bc4bfd4-kvvg2        /       Running             4m

kube-system   kube-flannel-ds-djdp4            /       Running             21s

kube-system   kube-flannel-ds-mb75s            /       Running             1m

kube-system   kube-flannel-ds-sxpkq            /       Running             18s

kube-system   kube-proxy-6s8wz                 /       Running             21s

kube-system   kube-proxy-d4snf                 /       Running             4m

kube-system   kube-proxy-lnxfv                 /       Running             18s

kube-system   kube-scheduler-master            /       Running             4m

kubectl get svc

NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE

kubernetes   ClusterIP   10.96.0.1    <none>        /TCP   8m

kubectl logs -f kubernetes-dashboard-759ccc86d9-svmlk --namespace=kube-system

// :: Starting overwatch

// :: Using in-cluster config to connect to apiserver

// :: Using service account token for csrf signing

// :: No request provided. Skipping authorization

// :: Successful initial request to the apiserver, version: v1.8.2

// :: New synchronizer has been registered: kubernetes-dashboard-key-holder-kube-system. Starting

// :: Starting secret synchronizer for kubernetes-dashboard-key-holder in namespace kube-system

// :: Generating JWE encryption key

// :: Storing encryption key in a secret

// :: Creating in-cluster Heapster client

// :: Metric client health check failed: the server could not find the requested resource (get services heapster). Retrying in  seconds.

// :: Serving insecurely on HTTP port: 

// :: Metric client health check failed: the server could not find the requested resource (get services heapster). Retrying in  seconds.

// :: Metric client health check failed: the server could not find the requested resource (get services heapster). Retrying in  seconds.

// :: Metric client health check failed: the server could not find the requested resource (get services heapster). Retrying in  seconds.

// :: Metric client health check failed: the server could not find the requested resource (get services heapster). Retrying in  seconds.

kubectl get pods -n kube-system -o wide

NAME                                    READY     STATUS    RESTARTS   AGE       IP           NODE

etcd-master                             /       Running             7m        10.10.6.11   master

kube-apiserver-master                   /       Running             8m        10.10.6.11   master

kube-controller-manager-master          /       Running             8m        10.10.6.11   master

kube-dns-545bc4bfd4-kvvg2               /       Running             8m        10.96.0.2    master

kube-flannel-ds-djdp4                   /       Running             4m        10.10.6.13   node2

kube-flannel-ds-mb75s                   /       Running             5m        10.10.6.11   master

kube-flannel-ds-sxpkq                   /       Running             4m        10.10.6.12   node1

kube-proxy-6s8wz                        /       Running             4m        10.10.6.13   node2

kube-proxy-d4snf                        /       Running             8m        10.10.6.11   master

kube-proxy-lnxfv                        /       Running             4m        10.10.6.12   node1

kube-scheduler-master                   /       Running             8m        10.10.6.11   master

kubernetes-dashboard-759ccc86d9-svmlk   /       Running             2m        10.96.2.2    node1

kubectl get svc  --all-namespaces

NAMESPACE     NAME                   TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)         AGE

default       kubernetes             ClusterIP   10.96.0.1       <none>        /TCP         1h

kube-system   kube-dns               ClusterIP   10.96.0.10      <none>        /UDP,/TCP   1h

kube-system   kubernetes-dashboard   NodePort    10.104.11.151   <none>        :/TCP    1h

[root@master ~]# 
上一篇:数字IC设计-15-DPI(延续)


下一篇:Java stream的常见用法