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;
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?


add a comment |
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?


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
add a comment |
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?


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?




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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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.
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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