본문 바로가기

Cloud/Kubernetes

Kubernetes 특정 네임 스페이스의 전체 리소스 조회

kubectl get all을 통해 조회할 수 있지만, 특정 몇 개의 리소스만 조회 된다.

- Kubectl get all -n cdi

root@c1:~# kubectl get all -n cdi
NAME                                   READY   STATUS    RESTARTS   AGE
pod/cdi-apiserver-5766fc84f7-dwgjw     1/1     Running   1          6d22h
pod/cdi-deployment-555f466b8-4ts68     1/1     Running   230        7d
pod/cdi-operator-7d8b795cc5-v9dfd      1/1     Running   2          47h
pod/cdi-uploadproxy-74ddfb494f-z75px   1/1     Running   1          7d


NAME                      TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE
service/cdi-api           ClusterIP   10.96.232.107   <none>        443/TCP   50d
service/cdi-uploadproxy   ClusterIP   10.96.99.117    <none>        443/TCP   50d


NAME                              READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/cdi-apiserver     1/1     1            1           50d
deployment.apps/cdi-deployment    1/1     1            1           50d
deployment.apps/cdi-operator      1/1     1            1           50d
deployment.apps/cdi-uploadproxy   1/1     1            1           50d

NAME                                         DESIRED   CURRENT   READY   AGE
replicaset.apps/cdi-apiserver-5766fc84f7     1         1         1       50d
replicaset.apps/cdi-deployment-555f466b8     1         1         1       50d
replicaset.apps/cdi-operator-7d8b795cc5      1         1         1       50d
replicaset.apps/cdi-uploadproxy-74ddfb494f   1         1         1       50d

NAME                               AGE
cdiconfig.cdi.kubevirt.io/config   50d

NAME                      AGE   PHASE
cdi.cdi.kubevirt.io/cdi   50d   Deployed

아래 명령어를 통해 모든 리소스의 조회가 가능하다.

kubectl api-resources --verbs=list --namespaced -o name | xargs -n 1 kubectl get --show-kind --ignore-not-found -n [namespace]

- kubectl api-resources --verbs=list --namespaced -o name | xargs -n 1 kubectl get --show-kind --ignore-not-found -n cdi

root@c1:~# kubectl api-resources --verbs=list --namespaced -o name | xargs -n 1 kubectl get --show-kind --ignore-not-found -n cdi
NAME                                              DATA   AGE
configmap/cdi-config                              0      50d
configmap/cdi-controller-leader-election-helper   0      50d
configmap/cdi-insecure-registries                 1      50d
configmap/cdi-operator-leader-election-helper     0      50d
NAME                        ENDPOINTS             AGE
endpoints/cdi-api           10.244.253.233:8443   50d
endpoints/cdi-uploadproxy   10.244.253.225:8443   50d
NAME                                   READY   STATUS    RESTARTS   AGE
pod/cdi-apiserver-5766fc84f7-dwgjw     1/1     Running   1          6d22h
pod/cdi-deployment-555f466b8-4ts68     1/1     Running   230        7d
pod/cdi-operator-7d8b795cc5-v9dfd      1/1     Running   2          47h
pod/cdi-uploadproxy-74ddfb494f-z75px   1/1     Running   1          7d
NAME                                     TYPE                                  DATA   AGE
secret/cdi-api-server-cert               Opaque                                3      50d
secret/cdi-api-signing-key               Opaque                                2      50d
secret/cdi-apiserver-token-2cn7f         kubernetes.io/service-account-token   3      50d
secret/cdi-operator-token-h4xq9          kubernetes.io/service-account-token   3      50d
secret/cdi-sa-token-6qfd4                kubernetes.io/service-account-token   3      50d
secret/cdi-upload-proxy-ca-key           Opaque                                2      50d
secret/cdi-upload-proxy-server-key       Opaque                                2      50d
secret/cdi-upload-server-ca-key          Opaque                                2      50d
secret/cdi-upload-server-client-ca-key   Opaque                                2      50d
secret/cdi-upload-server-client-key      Opaque                                3      50d
secret/cdi-uploadproxy-token-4cvrh       kubernetes.io/service-account-token   3      50d
secret/default-token-wts4p               kubernetes.io/service-account-token   3      50d
NAME                             SECRETS   AGE
serviceaccount/cdi-apiserver     1         50d
serviceaccount/cdi-operator      1         50d
serviceaccount/cdi-sa            1         50d
serviceaccount/cdi-uploadproxy   1         50d
serviceaccount/default           1         50d
NAME                      TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE
service/cdi-api           ClusterIP   10.96.232.107   <none>        443/TCP   50d
service/cdi-uploadproxy   ClusterIP   10.96.99.117    <none>        443/TCP   50d
NAME                              READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/cdi-apiserver     1/1     1            1           50d
deployment.apps/cdi-deployment    1/1     1            1           50d
deployment.apps/cdi-operator      1/1     1            1           50d
deployment.apps/cdi-uploadproxy   1/1     1            1           50d
NAME                                         DESIRED   CURRENT   READY   AGE
replicaset.apps/cdi-apiserver-5766fc84f7     1         1         1       50d
replicaset.apps/cdi-deployment-555f466b8     1         1         1       50d
replicaset.apps/cdi-operator-7d8b795cc5      1         1         1       50d
replicaset.apps/cdi-uploadproxy-74ddfb494f   1         1         1       50d
NAME                                    READY   UP-TO-DATE   AVAILABLE   AGE
deployment.extensions/cdi-apiserver     1/1     1            1           50d
deployment.extensions/cdi-deployment    1/1     1            1           50d
deployment.extensions/cdi-operator      1/1     1            1           50d
deployment.extensions/cdi-uploadproxy   1/1     1            1           50d
NAME                                               DESIRED   CURRENT   READY   AGE
replicaset.extensions/cdi-apiserver-5766fc84f7     1         1         1       50d
replicaset.extensions/cdi-deployment-555f466b8     1         1         1       50d
replicaset.extensions/cdi-operator-7d8b795cc5      1         1         1       50d
replicaset.extensions/cdi-uploadproxy-74ddfb494f   1         1         1       50d
NAME                                                         AGE
podmetrics.metrics.k8s.io/cdi-uploadproxy-74ddfb494f-z75px   0s
podmetrics.metrics.k8s.io/cdi-operator-7d8b795cc5-v9dfd      0s
podmetrics.metrics.k8s.io/cdi-deployment-555f466b8-4ts68     0s
podmetrics.metrics.k8s.io/cdi-apiserver-5766fc84f7-dwgjw     0s
NAME                                                  AGE
rolebinding.rbac.authorization.k8s.io/cdi-apiserver   50d
NAME                                           AGE
role.rbac.authorization.k8s.io/cdi-apiserver   50d