[Yandex Cloud documentation](../../../index.md) > [Yandex Managed Service for Kubernetes](../../index.md) > [Step-by-step guides](../index.md) > Installing applications from Cloud Marketplace > Installing ExternalDNS with Webhook Cloud DNS

# Installing ExternalDNS with Webhook Yandex Cloud DNS


{% note info %}

[ExternalDNS with Webhook Yandex Cloud DNS](https://yandex.cloud/en/marketplace/products/yc/external-dns-yc-webhook) is a replacement for ExternalDNS with a plugin for Yandex Cloud DNS, which is no longer supported or updated.

{% endnote %}

[ExternalDNS](https://github.com/kubernetes-sigs/external-dns) allows you to create [DNS records](../../../dns/concepts/resource-record.md) in [Yandex Cloud DNS](../../../dns/index.md) automatically. ExternalDNS makes Kubernetes resources discoverable via public DNS servers.

## Getting started {#before-you-begin}

1. If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

   The folder used by default is the one specified when [creating](../../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

1. [Create a service account](../../../iam/operations/sa/create.md) for Cloud DNS.
1. [Assign](../../../iam/operations/sa/assign-role-for-sa.md) it the `dns.editor` role.
1. [Create an authorized key](../../../iam/operations/authentication/manage-authorized-keys.md#create-authorized-key) for the [service account](../../../iam/concepts/users/service-accounts.md) in JSON format and save it to the `key.json` file:

   ```bash
   yc iam key create \
     --service-account-name <service_account_name> \
     --format json \
     --output key.json
   ```

1. [Make sure](../connect/security-groups.md) the security groups for the Managed Service for Kubernetes cluster and its node groups are configured correctly. If a rule is missing, [add it](../../../vpc/operations/security-group-add-rule.md).

    {% note warning %}
    
    The configuration of security groups determines performance and availability of the cluster and the services and applications running in it.
    
    {% endnote %}

## Installation from Yandex Cloud Marketplace {#marketplace-install}

1. In the [management console](https://console.yandex.cloud), select a folder.
1. Navigate to **Managed Service for&nbsp;Kubernetes**.
1. Click the name of the [Managed Service for Kubernetes cluster](../../concepts/index.md#kubernetes-cluster) you need and select the ![image](../../../_assets/console-icons/shopping-cart.svg) **Marketplace** tab.
1. Under **Application available for installation**, select [ExternalDNS with Webhook Yandex Cloud DNS](https://yandex.cloud/en/marketplace/products/yc/external-dns-yc-webhook) and click **Go to install**.
1. Configure the application:
   * **Namespace**: Create a new [namespace](../../concepts/index.md#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.json` file or create a new authorized key for the service account. The service account must have the `dns.editor` [role](../../../iam/concepts/access-control/roles.md).
   * **Folder ID**: Specify the [folder](../../../resource-manager/concepts/resources-hierarchy.md#folder) hosting the [Cloud DNS zone](../../../dns/concepts/dns-zone.md).
1. Click **Install**.
1. Wait for the application status to change to `Deployed`.

## Installation using a Helm chart {#helm-install}

1. [Install Helm](https://helm.sh/docs/intro/install/) v3.8.0 or higher.

1. [Install kubect](https://kubernetes.io/docs/tasks/tools/install-kubectl) and [configure it to work with the new cluster](../connect/index.md#kubectl-connect).

1. To install a [Helm chart](https://helm.sh/docs/topics/charts/) with ExternalDNS, run this command:

   ```bash
   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 `namespace` to the default namespace, ExternalDNS may work incorrectly. We recommend specifying a value different from all the existing namespaces, e.g., `externaldns-space`.

    {% note info %}
    
    If you are using a Helm version below 3.8.0, add the `export HELM_EXPERIMENTAL_OCI=1 && \` string at the beginning of the command to enable [Open Container Initiative](https://opencontainers.org/) (OCI) support in the Helm client.
    
    {% endnote %}

## Features {#features}

To automatically create DNS records using [ExternalDNS with Webhook Yandex Cloud DNS](https://yandex.cloud/en/marketplace/products/yc/external-dns-yc-webhook):
* If you have an [Ingress controller](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/) installed, no additional setup is required.
* For [LoadBalancer](https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer) type services, use this annotation: `"external-dns.alpha.kubernetes.io/hostname=<your_domain>"`.

  To set the TTL for a DNS record, use this annotation: `"external-dns.alpha.kubernetes.io/ttl=<TTL_in_seconds>"`.

## Use cases {#examples}

* [Configuring Yandex Application Load Balancer logging via an ingress controller](../../tutorials/alb-ingress-controller-log-options.md).

## See also {#see-also}

* [ExternalDNS documentation](https://github.com/kubernetes-sigs/external-dns/)