How do I force Kubernetes CoreDNS to reload its Config Map after a change?
I'm running Kubernetes 1.11, and trying to configure the Kubernetes cluster to check a local name server first. I read the instructions on the Kubernetes site for customizing CoreDNS, and used the Dashboard to edit the system ConfigMap for CoreDNS. The resulting corefile value is:
.:53 {
errors
health
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
upstream 192.168.1.3 209.18.47.61
fallthrough in-addr.arpa ip6.arpa
}
prometheus :9153
proxy . /etc/resolv.conf
cache 30
reload
}
You can see the local address as the first upstream name server. My problem is that this doesn't seem to have made any impact. I have a container running with ping & nslookup, and neither will resolve names from the local name server.
I've worked around the problem for the moment by specifying the name server configuration in a few pod specifications that need it, but I don't like the workaround.
How do I force CoreDNS to update based on the changed ConfigMap? I can see that it is a Deployment in kube-system namespace, but I haven't found any docs on how to get it to reload or otherwise respond to a changed configuration.
kubernetes coredns
add a comment |
I'm running Kubernetes 1.11, and trying to configure the Kubernetes cluster to check a local name server first. I read the instructions on the Kubernetes site for customizing CoreDNS, and used the Dashboard to edit the system ConfigMap for CoreDNS. The resulting corefile value is:
.:53 {
errors
health
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
upstream 192.168.1.3 209.18.47.61
fallthrough in-addr.arpa ip6.arpa
}
prometheus :9153
proxy . /etc/resolv.conf
cache 30
reload
}
You can see the local address as the first upstream name server. My problem is that this doesn't seem to have made any impact. I have a container running with ping & nslookup, and neither will resolve names from the local name server.
I've worked around the problem for the moment by specifying the name server configuration in a few pod specifications that need it, but I don't like the workaround.
How do I force CoreDNS to update based on the changed ConfigMap? I can see that it is a Deployment in kube-system namespace, but I haven't found any docs on how to get it to reload or otherwise respond to a changed configuration.
kubernetes coredns
You can just delete coredns pod. then, it will be created automatically with new configuration.
– Emruz Hossain
Nov 27 '18 at 12:03
add a comment |
I'm running Kubernetes 1.11, and trying to configure the Kubernetes cluster to check a local name server first. I read the instructions on the Kubernetes site for customizing CoreDNS, and used the Dashboard to edit the system ConfigMap for CoreDNS. The resulting corefile value is:
.:53 {
errors
health
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
upstream 192.168.1.3 209.18.47.61
fallthrough in-addr.arpa ip6.arpa
}
prometheus :9153
proxy . /etc/resolv.conf
cache 30
reload
}
You can see the local address as the first upstream name server. My problem is that this doesn't seem to have made any impact. I have a container running with ping & nslookup, and neither will resolve names from the local name server.
I've worked around the problem for the moment by specifying the name server configuration in a few pod specifications that need it, but I don't like the workaround.
How do I force CoreDNS to update based on the changed ConfigMap? I can see that it is a Deployment in kube-system namespace, but I haven't found any docs on how to get it to reload or otherwise respond to a changed configuration.
kubernetes coredns
I'm running Kubernetes 1.11, and trying to configure the Kubernetes cluster to check a local name server first. I read the instructions on the Kubernetes site for customizing CoreDNS, and used the Dashboard to edit the system ConfigMap for CoreDNS. The resulting corefile value is:
.:53 {
errors
health
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
upstream 192.168.1.3 209.18.47.61
fallthrough in-addr.arpa ip6.arpa
}
prometheus :9153
proxy . /etc/resolv.conf
cache 30
reload
}
You can see the local address as the first upstream name server. My problem is that this doesn't seem to have made any impact. I have a container running with ping & nslookup, and neither will resolve names from the local name server.
I've worked around the problem for the moment by specifying the name server configuration in a few pod specifications that need it, but I don't like the workaround.
How do I force CoreDNS to update based on the changed ConfigMap? I can see that it is a Deployment in kube-system namespace, but I haven't found any docs on how to get it to reload or otherwise respond to a changed configuration.
kubernetes coredns
kubernetes coredns
asked Nov 27 '18 at 11:14
E. WittleE. Wittle
395
395
You can just delete coredns pod. then, it will be created automatically with new configuration.
– Emruz Hossain
Nov 27 '18 at 12:03
add a comment |
You can just delete coredns pod. then, it will be created automatically with new configuration.
– Emruz Hossain
Nov 27 '18 at 12:03
You can just delete coredns pod. then, it will be created automatically with new configuration.
– Emruz Hossain
Nov 27 '18 at 12:03
You can just delete coredns pod. then, it will be created automatically with new configuration.
– Emruz Hossain
Nov 27 '18 at 12:03
add a comment |
1 Answer
1
active
oldest
votes
You can edit it in command line:
kubectl edit cm coredns -n kube-system
Save it and exit, which should reload it.
If it will not reload, as Emruz Hossain advised delete coredns:
kubectl get pods -n kube-system -oname |grep coredns |xargs kubectl delete -n kube-system
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%2f53498438%2fhow-do-i-force-kubernetes-coredns-to-reload-its-config-map-after-a-change%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
You can edit it in command line:
kubectl edit cm coredns -n kube-system
Save it and exit, which should reload it.
If it will not reload, as Emruz Hossain advised delete coredns:
kubectl get pods -n kube-system -oname |grep coredns |xargs kubectl delete -n kube-system
add a comment |
You can edit it in command line:
kubectl edit cm coredns -n kube-system
Save it and exit, which should reload it.
If it will not reload, as Emruz Hossain advised delete coredns:
kubectl get pods -n kube-system -oname |grep coredns |xargs kubectl delete -n kube-system
add a comment |
You can edit it in command line:
kubectl edit cm coredns -n kube-system
Save it and exit, which should reload it.
If it will not reload, as Emruz Hossain advised delete coredns:
kubectl get pods -n kube-system -oname |grep coredns |xargs kubectl delete -n kube-system
You can edit it in command line:
kubectl edit cm coredns -n kube-system
Save it and exit, which should reload it.
If it will not reload, as Emruz Hossain advised delete coredns:
kubectl get pods -n kube-system -oname |grep coredns |xargs kubectl delete -n kube-system
answered Nov 27 '18 at 15:05
CrouCrou
768610
768610
add a comment |
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%2f53498438%2fhow-do-i-force-kubernetes-coredns-to-reload-its-config-map-after-a-change%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
You can just delete coredns pod. then, it will be created automatically with new configuration.
– Emruz Hossain
Nov 27 '18 at 12:03