Installing ExternalDNS with a plugin for Yandex Cloud DNS
ExternalDNS
Getting started
-
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the
yc config set folder-id <folder_ID>command. You can also set a different folder for any specific command using the--folder-nameor--folder-idparameter. -
Create a service account for Cloud DNS.
-
Assign it the
dns.editorrole. -
Create an authorized key for the service account in JSON format and save it to the
key.jsonfile:yc iam key create \ --service-account-name <service_account_name> \ --format json \ --output key.json -
Make sure that the security groups for the Managed Service for Kubernetes cluster and its node groups are configured correctly. If any rule is missing, add it.
Warning
The configuration of security groups determines the performance and availability of the cluster and the services and applications running in it.
Installation using Yandex Cloud Marketplace
- Navigate to the folder dashboard
and select Managed Service for Kubernetes. - Click the name of the Managed Service for Kubernetes cluster you need and select the
Marketplace tab. - Under Application available for installation, select ExternalDNS with a plugin for Yandex Cloud DNS and click Go to install.
- Configure the application:
- Namespace: Create a new namespace, e.g.,
externaldns-space. If you leave the default namespace, ExternalDNS may work incorrectly. - Application name: Specify the application name.
- Service account key: Paste the contents of the
key.jsonfile or create a new authorized key for the service account. The service account must have thedns.editorrole. - Folder ID: Specify the folder hosting the Cloud DNS zone.
- Namespace: Create a new namespace, e.g.,
- Click Install.
- Wait for the application to change its status to
Deployed.
Installation using a Helm chart
-
Install Helm
v3.8.0 or higher. -
Install kubect
and configure it to work with the new cluster. -
To install a Helm chart
with ExternalDNS, run the following command:helm pull oci://cr.yandex/yc-marketplace/yandex-cloud/externaldns/chart/externaldns \ --version 0.5.1-b \ --untar && \ helm install \ --namespace <namespace> \ --create-namespace \ --set config.folder_id=<ID_of_folder_with_DNS_zone> \ --set-file config.auth.json=<path_to_file_with_service_account_authorized_key> \ externaldns ./externaldns/If you set
namespaceto the default namespace, ExternalDNS may work incorrectly. We recommend you to specify a value different from all existing namespaces (e.g.,externaldns-space).Note
If you are using a Helm version below 3.8.0, append the
export HELM_EXPERIMENTAL_OCI=1 && \string to the command to enable Open Container Initiative (OCI) support in the Helm client.
Operation specifics
To automatically create DNS records using ExternalDNS with a plugin for Yandex Cloud DNS:
-
If you have an Ingress controller
installed, no additional setup is required. -
For LoadBalancer
type services, use this annotation:"external-dns.alpha.kubernetes.io/hostname=<your_domain>".To set the TTL of a DNS record, use this annotation:
"external-dns.alpha.kubernetes.io/ttl=<TTL_in_seconds>".
Use cases
- Configuring Yandex Application Load Balancer logging via an ingress controller.
- Deploying and load testing a gRPC service with scaling.