Installing ExternalDNS with a plugin for Yandex Cloud DNS
ExternalDNS
Getting started
-
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the
--folder-name
or--folder-id
parameter. -
Create a service account for Cloud DNS.
-
Assign it the
dns.editor
role. -
Create an authorized key for the service account in JSON format and save it to the
key.json
file: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
- Go to the folder page
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: Select or create a namespace for ExternalDNS.
- Application name: Specify the app name.
- Service account key: Paste the contents of the
key.json
file or create a new authorized key for the service account. The service account must have thedns.editor
role. - Folder ID: Specify the folder hosting the Cloud DNS zone.
- 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 kubectl
and configure it to work with the created 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-a \ --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/
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 logging for an Yandex Application Load Balancer L7 load balancer using an Ingress controller.
- Deploying and load testing a gRPC service with scaling.