CoreDNS
Separate CoreDNS​
Each vCluster has its own DNS service (CoreDNS by default) so that pods and services can locate each other by hostnames. The vCluster syncer ensures that the intuitive naming logic of Kubernetes DNS names for services applies. Users can connect to these DNS names, which map to the IP address of the synchronized services that are present in the host cluster. However, this also means that you can't directly access host services from inside the virtual cluster via DNS. Host cluster pods can only access virtual cluster services by their synced name.
Customize the CoreDNS deployment if you need to pull the CoreDNS image from a private registry.
See DNS for Services and Pods for details on Kubernetes DNS.
A normal vCluster deployment consists of two pods per vCluster instance:
- vCluster Pod
- API server container
- Syncer container
- CoreDNS Pod
Integrated CoreDNS​
(Pro) The integrated CoreDNS feature lets you run CoreDNS as part of the syncer, which saves the overhead of an external CoreDNS pod.
- vCluster Pod
- API server container
- Syncer and CoreDNS container
Key benefits to this approach include:
- Avoiding cluster max pods limit
- Optimizing resource allocation
Config reference​
Deprecated Field | New Field |
---|---|
coredns.config | coredns.overwriteConfig |
coredns.manifests | coredns.overwriteManifests |
coredns
required object pro​
CoreDNS defines everything related to the coredns that is deployed and used within the vCluster.
coredns
required object pro​enabled
required boolean true pro​
Enabled defines if coredns is enabled
enabled
required boolean true pro​embedded
required boolean false pro​
Embedded defines if vCluster will start the embedded coredns service within the control-plane and not as a separate deployment. This is a PRO feature.
embedded
required boolean false pro​service
required object pro​
Service holds extra options for the coredns service deployed within the virtual cluster
service
required object pro​deployment
required object pro​
Deployment holds extra options for the coredns deployment deployed within the virtual cluster
deployment
required object pro​image
required string pro​
Image is the coredns image to use
image
required string pro​replicas
required integer 1 pro​
Replicas is the amount of coredns pods to run.
replicas
required integer 1 pro​nodeSelector
required object {} pro​
NodeSelector is the node selector to use for coredns.
nodeSelector
required object {} pro​resources
required object pro​
Resources are the desired resources for coredns.
resources
required object pro​pods
required object pro​
Pods is additional metadata for the coredns pods.
pods
required object pro​annotations
required object {} pro​
Annotations are extra annotations for this resource.
annotations
required object {} pro​labels
required object {} pro​
Labels are extra labels for this resource.
labels
required object {} pro​topologySpreadConstraints
required object[] [map[labelSelector:map[matchLabels:map[k8s-app:kube-dns]] maxSkew:1 topologyKey:kubernetes.io/hostname whenUnsatisfiable:DoNotSchedule]] pro​
TopologySpreadConstraints are the topology spread constraints for the CoreDNS pod.
topologySpreadConstraints
required object[] [map[labelSelector:map[matchLabels:map[k8s-app:kube-dns]] maxSkew:1 topologyKey:kubernetes.io/hostname whenUnsatisfiable:DoNotSchedule]] pro​overwriteConfig
required string pro​
OverwriteConfig can be used to overwrite the coredns config
overwriteConfig
required string pro​overwriteManifests
required string pro​
OverwriteManifests can be used to overwrite the coredns manifests used to deploy coredns
overwriteManifests
required string pro​priorityClassName
required string pro​
PriorityClassName specifies the priority class name for the CoreDNS pods.
priorityClassName
required string pro​