Skip to content

Latest commit

 

History

History
114 lines (98 loc) · 3.06 KB

virt-configuring-secondary-dns-server.adoc

File metadata and controls

114 lines (98 loc) · 3.06 KB

Configuring a DNS server for secondary networks

The Cluster Network Addons Operator (CNAO) deploys a Domain Name Server (DNS) server and monitoring components when you enable deployKubeSecondaryDNS in the HyperConverged custom resource (CR).

Prerequisites
  • You installed the OpenShift CLI (oc).

  • You configured a load balancer for the cluster.

  • You logged in to the cluster with cluster-admin permissions.

Procedure
  1. Edit the HyperConverged CR in your default editor by running the following command:

    $ oc edit hyperconverged kubevirt-hyperconverged -n {CNVNamespace}
  2. Enable the DNS server and monitoring components according to the following example:

    apiVersion: hco.kubevirt.io/v1beta1
    kind: HyperConverged
    metadata:
      name: kubevirt-hyperconverged
      namespace: {CNVNamespace}
    spec:
      deployKubeSecondaryDNS: true (1)
    # ...
    1. Enables the DNS server

  3. Save the file and exit the editor.

  4. Create a load balancer service to expose the DNS server outside the cluster by running the oc expose command according to the following example:

    $ oc expose -n {CNVNamespace} deployment/secondary-dns --name=dns-lb \
      --type=LoadBalancer --port=53 --target-port=5353 --protocol='UDP'
  5. Retrieve the external IP address by running the following command:

    $ oc get service -n {CNVNamespace}
    Example output
    NAME       TYPE             CLUSTER-IP     EXTERNAL-IP      PORT(S)          AGE
    dns-lb     LoadBalancer     172.30.27.5    10.46.41.94      53:31829/TCP     5s
  6. Edit the HyperConverged CR again:

    $ oc edit hyperconverged kubevirt-hyperconverged -n {CNVNamespace}
  7. Add the external IP address that you previously retrieved to the kubeSecondaryDNSNameServerIP field in the enterprise DNS server records. For example:

    apiVersion: hco.kubevirt.io/v1beta1
    kind: HyperConverged
    metadata:
      name: kubevirt-hyperconverged
      namespace: {CNVNamespace}
    spec:
      deployKubeSecondaryDNS: true
      kubeSecondaryDNSNameServerIP: "10.46.41.94" (1)
    # ...
    1. Specify the external IP address exposed by the load balancer service.

  8. Save the file and exit the editor.

  9. Retrieve the cluster FQDN by running the following command:

     $ oc get dnses.config.openshift.io cluster -o jsonpath='{.spec.baseDomain}'
    Example output
    openshift.example.com
  10. Point to the DNS server. To do so, add the kubeSecondaryDNSNameServerIP value and the cluster FQDN to the enterprise DNS server records. For example:

    vm.<FQDN>. IN NS ns.vm.<FQDN>.
    ns.vm.<FQDN>. IN A <kubeSecondaryDNSNameServerIP>