# kubectl get namespaces # 切换命名空间可以使用: kubens $ kubectl get ns NAME STATUS AGE default Active 156m kube-node-lease Active 156m kube-public Active 156m kube-system Active 156m
获取集群信息
1 2 3 4 5 6
$ kubectl cluster-info Kubernetes master is running at https://192.168.99.100:8443 KubeDNS is running at https://192.168.99.100:8443/api/v1/namespaces/kube-system/services/kube- dns:dns/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
获取节点信息
1 2 3 4
$ kubectl get node
NAME STATUS ROLES AGE VERSION minikube Ready master 162m v1.14.1
W0207 06:50:25.361857 1 proxier.go:661] Failed to load kernel module ip_vs with modprobe. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules W0207 06:50:25.363017 1 proxier.go:661] Failed to load kernel module ip_vs_rr with modprobe. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules W0207 06:50:25.364149 1 proxier.go:661] Failed to load kernel module ip_vs_wrr with modprobe. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules W0207 06:50:25.365165 1 proxier.go:661] Failed to load kernel module ip_vs_sh with modprobe. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules I0207 06:50:25.383182 1 node.go:172] Successfully retrieved node IP: 192.168.49.2 I0207 06:50:25.383211 1 server_others.go:142] kube-proxy node IP is an IPv4 address (192.168.49.2), assume IPv4 operation W0207 06:50:25.401386 1 server_others.go:578] Unknown proxy mode "", assuming iptables proxy I0207 06:50:25.401514 1 server_others.go:185] Using iptables Proxier. I0207 06:50:25.401820 1 server.go:650] Version: v1.20.0 I0207 06:50:25.402289 1 conntrack.go:100] Set sysctl 'net/netfilter/nf_conntrack_max' to 524288 F0207 06:50:25.402321 1 server.go:495] open /proc/sys/net/netfilter/nf_conntrack_max: permission denied