Kubernetes: no such host for modify hostname slave



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















Version: kubeadm and kubectl 1.12



I get this error when I change the hostname of one of the Kubernetes slaves.



The error I get from the metric service:



dial tcp: lookup ops-kube-slave-dev-1 on 10.96.0.10:53: no such host


This IP is not the public or private IP and is completely random.



I add this to the file /etc/hosts:



10.0.1.248 ops-kube-slave-dev-2
10.0.1.154 ops-kube-slave-dev-1


When I execute $ nslookup ops-kube-slave-dev-2, I get the correct IP.



But still the same error. I want to avoid that for every new node I add to create a new certificate again.



What is the best solution for auto join slave node?










share|improve this question
























  • Why you edit and you put the command line with $ , I want to just copy all the line and just run :S

    – cdemet
    Nov 16 '18 at 7:52

















0















Version: kubeadm and kubectl 1.12



I get this error when I change the hostname of one of the Kubernetes slaves.



The error I get from the metric service:



dial tcp: lookup ops-kube-slave-dev-1 on 10.96.0.10:53: no such host


This IP is not the public or private IP and is completely random.



I add this to the file /etc/hosts:



10.0.1.248 ops-kube-slave-dev-2
10.0.1.154 ops-kube-slave-dev-1


When I execute $ nslookup ops-kube-slave-dev-2, I get the correct IP.



But still the same error. I want to avoid that for every new node I add to create a new certificate again.



What is the best solution for auto join slave node?










share|improve this question
























  • Why you edit and you put the command line with $ , I want to just copy all the line and just run :S

    – cdemet
    Nov 16 '18 at 7:52













0












0








0








Version: kubeadm and kubectl 1.12



I get this error when I change the hostname of one of the Kubernetes slaves.



The error I get from the metric service:



dial tcp: lookup ops-kube-slave-dev-1 on 10.96.0.10:53: no such host


This IP is not the public or private IP and is completely random.



I add this to the file /etc/hosts:



10.0.1.248 ops-kube-slave-dev-2
10.0.1.154 ops-kube-slave-dev-1


When I execute $ nslookup ops-kube-slave-dev-2, I get the correct IP.



But still the same error. I want to avoid that for every new node I add to create a new certificate again.



What is the best solution for auto join slave node?










share|improve this question
















Version: kubeadm and kubectl 1.12



I get this error when I change the hostname of one of the Kubernetes slaves.



The error I get from the metric service:



dial tcp: lookup ops-kube-slave-dev-1 on 10.96.0.10:53: no such host


This IP is not the public or private IP and is completely random.



I add this to the file /etc/hosts:



10.0.1.248 ops-kube-slave-dev-2
10.0.1.154 ops-kube-slave-dev-1


When I execute $ nslookup ops-kube-slave-dev-2, I get the correct IP.



But still the same error. I want to avoid that for every new node I add to create a new certificate again.



What is the best solution for auto join slave node?







kubernetes kube-dns






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 15 '18 at 22:18









Rico

29.8k105472




29.8k105472










asked Nov 15 '18 at 15:06









cdemetcdemet

6619




6619












  • Why you edit and you put the command line with $ , I want to just copy all the line and just run :S

    – cdemet
    Nov 16 '18 at 7:52

















  • Why you edit and you put the command line with $ , I want to just copy all the line and just run :S

    – cdemet
    Nov 16 '18 at 7:52
















Why you edit and you put the command line with $ , I want to just copy all the line and just run :S

– cdemet
Nov 16 '18 at 7:52





Why you edit and you put the command line with $ , I want to just copy all the line and just run :S

– cdemet
Nov 16 '18 at 7:52












1 Answer
1






active

oldest

votes


















1














The solution is to provide --hostname-override option to the kubelet configuration (in my case, /etc/systemd/system/kubelet.service.d/10-kubeadm.conf). Let you allow to change the kubernetes nodename without regenerating the certificates.



For more info, see https://prefetch.net/blog/2017/12/30/getting-your-kubernetes-node-names-right/.



PS: On the secondary note,The IP you're talking about is not random, that is the IP of kubedns service of your cluster. You can check it using $ kubectl get svc -n kube-system.



Hope this helps.






share|improve this answer

























  • Thanks i will tried it, /usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS --hostname-override I change the last line of the config file and i add the --hostname-override but the service don't start

    – cdemet
    Nov 15 '18 at 16:10











  • You need to provide the new hostname of your worker node to it, like --hostname-override=<hostname> . I hope you are doing it on the worker node which name you want to change

    – Prafull Ladha
    Nov 15 '18 at 16:49











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%2f53322353%2fkubernetes-no-such-host-for-modify-hostname-slave%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














The solution is to provide --hostname-override option to the kubelet configuration (in my case, /etc/systemd/system/kubelet.service.d/10-kubeadm.conf). Let you allow to change the kubernetes nodename without regenerating the certificates.



For more info, see https://prefetch.net/blog/2017/12/30/getting-your-kubernetes-node-names-right/.



PS: On the secondary note,The IP you're talking about is not random, that is the IP of kubedns service of your cluster. You can check it using $ kubectl get svc -n kube-system.



Hope this helps.






share|improve this answer

























  • Thanks i will tried it, /usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS --hostname-override I change the last line of the config file and i add the --hostname-override but the service don't start

    – cdemet
    Nov 15 '18 at 16:10











  • You need to provide the new hostname of your worker node to it, like --hostname-override=<hostname> . I hope you are doing it on the worker node which name you want to change

    – Prafull Ladha
    Nov 15 '18 at 16:49















1














The solution is to provide --hostname-override option to the kubelet configuration (in my case, /etc/systemd/system/kubelet.service.d/10-kubeadm.conf). Let you allow to change the kubernetes nodename without regenerating the certificates.



For more info, see https://prefetch.net/blog/2017/12/30/getting-your-kubernetes-node-names-right/.



PS: On the secondary note,The IP you're talking about is not random, that is the IP of kubedns service of your cluster. You can check it using $ kubectl get svc -n kube-system.



Hope this helps.






share|improve this answer

























  • Thanks i will tried it, /usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS --hostname-override I change the last line of the config file and i add the --hostname-override but the service don't start

    – cdemet
    Nov 15 '18 at 16:10











  • You need to provide the new hostname of your worker node to it, like --hostname-override=<hostname> . I hope you are doing it on the worker node which name you want to change

    – Prafull Ladha
    Nov 15 '18 at 16:49













1












1








1







The solution is to provide --hostname-override option to the kubelet configuration (in my case, /etc/systemd/system/kubelet.service.d/10-kubeadm.conf). Let you allow to change the kubernetes nodename without regenerating the certificates.



For more info, see https://prefetch.net/blog/2017/12/30/getting-your-kubernetes-node-names-right/.



PS: On the secondary note,The IP you're talking about is not random, that is the IP of kubedns service of your cluster. You can check it using $ kubectl get svc -n kube-system.



Hope this helps.






share|improve this answer















The solution is to provide --hostname-override option to the kubelet configuration (in my case, /etc/systemd/system/kubelet.service.d/10-kubeadm.conf). Let you allow to change the kubernetes nodename without regenerating the certificates.



For more info, see https://prefetch.net/blog/2017/12/30/getting-your-kubernetes-node-names-right/.



PS: On the secondary note,The IP you're talking about is not random, that is the IP of kubedns service of your cluster. You can check it using $ kubectl get svc -n kube-system.



Hope this helps.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 15 '18 at 18:04









Shudipta Sharma

1,242414




1,242414










answered Nov 15 '18 at 15:33









Prafull LadhaPrafull Ladha

3,9911623




3,9911623












  • Thanks i will tried it, /usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS --hostname-override I change the last line of the config file and i add the --hostname-override but the service don't start

    – cdemet
    Nov 15 '18 at 16:10











  • You need to provide the new hostname of your worker node to it, like --hostname-override=<hostname> . I hope you are doing it on the worker node which name you want to change

    – Prafull Ladha
    Nov 15 '18 at 16:49

















  • Thanks i will tried it, /usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS --hostname-override I change the last line of the config file and i add the --hostname-override but the service don't start

    – cdemet
    Nov 15 '18 at 16:10











  • You need to provide the new hostname of your worker node to it, like --hostname-override=<hostname> . I hope you are doing it on the worker node which name you want to change

    – Prafull Ladha
    Nov 15 '18 at 16:49
















Thanks i will tried it, /usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS --hostname-override I change the last line of the config file and i add the --hostname-override but the service don't start

– cdemet
Nov 15 '18 at 16:10





Thanks i will tried it, /usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS --hostname-override I change the last line of the config file and i add the --hostname-override but the service don't start

– cdemet
Nov 15 '18 at 16:10













You need to provide the new hostname of your worker node to it, like --hostname-override=<hostname> . I hope you are doing it on the worker node which name you want to change

– Prafull Ladha
Nov 15 '18 at 16:49





You need to provide the new hostname of your worker node to it, like --hostname-override=<hostname> . I hope you are doing it on the worker node which name you want to change

– Prafull Ladha
Nov 15 '18 at 16:49



















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%2f53322353%2fkubernetes-no-such-host-for-modify-hostname-slave%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

How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

Syphilis

Darth Vader #20