kubectl timeout inside kube-addon-manager












0














I was debugging a issue from my cluster, seems kubectl commands timeout inside the kube-addon-manager pod, while the equivalent curl command works fine.



bash-4.3# kubectl get node --v 10
I1119 16:35:55.506867 54 round_trippers.go:386] curl -k -v -XGET -H "Accept: application/json, */*" -H "User-Agent: kubectl/v1.10.5 (linux/amd64) kubernetes/32ac1c9" http://localhost:8080/api
I1119 16:36:25.507550 54 round_trippers.go:405] GET http://localhost:8080/api in 30000 milliseconds
I1119 16:36:25.507959 54 round_trippers.go:411] Response Headers:
I1119 16:36:25.508122 54 cached_discovery.go:124] skipped caching discovery info due to Get http://localhost:8080/api: dial tcp: i/o timeout


Equivalent curl command output



bash-4.3# curl -k -v -XGET  -H "Accept: application/json, */*" -H "User-Agent: kubectl/v1.10.5 (linux/amd64) kubernetes/32ac1c9" http://localhost:8080/api
Note: Unnecessary use of -X or --request, GET is already inferred.
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /api HTTP/1.1
> Host: localhost:8080
> Accept: application/json, */*
> User-Agent: kubectl/v1.10.5 (linux/amd64) kubernetes/32ac1c9
>
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Mon, 19 Nov 2018 16:43:00 GMT
< Content-Length: 134
<
{"kind":"APIVersions","versions":["v1"],"serverAddressByClientCIDRs":[{"clientCIDR":"0.0.0.0/0","serverAddress":"172.16.1.13:6443"}]}
* Connection #0 to host localhost left intact


Also tried to run a docker container with host network mode, kubectl command still timeout.



kube-addon-manager.yaml



apiVersion: v1
kind: Pod
metadata:
name: kube-addon-manager
namespace: kube-system
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
labels:
component: kube-addon-manager
spec:
hostNetwork: true
containers:
- name: kube-addon-manager
image: gcr.io/google-containers/kube-addon-manager:v8.6
imagePullPolicy: IfNotPresent
command:
- /bin/bash
- -c
- /opt/kube-addons.sh
resources:
requests:
cpu: 5m
memory: 50Mi
volumeMounts:
- mountPath: /etc/kubernetes/
name: addons
readOnly: true
volumes:
- name: addons
hostPath:
path: /etc/kubernetes/









share|improve this question





























    0














    I was debugging a issue from my cluster, seems kubectl commands timeout inside the kube-addon-manager pod, while the equivalent curl command works fine.



    bash-4.3# kubectl get node --v 10
    I1119 16:35:55.506867 54 round_trippers.go:386] curl -k -v -XGET -H "Accept: application/json, */*" -H "User-Agent: kubectl/v1.10.5 (linux/amd64) kubernetes/32ac1c9" http://localhost:8080/api
    I1119 16:36:25.507550 54 round_trippers.go:405] GET http://localhost:8080/api in 30000 milliseconds
    I1119 16:36:25.507959 54 round_trippers.go:411] Response Headers:
    I1119 16:36:25.508122 54 cached_discovery.go:124] skipped caching discovery info due to Get http://localhost:8080/api: dial tcp: i/o timeout


    Equivalent curl command output



    bash-4.3# curl -k -v -XGET  -H "Accept: application/json, */*" -H "User-Agent: kubectl/v1.10.5 (linux/amd64) kubernetes/32ac1c9" http://localhost:8080/api
    Note: Unnecessary use of -X or --request, GET is already inferred.
    * Trying 127.0.0.1...
    * TCP_NODELAY set
    * Connected to localhost (127.0.0.1) port 8080 (#0)
    > GET /api HTTP/1.1
    > Host: localhost:8080
    > Accept: application/json, */*
    > User-Agent: kubectl/v1.10.5 (linux/amd64) kubernetes/32ac1c9
    >
    < HTTP/1.1 200 OK
    < Content-Type: application/json
    < Date: Mon, 19 Nov 2018 16:43:00 GMT
    < Content-Length: 134
    <
    {"kind":"APIVersions","versions":["v1"],"serverAddressByClientCIDRs":[{"clientCIDR":"0.0.0.0/0","serverAddress":"172.16.1.13:6443"}]}
    * Connection #0 to host localhost left intact


    Also tried to run a docker container with host network mode, kubectl command still timeout.



    kube-addon-manager.yaml



    apiVersion: v1
    kind: Pod
    metadata:
    name: kube-addon-manager
    namespace: kube-system
    annotations:
    scheduler.alpha.kubernetes.io/critical-pod: ''
    labels:
    component: kube-addon-manager
    spec:
    hostNetwork: true
    containers:
    - name: kube-addon-manager
    image: gcr.io/google-containers/kube-addon-manager:v8.6
    imagePullPolicy: IfNotPresent
    command:
    - /bin/bash
    - -c
    - /opt/kube-addons.sh
    resources:
    requests:
    cpu: 5m
    memory: 50Mi
    volumeMounts:
    - mountPath: /etc/kubernetes/
    name: addons
    readOnly: true
    volumes:
    - name: addons
    hostPath:
    path: /etc/kubernetes/









    share|improve this question



























      0












      0








      0







      I was debugging a issue from my cluster, seems kubectl commands timeout inside the kube-addon-manager pod, while the equivalent curl command works fine.



      bash-4.3# kubectl get node --v 10
      I1119 16:35:55.506867 54 round_trippers.go:386] curl -k -v -XGET -H "Accept: application/json, */*" -H "User-Agent: kubectl/v1.10.5 (linux/amd64) kubernetes/32ac1c9" http://localhost:8080/api
      I1119 16:36:25.507550 54 round_trippers.go:405] GET http://localhost:8080/api in 30000 milliseconds
      I1119 16:36:25.507959 54 round_trippers.go:411] Response Headers:
      I1119 16:36:25.508122 54 cached_discovery.go:124] skipped caching discovery info due to Get http://localhost:8080/api: dial tcp: i/o timeout


      Equivalent curl command output



      bash-4.3# curl -k -v -XGET  -H "Accept: application/json, */*" -H "User-Agent: kubectl/v1.10.5 (linux/amd64) kubernetes/32ac1c9" http://localhost:8080/api
      Note: Unnecessary use of -X or --request, GET is already inferred.
      * Trying 127.0.0.1...
      * TCP_NODELAY set
      * Connected to localhost (127.0.0.1) port 8080 (#0)
      > GET /api HTTP/1.1
      > Host: localhost:8080
      > Accept: application/json, */*
      > User-Agent: kubectl/v1.10.5 (linux/amd64) kubernetes/32ac1c9
      >
      < HTTP/1.1 200 OK
      < Content-Type: application/json
      < Date: Mon, 19 Nov 2018 16:43:00 GMT
      < Content-Length: 134
      <
      {"kind":"APIVersions","versions":["v1"],"serverAddressByClientCIDRs":[{"clientCIDR":"0.0.0.0/0","serverAddress":"172.16.1.13:6443"}]}
      * Connection #0 to host localhost left intact


      Also tried to run a docker container with host network mode, kubectl command still timeout.



      kube-addon-manager.yaml



      apiVersion: v1
      kind: Pod
      metadata:
      name: kube-addon-manager
      namespace: kube-system
      annotations:
      scheduler.alpha.kubernetes.io/critical-pod: ''
      labels:
      component: kube-addon-manager
      spec:
      hostNetwork: true
      containers:
      - name: kube-addon-manager
      image: gcr.io/google-containers/kube-addon-manager:v8.6
      imagePullPolicy: IfNotPresent
      command:
      - /bin/bash
      - -c
      - /opt/kube-addons.sh
      resources:
      requests:
      cpu: 5m
      memory: 50Mi
      volumeMounts:
      - mountPath: /etc/kubernetes/
      name: addons
      readOnly: true
      volumes:
      - name: addons
      hostPath:
      path: /etc/kubernetes/









      share|improve this question















      I was debugging a issue from my cluster, seems kubectl commands timeout inside the kube-addon-manager pod, while the equivalent curl command works fine.



      bash-4.3# kubectl get node --v 10
      I1119 16:35:55.506867 54 round_trippers.go:386] curl -k -v -XGET -H "Accept: application/json, */*" -H "User-Agent: kubectl/v1.10.5 (linux/amd64) kubernetes/32ac1c9" http://localhost:8080/api
      I1119 16:36:25.507550 54 round_trippers.go:405] GET http://localhost:8080/api in 30000 milliseconds
      I1119 16:36:25.507959 54 round_trippers.go:411] Response Headers:
      I1119 16:36:25.508122 54 cached_discovery.go:124] skipped caching discovery info due to Get http://localhost:8080/api: dial tcp: i/o timeout


      Equivalent curl command output



      bash-4.3# curl -k -v -XGET  -H "Accept: application/json, */*" -H "User-Agent: kubectl/v1.10.5 (linux/amd64) kubernetes/32ac1c9" http://localhost:8080/api
      Note: Unnecessary use of -X or --request, GET is already inferred.
      * Trying 127.0.0.1...
      * TCP_NODELAY set
      * Connected to localhost (127.0.0.1) port 8080 (#0)
      > GET /api HTTP/1.1
      > Host: localhost:8080
      > Accept: application/json, */*
      > User-Agent: kubectl/v1.10.5 (linux/amd64) kubernetes/32ac1c9
      >
      < HTTP/1.1 200 OK
      < Content-Type: application/json
      < Date: Mon, 19 Nov 2018 16:43:00 GMT
      < Content-Length: 134
      <
      {"kind":"APIVersions","versions":["v1"],"serverAddressByClientCIDRs":[{"clientCIDR":"0.0.0.0/0","serverAddress":"172.16.1.13:6443"}]}
      * Connection #0 to host localhost left intact


      Also tried to run a docker container with host network mode, kubectl command still timeout.



      kube-addon-manager.yaml



      apiVersion: v1
      kind: Pod
      metadata:
      name: kube-addon-manager
      namespace: kube-system
      annotations:
      scheduler.alpha.kubernetes.io/critical-pod: ''
      labels:
      component: kube-addon-manager
      spec:
      hostNetwork: true
      containers:
      - name: kube-addon-manager
      image: gcr.io/google-containers/kube-addon-manager:v8.6
      imagePullPolicy: IfNotPresent
      command:
      - /bin/bash
      - -c
      - /opt/kube-addons.sh
      resources:
      requests:
      cpu: 5m
      memory: 50Mi
      volumeMounts:
      - mountPath: /etc/kubernetes/
      name: addons
      readOnly: true
      volumes:
      - name: addons
      hostPath:
      path: /etc/kubernetes/






      docker kubernetes kubectl client-go






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 19 '18 at 16:55

























      asked Nov 19 '18 at 16:49









      flynn

      1316




      1316
























          1 Answer
          1






          active

          oldest

          votes


















          1














          Seems like in your config you are trying to talk to port 8080 which is the insecure port in the kube-apiserver.



          You can try starting your kube-apiserver with this option:



          --insecure-port


          The default for the insecure port is 8080. Note that this option might be deprecated in the future.



          Also, keep in mind the the kube-addon-manager is part of the legacy add-ons.






          share|improve this answer























          • No, I am using kubectl inside kube-addon-manager pod, not trying to connect to kube-addon-manager. That's what kube-addon-manager is doing, it uses kubectl to check addons status, reconcile them if needed. But now, kubectl command always timeout, makes kube-addon-manager unable to do reconcile thing.
            – flynn
            Nov 20 '18 at 2:46












          • I see what did you change in your cluster?
            – Rico
            Nov 20 '18 at 5:40










          • Actually, I have two clusters with exactly the same configuration, the other one works fine, this one doesn't. kubectl inside kube-addon-manager pod connects to apiserver insecure port 8080, but if I use a kubeconfig, which will connect to port 6443 instead, everything looks good. I know there is always one thing I miss, just don't know which one.
            – flynn
            Nov 20 '18 at 6:43












          • Try --insecure-port in your kube-apiserver, updated the answer
            – Rico
            Nov 20 '18 at 6:59











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53379246%2fkubectl-timeout-inside-kube-addon-manager%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          Seems like in your config you are trying to talk to port 8080 which is the insecure port in the kube-apiserver.



          You can try starting your kube-apiserver with this option:



          --insecure-port


          The default for the insecure port is 8080. Note that this option might be deprecated in the future.



          Also, keep in mind the the kube-addon-manager is part of the legacy add-ons.






          share|improve this answer























          • No, I am using kubectl inside kube-addon-manager pod, not trying to connect to kube-addon-manager. That's what kube-addon-manager is doing, it uses kubectl to check addons status, reconcile them if needed. But now, kubectl command always timeout, makes kube-addon-manager unable to do reconcile thing.
            – flynn
            Nov 20 '18 at 2:46












          • I see what did you change in your cluster?
            – Rico
            Nov 20 '18 at 5:40










          • Actually, I have two clusters with exactly the same configuration, the other one works fine, this one doesn't. kubectl inside kube-addon-manager pod connects to apiserver insecure port 8080, but if I use a kubeconfig, which will connect to port 6443 instead, everything looks good. I know there is always one thing I miss, just don't know which one.
            – flynn
            Nov 20 '18 at 6:43












          • Try --insecure-port in your kube-apiserver, updated the answer
            – Rico
            Nov 20 '18 at 6:59
















          1














          Seems like in your config you are trying to talk to port 8080 which is the insecure port in the kube-apiserver.



          You can try starting your kube-apiserver with this option:



          --insecure-port


          The default for the insecure port is 8080. Note that this option might be deprecated in the future.



          Also, keep in mind the the kube-addon-manager is part of the legacy add-ons.






          share|improve this answer























          • No, I am using kubectl inside kube-addon-manager pod, not trying to connect to kube-addon-manager. That's what kube-addon-manager is doing, it uses kubectl to check addons status, reconcile them if needed. But now, kubectl command always timeout, makes kube-addon-manager unable to do reconcile thing.
            – flynn
            Nov 20 '18 at 2:46












          • I see what did you change in your cluster?
            – Rico
            Nov 20 '18 at 5:40










          • Actually, I have two clusters with exactly the same configuration, the other one works fine, this one doesn't. kubectl inside kube-addon-manager pod connects to apiserver insecure port 8080, but if I use a kubeconfig, which will connect to port 6443 instead, everything looks good. I know there is always one thing I miss, just don't know which one.
            – flynn
            Nov 20 '18 at 6:43












          • Try --insecure-port in your kube-apiserver, updated the answer
            – Rico
            Nov 20 '18 at 6:59














          1












          1








          1






          Seems like in your config you are trying to talk to port 8080 which is the insecure port in the kube-apiserver.



          You can try starting your kube-apiserver with this option:



          --insecure-port


          The default for the insecure port is 8080. Note that this option might be deprecated in the future.



          Also, keep in mind the the kube-addon-manager is part of the legacy add-ons.






          share|improve this answer














          Seems like in your config you are trying to talk to port 8080 which is the insecure port in the kube-apiserver.



          You can try starting your kube-apiserver with this option:



          --insecure-port


          The default for the insecure port is 8080. Note that this option might be deprecated in the future.



          Also, keep in mind the the kube-addon-manager is part of the legacy add-ons.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 20 '18 at 6:59

























          answered Nov 20 '18 at 2:20









          Rico

          26.5k94864




          26.5k94864












          • No, I am using kubectl inside kube-addon-manager pod, not trying to connect to kube-addon-manager. That's what kube-addon-manager is doing, it uses kubectl to check addons status, reconcile them if needed. But now, kubectl command always timeout, makes kube-addon-manager unable to do reconcile thing.
            – flynn
            Nov 20 '18 at 2:46












          • I see what did you change in your cluster?
            – Rico
            Nov 20 '18 at 5:40










          • Actually, I have two clusters with exactly the same configuration, the other one works fine, this one doesn't. kubectl inside kube-addon-manager pod connects to apiserver insecure port 8080, but if I use a kubeconfig, which will connect to port 6443 instead, everything looks good. I know there is always one thing I miss, just don't know which one.
            – flynn
            Nov 20 '18 at 6:43












          • Try --insecure-port in your kube-apiserver, updated the answer
            – Rico
            Nov 20 '18 at 6:59


















          • No, I am using kubectl inside kube-addon-manager pod, not trying to connect to kube-addon-manager. That's what kube-addon-manager is doing, it uses kubectl to check addons status, reconcile them if needed. But now, kubectl command always timeout, makes kube-addon-manager unable to do reconcile thing.
            – flynn
            Nov 20 '18 at 2:46












          • I see what did you change in your cluster?
            – Rico
            Nov 20 '18 at 5:40










          • Actually, I have two clusters with exactly the same configuration, the other one works fine, this one doesn't. kubectl inside kube-addon-manager pod connects to apiserver insecure port 8080, but if I use a kubeconfig, which will connect to port 6443 instead, everything looks good. I know there is always one thing I miss, just don't know which one.
            – flynn
            Nov 20 '18 at 6:43












          • Try --insecure-port in your kube-apiserver, updated the answer
            – Rico
            Nov 20 '18 at 6:59
















          No, I am using kubectl inside kube-addon-manager pod, not trying to connect to kube-addon-manager. That's what kube-addon-manager is doing, it uses kubectl to check addons status, reconcile them if needed. But now, kubectl command always timeout, makes kube-addon-manager unable to do reconcile thing.
          – flynn
          Nov 20 '18 at 2:46






          No, I am using kubectl inside kube-addon-manager pod, not trying to connect to kube-addon-manager. That's what kube-addon-manager is doing, it uses kubectl to check addons status, reconcile them if needed. But now, kubectl command always timeout, makes kube-addon-manager unable to do reconcile thing.
          – flynn
          Nov 20 '18 at 2:46














          I see what did you change in your cluster?
          – Rico
          Nov 20 '18 at 5:40




          I see what did you change in your cluster?
          – Rico
          Nov 20 '18 at 5:40












          Actually, I have two clusters with exactly the same configuration, the other one works fine, this one doesn't. kubectl inside kube-addon-manager pod connects to apiserver insecure port 8080, but if I use a kubeconfig, which will connect to port 6443 instead, everything looks good. I know there is always one thing I miss, just don't know which one.
          – flynn
          Nov 20 '18 at 6:43






          Actually, I have two clusters with exactly the same configuration, the other one works fine, this one doesn't. kubectl inside kube-addon-manager pod connects to apiserver insecure port 8080, but if I use a kubeconfig, which will connect to port 6443 instead, everything looks good. I know there is always one thing I miss, just don't know which one.
          – flynn
          Nov 20 '18 at 6:43














          Try --insecure-port in your kube-apiserver, updated the answer
          – Rico
          Nov 20 '18 at 6:59




          Try --insecure-port in your kube-apiserver, updated the answer
          – Rico
          Nov 20 '18 at 6:59


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53379246%2fkubectl-timeout-inside-kube-addon-manager%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          MongoDB - Not Authorized To Execute Command

          in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith

          How to fix TextFormField cause rebuild widget in Flutter