Configure cluster model for ExternalDNS

Configure cluster model for ExternalDNSΒΆ

After you prepare your DNS backend as described in Prepare a DNS backend for ExternalDNS, prepare your cluster model as described below.

To configure the cluster model:

  1. Select from the following options:

    • If you are performing the initial deployment of your MCP Kubernetes cluster:
      1. Use the ModelDesigner UI to create the Kubernetes cluster model. For details, see: Create a deployment metadata model.
      2. While creating the model, select the Kubernetes externaldns enabled check box in the Kubernetes product parameters section.
    • If you are making changes to an existing MCP Kubernetes cluster, proceed to the next step.
  2. Open your Git project repository.

  3. In classes/cluster/<cluster_name>/kubernetes/control.yml:

    1. If you are performing the initial deployment of your MCP Kubernetes cluster, configure the provider parameter in the snippet below depending on your DNS provider: coredns|aws|google|designate. If you are making changes to an existing cluster, add and configure the snippet below. For example:

      parameters:
        kubernetes:
          common:
            addons:
              externaldns:
              enabled: True
              namespace: kube-system
              image: mirantis/external-dns:latest
              domain: domain
              provider: coredns
      
    2. Set up the pillar data for your DNS provider to configure it as an add-on. Use the credentials generated while preparing your DNS provider.

      • For Designate:

        parameters:
          kubernetes:
            common:
              addons:
                externaldns:
                  externaldns:
                    enabled: True
                    domain: company.mydomain
                    provider: designate
                    designate_os_options:
                      OS_AUTH_URL: https://keystone_auth_endpoint:5000
                      OS_PROJECT_DOMAIN_NAME: default
                      OS_USER_DOMAIN_NAME: default
                      OS_PROJECT_NAME: admin
                      OS_USERNAME: admin
                      OS_PASSWORD: password
                      OS_REGION_NAME: RegionOne
        
      • For AWS Route 53:

        parameters:
          kubernetes:
            common:
              addons:
                externaldns:
                  externaldns:
                    enabled: True
                    domain: company.mydomain
                    provider: aws
                    aws_options:
                      AWS_ACCESS_KEY_ID: XXXXXXXXXXXXXXXXXXXX
                      AWS_SECRET_ACCESS_KEY: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
        
      • For Google CloudDNS:

        parameters:
          kubernetes:
            common:
              addons:
                externaldns:
                  externaldns:
                    enabled: True
                    domain: company.mydomain
                    provider: google
                    google_options:
                      key: ''
                      project: default-123
        

        Note

        You can export the credentials from the Google console and process them using the cat key.json | tr -d 'n' command.

      • For CoreDNS:

        parameters:
          kubernetes:
            common:
              addons:
                coredns:
                  enabled: True
                  namespace: kube-system
                  image: coredns/coredns:latest
                  etcd:
                    operator_image: quay.io/coreos/etcd-operator:v0.5.2
                    version: 3.1.8
                    base_image: quay.io/coreos/etcd
        
  4. Commit and push the changes to the project Git repository.

  5. Log in to the Salt Master node.

  6. Update your Salt formulas and the system level of your repository:

    1. Change the directory to /srv/salt/reclass.
    2. Run the git pull origin master command.
    3. Run the salt-call state.sls salt.master command.
    4. Run the salt-call state.sls reclass command.

Now, proceed to Deploy ExternalDNS.