Skip to content

Allow configuring -cluster-dns in KubeOneCluster and fix missing flag in OSM addon when NodeLocalDNS is disabled #4033

Description

@archups

Problem:
Currently, in the Operating System Manager (OSM) addon deployment, the -cluster-dns argument is only set if features.nodeLocalDNS.deploy is true. Reference logic https://github.com/kubermatic/kubeone/blob/main/addons/operating-system-manager/deployment-controller.yaml#L49-L51
If nodeLocalDNS is disabled it (set to false) in kubeone.yaml, the flag is omitted entirely. This prevents nodes from receiving a DNS server configuration via kubelet, causing name resolution failures. Additionally, there is currently no way for a user to manually override or specify a custom DNS server IP within the KubeOneCluster manifest.

Proposed Changes:

  1. Fix Default Logic: Ensure that if nodeLocalDNS is disabled, the -cluster-dns flag defaults to the CoreDNS service IP (typically IP ending with .10 from the serviceSubnet range defined in KubeOneCluster manifest) instead of being omitted.
  2. Make Configurable: Update the KubeOneCluster CRD to allow users to explicitly define the Cluster DNS IP.

Suggested API Addition:

apiVersion: kubeone.k8c.io/v1beta2
kind: KubeOneCluster
...
clusterNetwork:
  serviceSubnet: "10.224.0.0/12"
  dnsServiceIP: "10.224.0.10"  # New optional field to override the default

Expected Behavior:

  • If dnsServiceIP is provided in the CRD, OSM should use that value.
  • If not provided and nodeLocalDNS is enabled, use the NodeLocalDNS IP.
  • If not provided and nodeLocalDNS is disabled, use the default CoreDNS ClusterIP.

Metadata

Metadata

Assignees

No one assigned

    Labels

    customer-requestlifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions