coredns

by douban

Helm chartv1.39.2App 1.12.0Verified publisher

CoreDNS is a DNS server that chains plugins and provides Kubernetes DNS Services

About this chart

CoreDNS

CoreDNS is a DNS server that chains plugins and provides DNS Services

TL;DR;

$ helm repo add coredns https://coredns.github.io/helm
$ helm --namespace=kube-system install coredns coredns/coredns

Introduction

This chart bootstraps a CoreDNS deployment on a Kubernetes cluster using the Helm package manager. This chart will provide DNS Services and can be deployed in multiple configuration to support various scenarios listed below:

  • CoreDNS as a cluster dns service and a drop-in replacement for Kube/SkyDNS. This is the default mode and CoreDNS is deployed as cluster-service in kube-system namespace. This mode is chosen by setting isClusterService to true.
  • CoreDNS as an external dns service. In this mode CoreDNS is deployed as any kubernetes app in user specified namespace. The CoreDNS service can be exposed outside the cluster by using using either the NodePort or LoadBalancer type of service. This mode is chosen by setting isClusterService to false.
  • CoreDNS as an external dns provider for kubernetes federation. This is a sub case of 'external dns service' which uses etcd plugin for CoreDNS backend. This deployment mode as a dependency on etcd-operator chart, which needs to be pre-installed.

Prerequisites

  • Kubernetes 1.10 or later

Installing the Chart

The chart can be installed as follows:

$ helm repo add coredns https://coredns.github.io/helm
$ helm --namespace=kube-system install coredns coredns/coredns

The command deploys CoreDNS on the Kubernetes cluster in the default configuration. The configuration section lists various ways to override default configuration during deployment.

Tip: List all releases using helm list --all-namespaces

OCI installing

The chart can also be installed using the following:

$ helm --namespace=kube-system install coredns oci://ghcr.io/coredns/charts/coredns --version 1.38.0

The command deploys the 1.38.0 version of CoreDNS on the Kubernetes cluster in the default configuration.

Uninstalling the Chart

To uninstall/delete the coredns deployment:

$ helm uninstall coredns

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

ParameterDescriptionDefault
image.repositoryThe image repository to pull fromcoredns/coredns
image.tagThe image tag to pull from (derived from Chart.yaml)``
image.pullPolicyImage pull policyIfNotPresent
image.pullSecretsSpecify container image pull secrets[]
replicaCountNumber of replicas1
resources.limits.cpuContainer maximum CPU100m
resources.limits.memoryContainer maximum memory128Mi
resources.requests.cpuContainer requested CPU100m
resources.requests.memoryContainer requested memory128Mi
serviceTypeKubernetes Service typeClusterIP
prometheus.service.enabledSet this to true to create Service for Prometheus metricsfalse
prometheus.service.annotationsAnnotations to add to the metrics Service{prometheus.io/scrape: "true", prometheus.io/port: "9153"}
prometheus.service.selectorPod selector{}
prometheus.monitor.enabledSet this to true to create ServiceMonitor for Prometheus operatorfalse
prometheus.monitor.additionalLabelsAdditional labels that can be used so ServiceMonitor will be discovered by Prometheus{}
prometheus.monitor.namespaceSelector to select which namespaces the Endpoints objects are discovered from.""
prometheus.monitor.intervalScrape interval for polling the metrics endpoint. (E.g. "30s")""
prometheus.monitor.selectorService selector{}
service.clusterIPIP address to assign to service""
service.clusterIPsIP addresses to assign to service[]
service.loadBalancerIPIP address to assign to load balancer (if supported)""
service.externalIPsExternal IP addresses[]
service.externalTrafficPolicyEnable client source IP preservation[]
service.ipFamilyPolicyService dual-stack policy""
service.annotationsAnnotations to add to service{}
service.selectorPod selector{}
service.trafficDistributionService traffic routing strategy
serviceAccount.createIf true, create & use serviceAccountfalse
serviceAccount.nameIf not set & create is true, use template fullname
rbac.createIf true, create & use RBAC resourcestrue
rbac.pspEnableSpecifies whether a PodSecurityPolicy should be created.false
isClusterServiceSpecifies whether chart should be deployed as cluster-service or normal k8s app.true
priorityClassNameName of Priority Class to assign pods""
securityContextsecurityContext definition for podscapabilities.add.NET_BIND_SERVICE
serversConfiguration for CoreDNS and pluginsSee values.yml
livenessProbe.enabledEnable/disable the Liveness probetrue
livenessProbe.initialDelaySecondsDelay before liveness probe is initiated60
livenessProbe.periodSecondsHow often to perform the probe10
livenessProbe.timeoutSecondsWhen the probe times out5
livenessProbe.failureThresholdMinimum consecutive failures for the probe to be considered failed after having succeeded.5
livenessProbe.successThresholdMinimum consecutive successes for the probe to be considered successful after having failed.1
readinessProbe.enabledEnable/disable the Readiness probetrue
readinessProbe.initialDelaySecondsDelay before readiness probe is initiated30
readinessProbe.periodSecondsHow often to perform the probe

Deploy coredns with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has coredns on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartcoredns is pinned at v1.39.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply