IT

No resources found in default namespace. kubectl get pods

노트에버 2020. 7. 2. 16:27

pod를 생성하지 않아서 생긴 문제

[root@localhost system]# kubectl get pods                                      

No resources found in default namespace.

 

[root@localhost system]# vi pod-nginx.yaml

 

apiVersion: v1

kind: Pod

metadata:

  name: nginx

  labels:

    env: test

spec:

  containers:

  - name: nginx

    image: nginx

    imagePullPolicy: IfNotPresent

  nodeSelector:

    disktype: ssd

 

 

[root@localhost ~]# kubectl apply -f i.yaml 
pod/nginx created

 

[root@localhost ~]# kubectl get pod

NAME    READY   STATUS    RESTARTS   AGE
nginx   0/1     Pending   0          2m16s