This is a cache of https://docs.okd.io/latest/networking/ingress-controller-dnsmgt.html. It is a snapshot of the page at 2024-11-16T18:31:50.053+0000.
Configuring the Ingress Controller for manual <strong>dns</strong> management | Networking | OKD 4
×

As a cluster administrator, when you create an Ingress Controller, the Operator manages the dns records automatically. This has some limitations when the required dns zone is different from the cluster dns zone or when the dns zone is hosted outside the cloud provider.

As a cluster administrator, you can configure an Ingress Controller to stop automatic dns management and start manual dns management. Set dnsManagementPolicy to specify when it should be automatically or manually managed.

When you change an Ingress Controller from Managed to Unmanaged dns management policy, the Operator does not clean up the previous wildcard dns record provisioned on the cloud. When you change an Ingress Controller from Unmanaged to Managed dns management policy, the Operator attempts to create the dns record on the cloud provider if it does not exist or updates the dns record if it already exists.

When you set dnsManagementPolicy to unmanaged, you have to manually manage the lifecycle of the wildcard dns record on the cloud provider.

Managed dns management policy

The Managed dns management policy for Ingress Controllers ensures that the lifecycle of the wildcard dns record on the cloud provider is automatically managed by the Operator.

Unmanaged dns management policy

The Unmanaged dns management policy for Ingress Controllers ensures that the lifecycle of the wildcard dns record on the cloud provider is not automatically managed, instead it becomes the responsibility of the cluster administrator.

On the AWS cloud platform, if the domain on the Ingress Controller does not match with dnsConfig.Spec.BaseDomain then the dns management policy is automatically set to Unmanaged.

Creating a custom Ingress Controller with the Unmanaged dns management policy

As a cluster administrator, you can create a new custom Ingress Controller with the Unmanaged dns management policy.

Prerequisites
  • Install the OpenShift CLI (oc).

  • Log in as a user with cluster-admin privileges.

Procedure
  1. Create a custom resource (CR) file named sample-ingress.yaml containing the following:

    apiVersion: operator.openshift.io/v1
    kind: IngressController
    metadata:
      namespace: openshift-ingress-operator
      name: <name> (1)
    spec:
      domain: <domain> (2)
      endpointPublishingStrategy:
        type: LoadBalancerService
        loadBalancer:
          scope: External (3)
          dnsManagementPolicy: Unmanaged (4)
    1 Specify the <name> with a name for the IngressController object.
    2 Specify the domain based on the dns record that was created as a prerequisite.
    3 Specify the scope as External to expose the load balancer externally.
    4 dnsManagementPolicy indicates if the Ingress Controller is managing the lifecycle of the wildcard dns record associated with the load balancer. The valid values are Managed and Unmanaged. The default value is Managed.
  2. Save the file to apply the changes.

    oc apply -f <name>.yaml (1)

Modifying an existing Ingress Controller

As a cluster administrator, you can modify an existing Ingress Controller to manually manage the dns record lifecycle.

Prerequisites
  • Install the OpenShift CLI (oc).

  • Log in as a user with cluster-admin privileges.

Procedure
  1. Modify the chosen IngressController to set dnsManagementPolicy:

    SCOPE=$(oc -n openshift-ingress-operator get ingresscontroller <name> -o=jsonpath="{.status.endpointPublishingStrategy.loadBalancer.scope}")
    
    oc -n openshift-ingress-operator patch ingresscontrollers/<name> --type=merge --patch='{"spec":{"endpointPublishingStrategy":{"type":"LoadBalancerService","loadBalancer":{"dnsManagementPolicy":"Unmanaged", "scope":"${SCOPE}"}}}}'
  2. Optional: You can delete the associated dns record in the cloud provider.