RongTsai4Git / TechNote

0 stars 0 forks source link

K8S Command Usage #13

Open RongTsai4Git opened 2 years ago

RongTsai4Git commented 2 years ago
RongTsai4Git commented 2 years ago

Get Nodes

$ kubectl get node -o wide
NAME       STATUS   ROLES                  AGE    VERSION   INTERNAL-IP    EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION                      CONTAINER-RUNTIME
minikube   Ready    control-plane,master   102s   v1.23.1   192.168.49.2   <none>        Ubuntu 20.04.2 LTS   5.10.16.3-microsoft-standard-WSL2   docker://20.10.12

Get Pods

$ kubectl get pods --all-namespaces -o wide
NAMESPACE              NAME                                        READY   STATUS    RESTARTS        AGE     IP             NODE       NOMINATED NODE   READINESS GATES
kube-system            coredns-64897985d-clxs9                     1/1     Running   0               4m13s   172.17.0.3     minikube   <none>           <none>
kube-system            etcd-minikube                               1/1     Running   1               4m25s   192.168.49.2   minikube   <none>           <none>
kube-system            kube-apiserver-minikube                     1/1     Running   1               4m28s   192.168.49.2   minikube   <none>           <none>
kube-system            kube-controller-manager-minikube            1/1     Running   1               4m25s   192.168.49.2   minikube   <none>           <none>
kube-system            kube-proxy-mdv6q                            1/1     Running   0               4m13s   192.168.49.2   minikube   <none>           <none>
kube-system            kube-scheduler-minikube                     1/1     Running   1               4m25s   192.168.49.2   minikube   <none>           <none>
kube-system            storage-provisioner                         1/1     Running   1 (3m52s ago)   4m22s   192.168.49.2   minikube   <none>           <none>
kubernetes-dashboard   dashboard-metrics-scraper-58549894f-2nbnx   1/1     Running   0               4m13s   172.17.0.4     minikube   <none>           <none>
kubernetes-dashboard   kubernetes-dashboard-ccd587f44-kxtmp        1/1     Running   1 (3m50s ago)   4m13s   172.17.0.2     minikube   <none>           <none>

Get Service

$ kubectl get svc -o wide
NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE     SELECTOR
kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   5m33s   <none>