{"id":2477,"date":"2016-11-07T19:54:03","date_gmt":"2016-11-07T19:54:03","guid":{"rendered":"https:\/\/live-infoblox-blog.pantheonsite.io\/?p=2477"},"modified":"2022-10-19T15:58:33","modified_gmt":"2022-10-19T22:58:33","slug":"coredns-for-kubernetes-service-discovery","status":"publish","type":"post","link":"https:\/\/www.infoblox.com\/blog\/community\/coredns-for-kubernetes-service-discovery\/","title":{"rendered":"CoreDNS for Kubernetes Service Discovery"},"content":{"rendered":"<p>Kubernetes includes a DNS server, Kube-DNS, for use in service discovery. This DNS server utilizes the libraries from SkyDNS to serve DNS requests for Kubernetes pods and services. The author\u00a0of SkyDNS2,\u00a0<a href=\"https:\/\/miek.nl\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Miek Gieben<\/a>, has a new DNS server,\u00a0<a href=\"https:\/\/coredns.io\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">CoreDNS<\/a>, that is built with a more modular, extensible framework. Infoblox has been working with Miek to adapt this DNS server as an alternative to Kube-DNS.<\/p>\n<p>CoreDNS utilizes a server framework developed as part of the web server\u00a0<a href=\"https:\/\/caddyserver.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Caddy<\/a>. That framework has a very flexible, extensible model for passing requests through various middleware components. These middleware components offer different operations on the request &#8211; for example logging, redirecting, modifying or servicing it. Although it started as a web server, Caddy is not bound specifically to the HTTP protocol, and makes an ideal framework on which to base CoreDNS.<\/p>\n<p>Adding support for Kubernetes within this flexible model amounts to creating a Kubernetes\u00a0<a href=\"https:\/\/github.com\/miekg\/coredns\/tree\/master\/middleware\/kubernetes\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">middleware<\/a>. That middleware uses the Kubernetes API to fulfill DNS requests for specific Kubernetes pods or services. And because Kube-DNS runs as just another service in Kubernetes, there is no tight binding between\u00a0<span style=\"font-family: courier new,courier;\">kubelet<\/span>\u00a0and Kube-DNS. You just need to pass the DNS service IP address and domain into\u00a0<span style=\"font-family: courier new,courier;\">kubelet<\/span>, and Kubernetes doesn\u2019t really care who is actually servicing the requests at that IP.<\/p>\n<p>Today, CoreDNS Kubernetes middleware supports serving A records with the cluster IP of the service. In the near future, we will add the following features of Kube-DNS:<\/p>\n<ul>\n<li>Serve pod IPs for A records of services without a cluster IP<\/li>\n<li>Serve SRV records for named ports that are part of a service (with or without a cluster IP)<\/li>\n<li>Serve PTR records (reverse DNS lookups)<\/li>\n<\/ul>\n<p>Additionally, there are a few features unique to the CoreDNS integration:<\/p>\n<ul>\n<li>Flexible record templates<\/li>\n<li>Label-based filtering of responses<\/li>\n<\/ul>\n<p>And of course, you have access to all of the various other middleware in CoreDNS.<\/p>\n<p>To configure CoreDNS to provide Kubernetes service discovery, you have to set up your\u00a0<span style=\"font-family: courier new,courier;\">Corefile<\/span>\u00a0&#8211; that is, your CoreDNS configuration file. Here is an example that runs CoreDNS on port 53 and serves the\u00a0<span style=\"font-family: courier new,courier;\">cluster.local<\/span>\u00a0domain out of Kubernetes.<\/p>\n<pre><span style=\"font-family: courier new,courier;\">.:53 {\r\n       \tlog stdout\r\n       \tkubernetes cluster.local\r\n}<\/span><\/pre>\n<p align=\"center\">Figure 1: Simple\u00a0<span style=\"font-family: courier new,courier;\">Corefile<\/span>\u00a0for Kubernetes Service Discovery<\/p>\n<p>This\u00a0<span style=\"font-family: courier new,courier;\">Corefile<\/span>\u00a0enables two middlewares &#8211; the\u00a0<span style=\"font-family: courier new,courier;\">log<\/span>\u00a0middleware and the\u00a0<span style=\"font-family: courier new,courier;\">kubernetes<\/span>\u00a0middleware. The\u00a0<span style=\"font-family: courier new,courier;\">log<\/span>\u00a0middleware is configured to write logs to\u00a0<span style=\"font-family: courier new,courier;\">STDOUT<\/span>. If you do not include this statement, you won\u2019t see any logging unless there are errors. Any requests for\u00a0<span style=\"font-family: courier new,courier;\">cluster.local<\/span>\u00a0will be fulfilled using the data from the Kubernetes API, which is automatically accessed via a service account. By default, services can be looked up with the same format used by Kube-DNS; for example, if you have a service called\u00a0<span style=\"font-family: courier new,courier;\">nginx<\/span>\u00a0running in the\u00a0<span style=\"font-family: courier new,courier;\">default<\/span>\u00a0namespace, then you would look up its cluster IP with a request for an\u00a0<span style=\"font-family: courier new,courier;\">A<\/span>\u00a0record\u00a0<span style=\"font-family: courier new,courier;\">nginx.default.svc.cluster.local<\/span>.<\/p>\n<p>This basic\u00a0<span style=\"font-family: courier new,courier;\">Corefile<\/span>\u00a0will handle the base requirements, but it is missing a few things we would have in a standard Kube-DNS install:<\/p>\n<ul>\n<li>There is no way to do health checking of the CoreDNS instance.<\/li>\n<li>There is no caching (Kube-DNS handles this through a separate\u00a0<span style=\"font-family: courier new,courier;\">dnsmasq<\/span>\u00a0instance)<\/li>\n<li>Requests for domains other than\u00a0<span style=\"font-family: courier new,courier;\">cluster.local<\/span>\u00a0are not handled.<\/li>\n<\/ul>\n<p>Fortunately, CoreDNS has middleware to enable all of these functions and a lot more. For health checking, we have the\u00a0<span style=\"font-family: courier new,courier;\">health<\/span>\u00a0middleware. This provides an HTTP endpoint on a specified port (8080 by default) that will return \u201cOK\u201d if the instance is healthy. For caching we have the\u00a0<span style=\"font-family: courier new,courier;\">cache<\/span>\u00a0middleware. This allows the caching of both positive (i.e., the query returns a result) and negative (the query returns \u201cno such domain\u201d) responses, with separate cache sizes and TTLs. Finally, for handling other domains we have the\u00a0<span style=\"font-family: courier new,courier;\">proxy<\/span>\u00a0middleware. This can be configured with several upstream nameservers, and also can be used to defer lookups to the nameservers defined in\u00a0<span style=\"font-family: courier new,courier;\">\/etc\/resolv.conf<\/span>. Configuring these, we end with a\u00a0Corefile\u00a0like this:<\/p>\n<pre><span style=\"font-family: courier new,courier;\">.:53 {\r\n       \tlog stdout\r\n           health\r\n       \tkubernetes cluster.local\r\n           proxy . \/etc\/resolv.conf\r\n           cache 30\r\n}<\/span><\/pre>\n<p align=\"center\">Figure 2: Complete\u00a0Corefile\u00a0for Kubernetes Service Discovery<\/p>\n<p>This\u00a0<span style=\"font-family: courier new,courier;\">Corefile<\/span>\u00a0serves Kubernetes services out of\u00a0<span style=\"font-family: courier new,courier;\">cluster.local<\/span>\u00a0and sends all other queries to the nameservers defined in\u00a0<span style=\"font-family: courier new,courier;\">\/etc\/resolv.conf<\/span>, caching all responses for thirty seconds (for Kubernetes and proxied requests).<\/p>\n<p>There are many additional\u00a0<a href=\"https:\/\/github.com\/miekg\/coredns\/tree\/master\/middleware\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">middleware components<\/a>\u00a0available in CoreDNS. These can enable a lot more functionality than can be achieved with Kube-DNS. For example, while CoreDNS does not currently offer dynamic service registration directly, you can achieve a similar result by enabling the\u00a0<span style=\"font-family: courier new,courier;\">etcd<\/span>\u00a0middleware for another domain. We will take a closer look at that in our next post.<\/p>\n<p>So, how do you get CoreDNS up and running as the cluster DNS? The details will vary a bit depending on how you have configured your Kubernetes cluster, but the same two steps apply:<\/p>\n<ul>\n<li>Run CoreDNS as a service in your cluster<\/li>\n<li>Update\u00a0<span style=\"font-family: courier new,courier;\">kubelet<\/span>\u00a0parameters to include the IP of CoreDNS and the cluster domain<\/li>\n<\/ul>\n<p>If you are already running Kube-DNS, then the\u00a0<span style=\"font-family: courier new,courier;\">kubelet<\/span>\u00a0parameters will already define the cluster domain and IP; you simply need to replace your Kube-DNS service with CoreDNS, and use the same cluster IP.<\/p>\n<p>We have a Kubernetes cluster setup using CoreOS as described\u00a0<a href=\"https:\/\/coreos.com\/kubernetes\/docs\/latest\/kubernetes-on-generic-platforms.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">here, on the CoreOS site<\/a>. In this configuration, the specifications for system-level services are kept in\u00a0<span style=\"font-family: courier new,courier;\">\/srv\/kubernetes\/manifests<\/span>. So, to update our\u00a0cluster to run CoreDNS, we replace the existing\u00a0<span style=\"font-family: courier new,courier;\">kube-dns-rc.yaml<\/span>\u00a0and\u00a0<span style=\"font-family: courier new,courier;\">kube-dns-svc.yaml<\/span>\u00a0with the\u00a0<span style=\"font-family: courier new,courier;\">coredns-de.yaml<\/span>\u00a0and\u00a0<span style=\"font-family: courier new,courier;\">coredns-svc.yaml<\/span>\u00a0below. This deployment uses a CoreDNS container image built especially for this blog (<span style=\"font-family: courier new,courier;\">infoblox\/coredns:k8sblog<\/span>), but once CoreDNS v003 is released, the standard CoreDNS image may be used.<\/p>\n<pre><span style=\"font-family: courier new,courier;\">apiVersion: v1\r\nkind: ConfigMap\r\nmetadata:\r\n  name: coredns\r\n  namespace: kube-system\r\ndata:\r\n  Corefile: |\r\n    .:53 {\r\n        log stdout\r\n        health\r\n        kubernetes cluster.local\r\n        proxy . \/etc\/resolv.conf\r\n        cache 30\r\n    }\r\n---\r\napiVersion: extensions\/v1beta1\r\nkind: Deployment\r\nmetadata:\r\n  name: coredns\r\n  namespace: kube-system\r\n  labels:\r\n    k8s-app: coredns\r\n    kubernetes.io\/cluster-service: \"true\"\r\nspec:\r\n  replicas: 1\r\n  selector:\r\n    matchLabels:\r\n      k8s-app: coredns\r\n  template:\r\n    metadata:\r\n      labels:\r\n        k8s-app: coredns\r\n      annotations:\r\n        scheduler.alpha.kubernetes.io\/critical-pod: ''\r\n        scheduler.alpha.kubernetes.io\/tolerations: '[{\"key\":\"CriticalAddonsOnly\", \"operator\":\"Exists\"}]'\r\n    spec:\r\n      containers:\r\n      - name: coredns\r\n        image: infoblox\/coredns:k8sblog\r\n        imagePullPolicy: Always\r\n        args: [ \"-conf\", \"\/etc\/coredns\/Corefile\" ]\r\n        volumeMounts:\r\n        - name: config-volume\r\n          mountPath: \/etc\/coredns\r\n        ports:\r\n        - containerPort: 53\r\n          name: dns\r\n          protocol: UDP\r\n        - containerPort: 53\r\n          name: dns-tcp\r\n          protocol: TCP\r\n        livenessProbe:\r\n          httpGet:\r\n            path: \/health\r\n            port: 8080\r\n            scheme: HTTP\r\n          initialDelaySeconds: 60\r\n          timeoutSeconds: 5\r\n          successThreshold: 1\r\n          failureThreshold: 5\r\n      dnsPolicy: Default\r\n      volumes:\r\n        - name: config-volume\r\n          configMap:\r\n            name: coredns\r\n            items:\r\n            - key: Corefile\r\n              path: Corefile\r\n<\/span><\/pre>\n<p align=\"center\">Figure 3:\u00a0<span style=\"font-family: courier new,courier;\">coredns-de.yaml<\/span><\/p>\n<p>Notice that because we need to configure CoreDNS with a file, we also create a\u00a0<span style=\"font-family: courier new,courier;\">ConfigMap<\/span>\u00a0to house that file. Other than that, this is quite similar to the previous Kube-DNS versions of the files (though we are using a deployment instead of a replication controller).<\/p>\n<pre><span style=\"font-family: courier new,courier;\">apiVersion: v1\r\nkind: Service\r\nmetadata:\r\n  name: coredns\r\n  namespace: kube-system\r\n  labels:\r\n    k8s-app: coredns\r\n    kubernetes.io\/cluster-service: \"true\"\r\n    kubernetes.io\/name: \"CoreDNS\"\r\nspec:\r\n  selector:\r\n    k8s-app: coredns\r\n  clusterIP: 10.3.0.10\r\n  ports:\r\n  - name: dns\r\n    port: 53\r\n    protocol: UDP\r\n  - name: dns-tcp\r\n    port: 53\r\n    protocol: TCP<\/span><\/pre>\n<p align=\"center\">Figure 4:\u00a0<span style=\"font-family: courier new,courier;\">coredns-svc.yaml<\/span><\/p>\n<p>Manifests in\u00a0\/srv\/kubernetes\/manifests\u00a0are not automatically reloaded, so we need to manually delete the Kube-DNS entries and create the CoreDNS entries (this is not the way to do this in production!):<\/p>\n<p><span style=\"font-family: courier new,courier;\"><strong>$ kubectl delete &#8211;namespace=kube-system rc kube-dns-v20<\/strong><\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">replicationcontroller &#8220;kube-dns-v20&#8221; deleted<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\"><strong>$ kubectl delete &#8211;namespace=kube-system svc kube-dns<\/strong><\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">service &#8220;kube-dns&#8221; deleted<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\"><strong>$ kubectl create -f coredns-de.yaml<\/strong><\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">configmap &#8220;coredns&#8221; created<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">deployment &#8220;coredns&#8221; created<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\"><strong>$ kubectl create -f coredns-svc.yaml<\/strong><\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">service &#8220;coredns&#8221; created<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\"><strong>$<\/strong><\/span><\/p>\n<p>Shortly you should see CoreDNS running via kubectl:<\/p>\n<p><span style=\"font-family: courier new,courier;\"><strong>$ kubectl get &#8211;namespace=kube-system deployments<\/strong><\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">NAME \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0DESIRED \u00a0\u00a0CURRENT \u00a0\u00a0UP-TO-DATE \u00a0\u00a0AVAILABLE \u00a0\u00a0AGE<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">coredns \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02m<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">heapster-v1.2.0 \u00a0\u00a01 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a05d<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\"><strong>$ kubectl get &#8211;namespace=kube-system pods<\/strong><\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">NAME \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0READY \u00a0\u00a0\u00a0\u00a0STATUS \u00a0\u00a0\u00a0RESTARTS \u00a0\u00a0AGE<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">coredns-4204825988-ll0xw \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01\/1 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Running \u00a0\u00a00 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02m<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">heapster-v1.2.0-4088228293-a8gkc \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02\/2 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Running \u00a0\u00a00 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a04d<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">kube-apiserver-10.222.243.77 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01\/1 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Running \u00a0\u00a02 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a05d<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">kube-controller-manager-10.222.243.77 \u00a0\u00a01\/1 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Running \u00a0\u00a02 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a05d<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">kube-proxy-10.222.243.76 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01\/1 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Running \u00a0\u00a00 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a04d<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">kube-proxy-10.222.243.77 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01\/1 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Running \u00a0\u00a02 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a05d<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">kube-proxy-10.222.243.78 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01\/1 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Running \u00a0\u00a00 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a04d<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">kube-scheduler-10.222.243.77 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01\/1 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Running \u00a0\u00a02 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a05d<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">kubernetes-dashboard-v1.4.1-7wdrh \u00a0\u00a0\u00a0\u00a0\u00a0\u00a01\/1 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Running \u00a0\u00a01 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a05d<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\"><strong>$ kubectl get &#8211;namespace=kube-system svc<\/strong><\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">NAME \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0CLUSTER-IP \u00a0\u00a0EXTERNAL-IP \u00a0\u00a0PORT(S) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0AGE<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">coredns \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a010.3.0.10 \u00a0\u00a0\u00a0&lt;none&gt; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a053\/UDP,53\/TCP \u00a0\u00a02m<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">heapster \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a010.3.0.95 \u00a0\u00a0\u00a0&lt;none&gt; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a080\/TCP \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a05d<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">kubernetes-dashboard \u00a0\u00a010.3.0.66 \u00a0\u00a0\u00a0&lt;none&gt; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a080\/TCP \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a05d<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\"><strong>$<\/strong><\/span><\/p>\n<p>If you were not already running Kube-DNS, or you used a different\u00a0<span style=\"font-family: courier new,courier;\">ClusterIP<\/span>\u00a0for CoreDNS, then you\u2019ll need to update the\u00a0<span style=\"font-family: courier new,courier;\">kubelet<\/span>\u00a0configuration to set the\u00a0<span style=\"font-family: courier new,courier;\">cluster_dns<\/span>\u00a0and\u00a0<span style=\"font-family: courier new,courier;\">cluster_domain<\/span>\u00a0appropriately. On our cluster, this is done by modifying the\u00a0<span style=\"font-family: courier new,courier;\">\/etc\/systemd\/system\/kubelet.service<\/span>\u00a0file, then restarting the\u00a0<span style=\"font-family: courier new,courier;\">kubelet<\/span>\u00a0service.<\/p>\n<pre><span style=\"font-family: courier new,courier;\">[Service]\r\nEnvironment=KUBELET_VERSION=v1.4.1_coreos.0\r\nEnvironment=KUBELET_ACI=quay.io\/coreos\/hyperkube\r\nEnvironment=\"RKT_OPTS=--volume dns,kind=host,source=\/etc\/resolv.conf   --mount volume=dns,target=\/etc\/resolv.conf   --volume rkt,kind=host,source=\/opt\/bin\/host-rkt   --mount volume=rkt,target=\/usr\/bin\/rkt   --volume var-lib-rkt,kind=host,source=\/var\/lib\/rkt   --mount volume=var-lib-rkt,target=\/var\/lib\/rkt   --volume stage,kind=host,source=\/tmp   --mount volume=stage,target=\/tmp   --volume var-log,kind=host,source=\/var\/log   --mount volume=var-log,target=\/var\/log\"\r\nExecStartPre=\/usr\/bin\/mkdir -p \/etc\/kubernetes\/manifests\r\nExecStartPre=\/usr\/bin\/mkdir -p \/var\/log\/containers\r\nExecStart=\/usr\/lib\/coreos\/kubelet-wrapper   --api-servers=http:\/\/127.0.0.1:8080   --register-schedulable=false   --cni-conf-dir=\/etc\/kubernetes\/cni\/net.d   --network-plugin=cni   --container-runtime=docker   --rkt-path=\/usr\/bin\/rkt   --rkt-stage1-image=coreos.com\/rkt\/stage1-coreos   --allow-privileged=true   --config=\/etc\/kubernetes\/manifests   --hostname-override=10.222.243.77   <span style=\"color: #ff0000;\"><strong>--cluster_dns=10.3.0.10   --cluster_domain=cluster.local<\/strong><\/span>\r\nRestart=always\r\nRestartSec=10<\/span><\/pre>\n<p align=\"center\">Figure 5: Kubelet Configuration<\/p>\n<p>The red sections (you&#8217;ll need to scroll all the way to the right to see those options in Figure 5) are the additions to set the cluster DNS. The same changes should be made on each node.<\/p>\n<p>Once all those are configured, we can test out the CoreDNS by running a pod and doing a lookup. First, let\u2019s start a service,\u00a0<span style=\"font-family: courier new,courier;\">nginx<\/span>\u00a0with the spec shown in Figure 6.<\/p>\n<p>&nbsp;<\/p>\n<pre><span style=\"font-family: courier new,courier;\">apiVersion: v1\r\nkind: Pod\r\nmetadata:\r\n  name: nginx\r\n  labels:\r\n    app: nginx\r\nspec:\r\n  containers:\r\n  - name: nginx\r\n    image: nginx\r\n    ports:\r\n    - containerPort: 80\r\n---\r\napiVersion: v1\r\nkind: Service\r\nmetadata:\r\n  name: nginx\r\nspec:\r\n  ports:\r\n  - port: 80\r\n    targetPort: 80\r\n    protocol: TCP\r\n  selector:\r\n    app: nginx<\/span><\/pre>\n<p align=\"center\">Figure 6: nginx.yaml<\/p>\n<p>Create this service:<\/p>\n<p><span style=\"font-family: courier new,courier;\"><strong>$ kubectl create -f nginx.yaml<\/strong><\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">pod &#8220;nginx&#8221; created<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">service &#8220;nginx&#8221; created<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\"><strong>$ kubectl get services<\/strong><\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">NAME \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0CLUSTER-IP \u00a0\u00a0EXTERNAL-IP \u00a0\u00a0PORT(S) \u00a0\u00a0AGE<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">kubernetes \u00a0\u00a010.3.0.1 \u00a0\u00a0\u00a0\u00a0&lt;none&gt; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0443\/TCP \u00a0\u00a05d<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">nginx \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a010.3.0.201 \u00a0\u00a0&lt;none&gt; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a080\/TCP \u00a0\u00a0\u00a019s<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>Now let\u2019s see if we can access it:<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: courier new,courier;\"><strong>$ kubectl run -i -t &#8211;image=infoblox\/dnstools:k8sblog &#8211;restart=Never dnstest<\/strong><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: courier new,courier;\">Waiting for pod default\/dnstest to be running, status is Pending, pod ready: false<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">If you don&#8217;t see a command prompt, try pressing enter.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: courier new,courier;\"><strong>\/ # curl nginx.default.svc.cluster.local<\/strong><\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">&lt;!DOCTYPE html&gt;<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">&lt;html&gt;<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">&lt;head&gt;<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">&lt;title&gt;Welcome to nginx!&lt;\/title&gt;<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">&lt;style&gt;<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">\u00a0\u00a0\u00a0body {<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0width: 35em;<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0margin: 0 auto;<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0font-family: Tahoma, Verdana, Arial, sans-serif;<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">\u00a0\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">&lt;\/style&gt;<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">&lt;\/head&gt;<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">&lt;body&gt;<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">&lt;h1&gt;Welcome to nginx!&lt;\/h1&gt;<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">&lt;p&gt;If you see this page, the nginx web server is successfully installed and<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">working. Further configuration is required.&lt;\/p&gt;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: courier new,courier;\">&lt;p&gt;For online documentation and support please refer to<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">&lt;a href=&#8221;<a href=\"http:\/\/nginx.org\/%22%3Enginx.org%3C\/a%3E.%3Cbr\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">http:\/\/nginx.org\/&#8221;&gt;nginx.org&lt;\/a&gt;.&lt;br\/<\/a>&gt;<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">Commercial support is available at<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">&lt;a href=&#8221;<a href=\"http:\/\/nginx.com\/%22%3Enginx.com%3C\/a%3E.%3C\/p\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">http:\/\/nginx.com\/&#8221;&gt;nginx.com&lt;\/a&gt;.&lt;\/p<\/a>&gt;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: courier new,courier;\">&lt;p&gt;&lt;em&gt;Thank you for using nginx.&lt;\/em&gt;&lt;\/p&gt;<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">&lt;\/body&gt;<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\">&lt;\/html&gt;<\/span><\/p>\n<p><span style=\"font-family: courier new,courier;\"><strong>\/ #<\/strong><\/span><\/p>\n<p>So, there we have it! CoreDNS is now providing the service discovery function for this Kubernetes cluster.<\/p>\n<p>In our next post, we\u2019ll show how to enable additional features in CoreDNS so that you can also use it to access arbitrary DNS entries that can be dynamically created.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Kubernetes includes a DNS server, Kube-DNS, for use in service discovery. This DNS server utilizes the libraries from SkyDNS to serve DNS requests for Kubernetes pods and services. The author\u00a0of SkyDNS2,\u00a0Miek Gieben, has a new DNS server,\u00a0CoreDNS, that is built with a more modular, extensible framework. Infoblox has been working with Miek to adapt this [&hellip;]<\/p>\n","protected":false},"author":206,"featured_media":2482,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[3],"tags":[118],"class_list":{"0":"post-2477","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-community","8":"tag-docker","9":"entry"},"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>CoreDNS for Kubernetes Service Discovery<\/title>\n<meta name=\"description\" content=\"CoreDNS can be used to provide the service discovery function to Kubernetes clusters. Learn more about the other service features can be created with this.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.infoblox.com\/blog\/community\/coredns-for-kubernetes-service-discovery\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CoreDNS for Kubernetes Service Discovery\" \/>\n<meta property=\"og:description\" content=\"CoreDNS can be used to provide the service discovery function to Kubernetes clusters. Learn more about the other service features can be created with this.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.infoblox.com\/blog\/community\/coredns-for-kubernetes-service-discovery\/\" \/>\n<meta property=\"og:site_name\" content=\"Infoblox Blog\" \/>\n<meta property=\"article:published_time\" content=\"2016-11-07T19:54:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-10-19T22:58:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.infoblox.com\/blog\/wp-content\/uploads\/iotblogmonday-1-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"660\" \/>\n\t<meta property=\"og:image:height\" content=\"454\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"John Belamaric\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"John Belamaric\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/coredns-for-kubernetes-service-discovery\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/coredns-for-kubernetes-service-discovery\\\/\"},\"author\":{\"name\":\"John Belamaric\",\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/#\\\/schema\\\/person\\\/053c2b18a442a1874857175dc9a15b97\"},\"headline\":\"CoreDNS for Kubernetes Service Discovery\",\"datePublished\":\"2016-11-07T19:54:03+00:00\",\"dateModified\":\"2022-10-19T22:58:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/coredns-for-kubernetes-service-discovery\\\/\"},\"wordCount\":1556,\"publisher\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/coredns-for-kubernetes-service-discovery\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/wp-content\\\/uploads\\\/iotblogmonday-1-1.jpg\",\"keywords\":[\"Docker\"],\"articleSection\":[\"Community\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/coredns-for-kubernetes-service-discovery\\\/\",\"url\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/coredns-for-kubernetes-service-discovery\\\/\",\"name\":\"CoreDNS for Kubernetes Service Discovery\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/coredns-for-kubernetes-service-discovery\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/coredns-for-kubernetes-service-discovery\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/wp-content\\\/uploads\\\/iotblogmonday-1-1.jpg\",\"datePublished\":\"2016-11-07T19:54:03+00:00\",\"dateModified\":\"2022-10-19T22:58:33+00:00\",\"description\":\"CoreDNS can be used to provide the service discovery function to Kubernetes clusters. Learn more about the other service features can be created with this.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/coredns-for-kubernetes-service-discovery\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/coredns-for-kubernetes-service-discovery\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/coredns-for-kubernetes-service-discovery\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/wp-content\\\/uploads\\\/iotblogmonday-1-1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/wp-content\\\/uploads\\\/iotblogmonday-1-1.jpg\",\"width\":660,\"height\":454,\"caption\":\"CoreDNS for Kubernetes Service Discovery\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/coredns-for-kubernetes-service-discovery\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Community\",\"item\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/category\\\/community\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"CoreDNS for Kubernetes Service Discovery\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/\",\"name\":\"infoblox.com\\\/blog\\\/\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/#organization\",\"name\":\"Infoblox\",\"url\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/wp-content\\\/uploads\\\/infoblox-logo-2.svg\",\"contentUrl\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/wp-content\\\/uploads\\\/infoblox-logo-2.svg\",\"width\":137,\"height\":30,\"caption\":\"Infoblox\"},\"image\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/#\\\/schema\\\/person\\\/053c2b18a442a1874857175dc9a15b97\",\"name\":\"John Belamaric\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7ab6c9e6e797ea8913b402cc81b586865538d4c2af6d47c87d3dbd804c02e886?s=96&d=blank&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7ab6c9e6e797ea8913b402cc81b586865538d4c2af6d47c87d3dbd804c02e886?s=96&d=blank&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7ab6c9e6e797ea8913b402cc81b586865538d4c2af6d47c87d3dbd804c02e886?s=96&d=blank&r=g\",\"caption\":\"John Belamaric\"},\"url\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/author\\\/john-belamaric\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"CoreDNS for Kubernetes Service Discovery","description":"CoreDNS can be used to provide the service discovery function to Kubernetes clusters. Learn more about the other service features can be created with this.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.infoblox.com\/blog\/community\/coredns-for-kubernetes-service-discovery\/","og_locale":"en_US","og_type":"article","og_title":"CoreDNS for Kubernetes Service Discovery","og_description":"CoreDNS can be used to provide the service discovery function to Kubernetes clusters. Learn more about the other service features can be created with this.","og_url":"https:\/\/www.infoblox.com\/blog\/community\/coredns-for-kubernetes-service-discovery\/","og_site_name":"Infoblox Blog","article_published_time":"2016-11-07T19:54:03+00:00","article_modified_time":"2022-10-19T22:58:33+00:00","og_image":[{"width":660,"height":454,"url":"https:\/\/www.infoblox.com\/blog\/wp-content\/uploads\/iotblogmonday-1-1.jpg","type":"image\/jpeg"}],"author":"John Belamaric","twitter_card":"summary_large_image","twitter_misc":{"Written by":"John Belamaric","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.infoblox.com\/blog\/community\/coredns-for-kubernetes-service-discovery\/#article","isPartOf":{"@id":"https:\/\/www.infoblox.com\/blog\/community\/coredns-for-kubernetes-service-discovery\/"},"author":{"name":"John Belamaric","@id":"https:\/\/www.infoblox.com\/blog\/#\/schema\/person\/053c2b18a442a1874857175dc9a15b97"},"headline":"CoreDNS for Kubernetes Service Discovery","datePublished":"2016-11-07T19:54:03+00:00","dateModified":"2022-10-19T22:58:33+00:00","mainEntityOfPage":{"@id":"https:\/\/www.infoblox.com\/blog\/community\/coredns-for-kubernetes-service-discovery\/"},"wordCount":1556,"publisher":{"@id":"https:\/\/www.infoblox.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.infoblox.com\/blog\/community\/coredns-for-kubernetes-service-discovery\/#primaryimage"},"thumbnailUrl":"https:\/\/www.infoblox.com\/blog\/wp-content\/uploads\/iotblogmonday-1-1.jpg","keywords":["Docker"],"articleSection":["Community"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.infoblox.com\/blog\/community\/coredns-for-kubernetes-service-discovery\/","url":"https:\/\/www.infoblox.com\/blog\/community\/coredns-for-kubernetes-service-discovery\/","name":"CoreDNS for Kubernetes Service Discovery","isPartOf":{"@id":"https:\/\/www.infoblox.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.infoblox.com\/blog\/community\/coredns-for-kubernetes-service-discovery\/#primaryimage"},"image":{"@id":"https:\/\/www.infoblox.com\/blog\/community\/coredns-for-kubernetes-service-discovery\/#primaryimage"},"thumbnailUrl":"https:\/\/www.infoblox.com\/blog\/wp-content\/uploads\/iotblogmonday-1-1.jpg","datePublished":"2016-11-07T19:54:03+00:00","dateModified":"2022-10-19T22:58:33+00:00","description":"CoreDNS can be used to provide the service discovery function to Kubernetes clusters. Learn more about the other service features can be created with this.","breadcrumb":{"@id":"https:\/\/www.infoblox.com\/blog\/community\/coredns-for-kubernetes-service-discovery\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.infoblox.com\/blog\/community\/coredns-for-kubernetes-service-discovery\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.infoblox.com\/blog\/community\/coredns-for-kubernetes-service-discovery\/#primaryimage","url":"https:\/\/www.infoblox.com\/blog\/wp-content\/uploads\/iotblogmonday-1-1.jpg","contentUrl":"https:\/\/www.infoblox.com\/blog\/wp-content\/uploads\/iotblogmonday-1-1.jpg","width":660,"height":454,"caption":"CoreDNS for Kubernetes Service Discovery"},{"@type":"BreadcrumbList","@id":"https:\/\/www.infoblox.com\/blog\/community\/coredns-for-kubernetes-service-discovery\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.infoblox.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Community","item":"https:\/\/www.infoblox.com\/blog\/category\/community\/"},{"@type":"ListItem","position":3,"name":"CoreDNS for Kubernetes Service Discovery"}]},{"@type":"WebSite","@id":"https:\/\/www.infoblox.com\/blog\/#website","url":"https:\/\/www.infoblox.com\/blog\/","name":"infoblox.com\/blog\/","description":"","publisher":{"@id":"https:\/\/www.infoblox.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.infoblox.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.infoblox.com\/blog\/#organization","name":"Infoblox","url":"https:\/\/www.infoblox.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.infoblox.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.infoblox.com\/blog\/wp-content\/uploads\/infoblox-logo-2.svg","contentUrl":"https:\/\/www.infoblox.com\/blog\/wp-content\/uploads\/infoblox-logo-2.svg","width":137,"height":30,"caption":"Infoblox"},"image":{"@id":"https:\/\/www.infoblox.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.infoblox.com\/blog\/#\/schema\/person\/053c2b18a442a1874857175dc9a15b97","name":"John Belamaric","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/7ab6c9e6e797ea8913b402cc81b586865538d4c2af6d47c87d3dbd804c02e886?s=96&d=blank&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/7ab6c9e6e797ea8913b402cc81b586865538d4c2af6d47c87d3dbd804c02e886?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7ab6c9e6e797ea8913b402cc81b586865538d4c2af6d47c87d3dbd804c02e886?s=96&d=blank&r=g","caption":"John Belamaric"},"url":"https:\/\/www.infoblox.com\/blog\/author\/john-belamaric\/"}]}},"_links":{"self":[{"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/posts\/2477","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/users\/206"}],"replies":[{"embeddable":true,"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/comments?post=2477"}],"version-history":[{"count":2,"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/posts\/2477\/revisions"}],"predecessor-version":[{"id":8087,"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/posts\/2477\/revisions\/8087"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/media\/2482"}],"wp:attachment":[{"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/media?parent=2477"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/categories?post=2477"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/tags?post=2477"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}