|NO.Z.00121|——————————|CloudNative|——|KuberNetes&基础标签.V04|——|kubernetes.v04|资源查看|

一、kubernetes资源查看方式:查看pod
### --- 可以通过get ns查看当前节点下有多少个namespace;

[root@k8s-master01 ~]# kubectl get ns
NAME                   STATUS   AGE
default                Active   4d23h
kube-node-lease        Active   4d23h
kube-public            Active   4d23h
kube-system            Active   4d23h
kubernetes-dashboard   Active   4d21h
### --- 若是不指定-n默认是default命名空间的,当前default是没有任何资源的

[root@k8s-master01 ~]# kubectl get po
No resources found in default namespace.
### --- 查看当前环境有多少个pod当前的pod都是通过namespace隔离的。

[root@k8s-master01 ~]# kubectl get po -n kube-system
NAME                                       READY   STATUS    RESTARTS   AGE
calico-kube-controllers-5f6d4b864b-6clrl   1/1     Running   0          4d22h
calico-node-6hbtl                          1/1     Running   14         4d22h
calico-node-77c2f                          1/1     Running   6          4d22h
calico-node-hrqpt                          1/1     Running   0          4d22h
calico-node-trkhw                          1/1     Running   16         4d22h
calico-node-z4gkj                          1/1     Running   0          4d22h
coredns-867d46bfc6-sk5dp                   1/1     Running   1          4d21h
metrics-server-595f65d8d5-slhtd            1/1     Running   12         4d21h
二、PV查看说明
### --- PV是没有namespace隔离性的,RBAC是没有namespace隔离性的

[root@k8s-master01 ~]# kubectl get clusterrole
NAME                                                                   CREATED AT
admin                                                                  2021-04-09T13:52:18Z
calico-kube-controllers                                                2021-04-09T15:13:24Z
calico-node                                                            2021-04-09T15:13:24Z
cluster-admin                                                          2021-04-09T13:52:18Z
edit                                                                   2021-04-09T13:52:18Z
kubernetes-dashboard                                                   2021-04-09T16:07:07Z
三、查看ClusterRole
### --- 查看ClusterRole

[root@k8s-master01 ~]# kubectl get clusterrole -n kube-system
NAME                                                                   CREATED AT
admin                                                                  2021-04-09T13:52:18Z
calico-kube-controllers                                                2021-04-09T15:13:24Z
calico-node                                                            2021-04-09T15:13:24Z
cluster-admin                                                          2021-04-09T13:52:18Z
四、查看StorageClass
### --- StorageClass也是没有namespace隔离的

[root@k8s-master01 ~]# kubectl get storageclass
五、查看ingressclass
### --- ingressclass也是没有namesapce隔离的
~~~     service/ingress/HPA/ConfigMap/Secret/Volume/CronJob/Taint&Toleration、
~~~     InitContainer/Affinity/EphemeralContainers都是有namespace隔离的。

[root@k8s-master01 ~]# kubectl get ingressclass
六、查看secret
### --- 查看secret 
~~~     针对不同的namespace查看到的结果是不一样的。

[root@k8s-master01 ~]# kubectl get secret
NAME                  TYPE                                  DATA   AGE
default-token-6d2lx   kubernetes.io/service-account-token   3      4d23h
[root@k8s-master01 ~]# kubectl get secret -n kube-system
NAME                                             TYPE                                  DATA   AGE
admin-user-token-nh8n7                           kubernetes.io/service-account-token   3      4d21h
attachdetach-controller-token-bgkqs              kubernetes.io/service-account-token   3      4d23h 

 
 
 
 
 
 
 
 
 

Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart
                                                                                                                                                   ——W.S.Landor

 

 

posted on   yanqi_vip  阅读(45)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示