>source

내 로컬 PC에 statefulset을 배포하고 있습니다 (연구를 위해). 링크

이 단계에서 :

kubectl run -i --tty --image busybox:1.28 dns-test --restart=Never --rm  
nslookup web-0.nginx

이 오류가 발생했습니다 :

nslookup web-0.nginx
Server:    10.96.0.10
Address 1: 10.96.0.10
nslookup: can't resolve 'web-0.nginx'

포드 및 노드가 여전히 올바르게 작동하고 있으며 코어 ID가 올바르게 실행 중입니다

kube-system   coredns-fb8b8dccf-hbrhw           1/1     Running   0       26m
kube-system   coredns-fb8b8dccf-rmrwp           1/1     Running   0       26m

[email protected]:~/Documents$ kubectl get --all-namespaces=true -o wide pods
NAMESPACE     NAME                              READY   STATUS    RESTARTS   AGE   IP                NODE      NOMINATED NODE   READINESS GATES
default       busybox                           1/1     Running   1          65m   10.244.1.218      knode     <none>           <none>
default       web-0                             1/1     Running   0          75m   10.244.1.215      knode     <none>           <none>
default       web-1                             1/1     Running   0          75m   10.244.1.216      knode     <none>           <none>
kube-system   coredns-fb8b8dccf-hbrhw           1/1     Running   0          51m   10.244.1.219      knode     <none>           <none>
kube-system   coredns-fb8b8dccf-rmrwp           1/1     Running   0          51m   10.244.0.37       kmaster   <none>           <none>
kube-system   etcd-kmaster                      1/1     Running   20         20d   192.168.146.132   kmaster   <none>           <none>
kube-system   kube-apiserver-kmaster            1/1     Running   514        20d   192.168.146.132   kmaster   <none>           <none>
kube-system   kube-controller-manager-kmaster   1/1     Running   144        20d   192.168.146.132   kmaster   <none>           <none>
kube-system   kube-flannel-ds-amd64-ndpjq       1/1     Running   0          76m   192.168.146.129   knode     <none>           <none>
kube-system   kube-flannel-ds-amd64-s2vhp       1/1     Running   0          76m   192.168.146.132   kmaster   <none>           <none>
kube-system   kube-proxy-dk5jd                  1/1     Running   6          20d   192.168.146.132   kmaster   <none>           <none>
kube-system   kube-proxy-ts79l                  1/1     Running   2          20d   192.168.146.129   knode     <none>           <none>
kube-system   kube-scheduler-kmaster            1/1     Running   172        20d   192.168.146.132   kmaster   <none>           <none>
[email protected]:~$ kubectl get svc 
NAME         TYPE        CLUSTER-IP  EXTERNAL-IP   PORT(S)   AGE
kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   21d
nginx        ClusterIP   None         <none>        80/TCP    6h8m

내가 뭔가를 놓쳤습니까? 누군가 나를 도울 수 있습니다. 감사합니다!

  • 답변 # 1

    nginx statefulset은 아래와 같이 기본 네임 스페이스에 배포됩니다

    default       web-0                             1/1     Running   0          75m   10.244.1.215      knode     <none>           <none>
    default       web-1                             1/1     Running   0          75m   10.244.1.216      knode     <none>           <none>
    
    

    이것은 테스트해야하는 방법입니다

    master $ kubectl get po
    NAME      READY     STATUS    RESTARTS   AGE
    web-0     1/1       Running   0          1m
    web-1     1/1       Running   0          1m
    master $ kubectl get svc
    NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
    kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   35m
    nginx        ClusterIP   None         <none>        80/TCP    2m
    master $ kubectl run -i --tty --image busybox:1.28 dns-test --restart=Never --rm
    If you don't see a command prompt, try pressing enter.
    / # nslookup nginx
    Server:    10.96.0.10
    Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local
    Name:      nginx
    Address 1: 10.40.0.1 web-0.nginx.default.svc.cluster.local
    Address 2: 10.40.0.2 web-1.nginx.default.svc.cluster.local
    / #
    / # nslookup web-0.nginx
    Server:    10.96.0.10
    Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local
    Name:      web-0.nginx
    Address 1: 10.40.0.1 web-0.nginx.default.svc.cluster.local
    / # nslookup web-0.nginx.default.svc.cluster.local
    Server:    10.96.0.10
    Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local
    Name:      web-0.nginx.default.svc.cluster.local
    Address 1: 10.40.0.1 web-0.nginx.default.svc.cluster.local
    
    

  • 이전 java - 의도적으로 앱 생성 이미지를 보내는 방법
  • 다음 python - 팬더 CSV 데이터 프레임