2017-09-05 1 views
0

그래서 HypriotOS를 실행하는 3 개의 나무 딸기 피를 실행하는 3 노드 kubernetes 클러스터가 있습니다. 나는 직조를 설치하는 것을 제외하고 노드를 시작하고 합류 한 이후로 아무 것도하지 않았습니다. 내가 kubectl cluster-info를 입력 할 때 그러나, 나는 두 가지 옵션이 제공하고 있습니다Kubernetes "서비스에 사용할 수있는 끝 점이 없습니다."kube-dns ""

Kubernetes master is running at https://192.168.0.35:6443 
KubeDNS is running at https://192.168.0.35:6443/api/v1/namespaces/kube-system/services/kube-dns/proxy 

나는 다음과 같은 응답 얻는 두 번째 URL을 말릴 때 :

{ 
    "kind": "Status", 
    "apiVersion": "v1", 
    "metadata": {}, 
    "status": "Failure", 
    "message": "no endpoints available for service \"kube-dns\"", 
    "reason": "ServiceUnavailable", 
    "code": 503 
} 

여기 내 클러스터의 상태에 대한 좀 더 많은 정보의를 .

$ kubectl version 
Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.4", GitCommit:"793658f2d7ca7f064d2bdf606519f9fe1229c381", GitTreeState:"clean", BuildDate:"2017-08-17T08:48:23Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/arm"} 
Server Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.4", GitCommit:"793658f2d7ca7f064d2bdf606519f9fe1229c381", GitTreeState:"clean", BuildDate:"2017-08-17T08:30:51Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/arm"} 




$ kubectl get pods --all-namespaces 
NAMESPACE  NAME         READY  STATUS    RESTARTS AGE 
kube-system etcd-node01        1/1  Running   0   13d 
kube-system kube-apiserver-node01     1/1  Running   21   13d 
kube-system kube-controller-manager-node01   1/1  Running   5   13d 
kube-system kube-dns-2459497834-v1g4n    3/3  Running   43   13d 
kube-system kube-proxy-1hplm      1/1  Running   0   5h 
kube-system kube-proxy-6bzvr      1/1  Running   0   13d 
kube-system kube-proxy-cmp3q      1/1  Running   0   6d 
kube-system kube-scheduler-node01     1/1  Running   8   13d 
kube-system weave-net-5cq9c       2/2  Running   0   6d 
kube-system weave-net-ff5sz       2/2  Running   4   13d 
kube-system weave-net-z3nq3       2/2  Running   0   5h 


$ kubectl get svc --all-namespaces 
NAMESPACE  NAME     CLUSTER-IP  EXTERNAL-IP PORT(S)   AGE 
default  kubernetes    10.96.0.1  <none>  443/TCP   13d 
kube-system kube-dns    10.96.0.10  <none>  53/UDP,53/TCP 13d 


$ kubectl --namespace kube-system describe pod kube-dns-2459497834-v1g4n 
Name:   kube-dns-2459497834-v1g4n 
Namespace:  kube-system 
Node:   node01/192.168.0.35 
Start Time:  Wed, 23 Aug 2017 20:34:56 +0000 
Labels:   k8s-app=kube-dns 
       pod-template-hash=2459497834 
Annotations: kubernetes.io/created-by={"kind":"SerializedReference","apiVersion":"v1","reference":{"kind":"ReplicaSet","namespace":"kube-system","name":"kube-dns-2459497834","uid":"37640de4-8841-11e7-ad32-b827eb0a... 
       scheduler.alpha.kubernetes.io/critical-pod= 
Status:   Running 
IP:    10.32.0.2 
Created By:  ReplicaSet/kube-dns-2459497834 
Controlled By: ReplicaSet/kube-dns-2459497834 
Containers: 
    kubedns: 
    Container ID:  docker://9a781f1fea4c947a9115c551e65c232d5fe0aa2045e27e79eae4b057b68e4914 
    Image:    gcr.io/google_containers/k8s-dns-kube-dns-arm:1.14.4 
    Image ID:   docker-pullable://gcr.io/google_containers/[email protected]:ac677e54bef9717220a0ba2275ba706111755b2906de689d71ac44bfe425946d 
    Ports:    10053/UDP, 10053/TCP, 10055/TCP 
    Args: 
     --domain=cluster.local. 
     --dns-port=10053 
     --config-dir=/kube-dns-config 
     --v=2 
    State:    Running 
     Started:   Tue, 29 Aug 2017 19:09:10 +0000 
    Last State:   Terminated 
     Reason:   Error 
     Exit Code:  137 
     Started:   Tue, 29 Aug 2017 17:07:49 +0000 
     Finished:   Tue, 29 Aug 2017 19:09:08 +0000 
    Ready:    True 
    Restart Count:  18 
    Limits: 
     memory: 170Mi 
    Requests: 
     cpu:  100m 
     memory: 70Mi 
    Liveness: http-get http://:10054/healthcheck/kubedns delay=60s timeout=5s period=10s #success=1 #failure=5 
    Readiness: http-get http://:8081/readiness delay=3s timeout=5s period=10s #success=1 #failure=3 
    Environment: 
     PROMETHEUS_PORT: 10055 
    Mounts: 
     /kube-dns-config from kube-dns-config (rw) 
     /var/run/secrets/kubernetes.io/serviceaccount from kube-dns-token-rf19g (ro) 
    dnsmasq: 
    Container ID:  docker://f8e17df36310bc3423a74e3f6989204abac9e83d4a8366561e54259418030a50 
    Image:    gcr.io/google_containers/k8s-dns-dnsmasq-nanny-arm:1.14.4 
    Image ID:   docker-pullable://gcr.io/google_containers/[email protected]:a7469e91b4b20f31036448a61c52e208833c7cb283faeb4ea51b9fa22e18eb69 
    Ports:    53/UDP, 53/TCP 
    Args: 
     -v=2 
     -logtostderr 
     -configDir=/etc/k8s/dns/dnsmasq-nanny 
     -restartDnsmasq=true 
     -- 
     -k 
     --cache-size=1000 
     --log-facility=- 
     --server=/cluster.local/127.0.0.1#10053 
     --server=/in-addr.arpa/127.0.0.1#10053 
     --server=/ip6.arpa/127.0.0.1#10053 
    State:    Running 
     Started:   Tue, 29 Aug 2017 19:09:52 +0000 
    Last State:   Terminated 
     Reason:   Error 
     Exit Code:  137 


$ kubectl --namespace kube-system describe svc kube-dns 
Name:   kube-dns 
Namespace:  kube-system 
Labels:   k8s-app=kube-dns 
      kubernetes.io/cluster-service=true 
      kubernetes.io/name=KubeDNS 
Annotations:  <none> 
Selector:  k8s-app=kube-dns 
Type:   ClusterIP 
IP:   10.96.0.10 
Port:   dns 53/UDP 
Endpoints:  10.32.0.2:53 
Port:   dns-tcp 53/TCP 
Endpoints:  10.32.0.2:53 
Session Affinity: None 
Events:   <none> 

내가 지시 here에 따라 이외의 아무것도하지 않은 때문에 내가 여기에 무슨 일이 일어나고 있는지 알아낼 수 없습니다. 이 문제는 여러 버전의 kubernetes와 여러 네트워크 오버레이 (flannel 포함)간에 유지되었습니다. 그래서 그것은 내가 rpis와 관련하여 약간의 문제라고 생각하게 만듭니다.

+1

kubectl --namespace kube-system pod kube-dns-2459497834-v1g4n을 설명하고 kubectl --namespace kube-system은 svc kube-dns를 설명합니다. –

+0

관련 정보를 추가했습니다. 보시다시피 포드가 실행 중이지만 지금도 계속 다시 시작됩니다. 여기에 다른 무엇이 있는지 확실하지 않습니다. – jzeef

답변

0

업데이트 : 아래의 가정은이 오류 메시지에 대한 완전한 설명이 아닙니다. proxy API 상태 :

연결 프록시 포드

GET/API/V1/네임 스페이스/{네임 스페이스}/포드/{이름}/프록시 프록시

연결 GET 요청을 만들기

이제는 connect GET requests to proxy of Pod이 무엇을 의미하는지 정확히 모르겠다. 그러나 나는 GET 요청을 포드에 전달한다는 것을 강하게 믿는다. 이것은 아래의 가정이 정확하다는 것을 의미합니다.

HTTP 트래픽 용으로 설계되지 않은 다른 서비스와 함께이 모든 오류 메시지가 표시되는 반면 HTTP 트래픽 용으로 설계된 서비스는 제대로 작동합니다 (예 : /api/v1/namespaces/kube-system/services/kubernetes-dashboard/proxy).


나는 정상적인 행동이라고 생각합니다. 걱정할 필요가 없습니다. 클러스터 내의 kube-dns 서비스 개체를 보면 표준 DNS 포트 인 포트 53의 내부 끝점 만 서비스한다는 것을 알 수 있습니다. 따라서 kube-dns 서비스가 적절한 DNS 쿼리에만 응답한다고 가정합니다. 컬을 사용하면이 서비스에서 정상적인 GET 요청을하려고하는데, 이는 오류 응답으로 이어질 것입니다.

주어진 클러스터 정보에서 모든 pod가 잘 보이고 서비스 엔드 포인트가 제대로 노출 될 것입니다. 당신은 그런 걸 양보해야하는 kubectl get ep kube-dns --namespace=kube-system을 통해 자료를 확인할 수 있습니다 내 클러스터에

$ kubectl get ep kube-dns --namespace=kube-system 
NAME  ENDPOINTS               AGE 
kube-dns 100.101.26.65:53,100.96.150.198:53,100.101.26.65:53 + 1 more... 20d 

을 (K8S 1.7.3) /api/v1/namespaces/kube-system/services/kube-dns/proxy에 컬 GET은 또한 당신의 언급 한 오류 메시지로 연결,하지만 난 DNS 문제를했다, 그래서 결코 I 이 가정에 대한 내 가정이 맞길 바랍니다.

관련 문제