Provide node name to kubeadm init using config file












1















I need to provide a specific node name to my master node in kuberenetes. I am using kubeadm to setup my cluster and I know there is an option --node-name master which you can provide to kubeadm init and it works fine.



Now, the issue is I am using the config file to initialise the cluster and I have tried various ways to provide that node-name to the cluster but it is not picking up the name. My config file of kubeadm init is:



apiVersion: kubeadm.k8s.io/v1alpha1
kind: MasterConfiguration
api:
advertiseAddress: 10.0.1.149
controlPlaneEndpoint: 10.0.1.149
etcd:
endpoints:
- http://10.0.1.149:2379
caFile: /etc/kubernetes/pki/etcd/ca.pem
certFile: /etc/kubernetes/pki/etcd/client.pem
keyFile: /etc/kubernetes/pki/etcd/client-key.pem
networking:
podSubnet: 192.168.13.0/24
kubernetesVersion: 1.10.3
apiServerCertSANs:
- 10.0.1.149
apiServerExtraArgs:
endpoint-reconciler-type: lease
nodeRegistration:
name: master


Now I run kubeadm init --config=config.yaml and it timeouts with following error:



[uploadconfig] Storing the configuration used in ConfigMap "kubeadm- 
config" in the "kube-system" Namespace
[markmaster] Will mark node ip-x-x-x-x.ec2.internal as master by
adding a label and a taint
timed out waiting for the condition


PS: This issue also comes when you don't provide --hostname-override to kubelet along with --node-name to kubeadm init. I am providing both. Also, I am not facing any issues when I don't use config.yaml file and use command line to provide --node-name option to kubeadm init.



I want to know how can we provide --node-name option in config.yaml file. Any pointers are appreciated.










share|improve this question



























    1















    I need to provide a specific node name to my master node in kuberenetes. I am using kubeadm to setup my cluster and I know there is an option --node-name master which you can provide to kubeadm init and it works fine.



    Now, the issue is I am using the config file to initialise the cluster and I have tried various ways to provide that node-name to the cluster but it is not picking up the name. My config file of kubeadm init is:



    apiVersion: kubeadm.k8s.io/v1alpha1
    kind: MasterConfiguration
    api:
    advertiseAddress: 10.0.1.149
    controlPlaneEndpoint: 10.0.1.149
    etcd:
    endpoints:
    - http://10.0.1.149:2379
    caFile: /etc/kubernetes/pki/etcd/ca.pem
    certFile: /etc/kubernetes/pki/etcd/client.pem
    keyFile: /etc/kubernetes/pki/etcd/client-key.pem
    networking:
    podSubnet: 192.168.13.0/24
    kubernetesVersion: 1.10.3
    apiServerCertSANs:
    - 10.0.1.149
    apiServerExtraArgs:
    endpoint-reconciler-type: lease
    nodeRegistration:
    name: master


    Now I run kubeadm init --config=config.yaml and it timeouts with following error:



    [uploadconfig] Storing the configuration used in ConfigMap "kubeadm- 
    config" in the "kube-system" Namespace
    [markmaster] Will mark node ip-x-x-x-x.ec2.internal as master by
    adding a label and a taint
    timed out waiting for the condition


    PS: This issue also comes when you don't provide --hostname-override to kubelet along with --node-name to kubeadm init. I am providing both. Also, I am not facing any issues when I don't use config.yaml file and use command line to provide --node-name option to kubeadm init.



    I want to know how can we provide --node-name option in config.yaml file. Any pointers are appreciated.










    share|improve this question

























      1












      1








      1








      I need to provide a specific node name to my master node in kuberenetes. I am using kubeadm to setup my cluster and I know there is an option --node-name master which you can provide to kubeadm init and it works fine.



      Now, the issue is I am using the config file to initialise the cluster and I have tried various ways to provide that node-name to the cluster but it is not picking up the name. My config file of kubeadm init is:



      apiVersion: kubeadm.k8s.io/v1alpha1
      kind: MasterConfiguration
      api:
      advertiseAddress: 10.0.1.149
      controlPlaneEndpoint: 10.0.1.149
      etcd:
      endpoints:
      - http://10.0.1.149:2379
      caFile: /etc/kubernetes/pki/etcd/ca.pem
      certFile: /etc/kubernetes/pki/etcd/client.pem
      keyFile: /etc/kubernetes/pki/etcd/client-key.pem
      networking:
      podSubnet: 192.168.13.0/24
      kubernetesVersion: 1.10.3
      apiServerCertSANs:
      - 10.0.1.149
      apiServerExtraArgs:
      endpoint-reconciler-type: lease
      nodeRegistration:
      name: master


      Now I run kubeadm init --config=config.yaml and it timeouts with following error:



      [uploadconfig] Storing the configuration used in ConfigMap "kubeadm- 
      config" in the "kube-system" Namespace
      [markmaster] Will mark node ip-x-x-x-x.ec2.internal as master by
      adding a label and a taint
      timed out waiting for the condition


      PS: This issue also comes when you don't provide --hostname-override to kubelet along with --node-name to kubeadm init. I am providing both. Also, I am not facing any issues when I don't use config.yaml file and use command line to provide --node-name option to kubeadm init.



      I want to know how can we provide --node-name option in config.yaml file. Any pointers are appreciated.










      share|improve this question














      I need to provide a specific node name to my master node in kuberenetes. I am using kubeadm to setup my cluster and I know there is an option --node-name master which you can provide to kubeadm init and it works fine.



      Now, the issue is I am using the config file to initialise the cluster and I have tried various ways to provide that node-name to the cluster but it is not picking up the name. My config file of kubeadm init is:



      apiVersion: kubeadm.k8s.io/v1alpha1
      kind: MasterConfiguration
      api:
      advertiseAddress: 10.0.1.149
      controlPlaneEndpoint: 10.0.1.149
      etcd:
      endpoints:
      - http://10.0.1.149:2379
      caFile: /etc/kubernetes/pki/etcd/ca.pem
      certFile: /etc/kubernetes/pki/etcd/client.pem
      keyFile: /etc/kubernetes/pki/etcd/client-key.pem
      networking:
      podSubnet: 192.168.13.0/24
      kubernetesVersion: 1.10.3
      apiServerCertSANs:
      - 10.0.1.149
      apiServerExtraArgs:
      endpoint-reconciler-type: lease
      nodeRegistration:
      name: master


      Now I run kubeadm init --config=config.yaml and it timeouts with following error:



      [uploadconfig] Storing the configuration used in ConfigMap "kubeadm- 
      config" in the "kube-system" Namespace
      [markmaster] Will mark node ip-x-x-x-x.ec2.internal as master by
      adding a label and a taint
      timed out waiting for the condition


      PS: This issue also comes when you don't provide --hostname-override to kubelet along with --node-name to kubeadm init. I am providing both. Also, I am not facing any issues when I don't use config.yaml file and use command line to provide --node-name option to kubeadm init.



      I want to know how can we provide --node-name option in config.yaml file. Any pointers are appreciated.







      kubernetes kubeadm






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 27 '18 at 6:11









      Prafull LadhaPrafull Ladha

      3,5981422




      3,5981422
























          1 Answer
          1






          active

          oldest

          votes


















          1














          I am able to resolve this issue using the following config file, Just updating if anyone encounters the same issue:



          apiVersion: kubeadm.k8s.io/v1alpha1
          kind: MasterConfiguration
          api:
          advertiseAddress: 10.0.1.149
          controlPlaneEndpoint: 10.0.1.149
          etcd:
          endpoints:
          - http://10.0.1.149:2379
          caFile: /etc/kubernetes/pki/etcd/ca.pem
          certFile: /etc/kubernetes/pki/etcd/client.pem
          keyFile: /etc/kubernetes/pki/etcd/client-key.pem
          networking:
          podSubnet: 192.168.13.0/24
          kubernetesVersion: 1.10.3
          apiServerCertSANs:
          - 10.0.1.149
          apiServerExtraArgs:
          endpoint-reconciler-type: lease
          nodeName: master


          This is the way you can specify --node-name in config.yaml






          share|improve this answer























            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%2f53493734%2fprovide-node-name-to-kubeadm-init-using-config-file%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














            I am able to resolve this issue using the following config file, Just updating if anyone encounters the same issue:



            apiVersion: kubeadm.k8s.io/v1alpha1
            kind: MasterConfiguration
            api:
            advertiseAddress: 10.0.1.149
            controlPlaneEndpoint: 10.0.1.149
            etcd:
            endpoints:
            - http://10.0.1.149:2379
            caFile: /etc/kubernetes/pki/etcd/ca.pem
            certFile: /etc/kubernetes/pki/etcd/client.pem
            keyFile: /etc/kubernetes/pki/etcd/client-key.pem
            networking:
            podSubnet: 192.168.13.0/24
            kubernetesVersion: 1.10.3
            apiServerCertSANs:
            - 10.0.1.149
            apiServerExtraArgs:
            endpoint-reconciler-type: lease
            nodeName: master


            This is the way you can specify --node-name in config.yaml






            share|improve this answer




























              1














              I am able to resolve this issue using the following config file, Just updating if anyone encounters the same issue:



              apiVersion: kubeadm.k8s.io/v1alpha1
              kind: MasterConfiguration
              api:
              advertiseAddress: 10.0.1.149
              controlPlaneEndpoint: 10.0.1.149
              etcd:
              endpoints:
              - http://10.0.1.149:2379
              caFile: /etc/kubernetes/pki/etcd/ca.pem
              certFile: /etc/kubernetes/pki/etcd/client.pem
              keyFile: /etc/kubernetes/pki/etcd/client-key.pem
              networking:
              podSubnet: 192.168.13.0/24
              kubernetesVersion: 1.10.3
              apiServerCertSANs:
              - 10.0.1.149
              apiServerExtraArgs:
              endpoint-reconciler-type: lease
              nodeName: master


              This is the way you can specify --node-name in config.yaml






              share|improve this answer


























                1












                1








                1







                I am able to resolve this issue using the following config file, Just updating if anyone encounters the same issue:



                apiVersion: kubeadm.k8s.io/v1alpha1
                kind: MasterConfiguration
                api:
                advertiseAddress: 10.0.1.149
                controlPlaneEndpoint: 10.0.1.149
                etcd:
                endpoints:
                - http://10.0.1.149:2379
                caFile: /etc/kubernetes/pki/etcd/ca.pem
                certFile: /etc/kubernetes/pki/etcd/client.pem
                keyFile: /etc/kubernetes/pki/etcd/client-key.pem
                networking:
                podSubnet: 192.168.13.0/24
                kubernetesVersion: 1.10.3
                apiServerCertSANs:
                - 10.0.1.149
                apiServerExtraArgs:
                endpoint-reconciler-type: lease
                nodeName: master


                This is the way you can specify --node-name in config.yaml






                share|improve this answer













                I am able to resolve this issue using the following config file, Just updating if anyone encounters the same issue:



                apiVersion: kubeadm.k8s.io/v1alpha1
                kind: MasterConfiguration
                api:
                advertiseAddress: 10.0.1.149
                controlPlaneEndpoint: 10.0.1.149
                etcd:
                endpoints:
                - http://10.0.1.149:2379
                caFile: /etc/kubernetes/pki/etcd/ca.pem
                certFile: /etc/kubernetes/pki/etcd/client.pem
                keyFile: /etc/kubernetes/pki/etcd/client-key.pem
                networking:
                podSubnet: 192.168.13.0/24
                kubernetesVersion: 1.10.3
                apiServerCertSANs:
                - 10.0.1.149
                apiServerExtraArgs:
                endpoint-reconciler-type: lease
                nodeName: master


                This is the way you can specify --node-name in config.yaml







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 27 '18 at 7:31









                Prafull LadhaPrafull Ladha

                3,5981422




                3,5981422
































                    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.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53493734%2fprovide-node-name-to-kubeadm-init-using-config-file%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

                    Lallio

                    Futebolista

                    Jornalista