<commit_before>---
title: Install Kyma on an AKS cluster
type: Installation
---

This Installation guide shows developers how to quickly deploy Kyma on an [Azure Kubernetes Service](https://azure.microsoft.com/services/kubernetes-service/) (AKS) cluster. Kyma installs on a cluster using a proprietary installer based on a Kubernetes operator.

## Prerequisites
- A domain for your AKS cluster
- [Microsoft Azure](https://azure.microsoft.com)
- [Docker](https://www.docker.com/)
- [Docker Hub](https://hub.docker.com/) account
- [az](https://docs.microsoft.com/pl-pl/cli/azure/install-azure-cli)
- set the environment variables

### Environment variables

Set the following environment variables:
```
export RS_GROUP={YOUR_RESOURCE_GROUP_NAME}
export CLUSTER_NAME={YOUR_CLUSTER_NAME}
export REGION={YOUR_REGION} #westeurope
```

If you use a custom domain, set also these variables:
```
export DNS_DOMAIN={YOUR_DOMAIN} # example.com
export SUB_DOMAIN={YOUR_SUBDOMAIN} # cluster (in this case the full name of your cluster is cluster.example.com)
```

Create a resource group that will contain all your resources:
```
az group create --name $RS_GROUP --location $REGION
```

>**NOTE:** If you don't own a domain which you can use or you don't want to assign a domain to a cluster, see the [document](#installation-install-kyma-on-an-aks-with-wildcard-dns) which shows you how to create a cluster-based playground environment using a wildcard DNS provided by xip.io. 

## DNS setup

Delegate the management of your domain to Azure DNS. Follow these steps:


1. Create a DNS-managed zone in your Azure subscription. Run:

    ```
    az network dns zone create -g $RS_GROUP -n $DNS_DOMAIN
    ```

    Alternatively, create it through the Azure UI. In the **Networking** section, go to **All services**, click **DNS zones**, and select **Add**.

2. Delegate your domain to Azure name servers.

    - Get the list of the name servers from the zone details. This is a sample list:
      ```
      ns1-05.azure-dns.com.
      ns2-05.azure-dns.net.
      ns3-05.azure-dns.org.
      ns4-05.azure-dns.info.
      ```

    - Set up your domain to use these name servers.

3. Check if everything is set up correctly and your domain is managed by Azure name servers. Run:
    ```
    host -t ns $DNS_DOMAIN
    ```
    A successful response returns the list of the name servers you fetched from Azure.

## Get the TLS certificate

>**NOTE:** Azure DNS is not yet supported by Certbot so you must perform a manual verification.

1. Create a folder for certificates. Run:
    ```
    mkdir letsencrypt
    ```
4. Run the Certbot Docker image with the `letsencrypt` folder mounted. Certbot stores the TLS certificates in that folder. Export your email address:
    ```
    export YOUR_EMAIL={YOUR_EMAIL}
    ```
    To obtain a certificate, run:
    ```
    docker run -it --name certbot --rm \
        -v "$(pwd)/letsencrypt:/etc/letsencrypt" \
        certbot/certbot \
        certonly \
        -m $YOUR_EMAIL --agree-tos --no-eff-email \
        --manual \
        --manual-public-ip-logging-ok \
        --preferred-challenges dns \
        --server https://acme-v02.api.letsencrypt.org/directory \
        -d "*.$SUB_DOMAIN.$DNS_DOMAIN"
    ```
    You will see the following message:
    
    ```
    Please deploy a DNS TXT record under the name
    _acme-challenge.rc2-test.kyma.online with the following value:

    # TXT_VALUE
    
    Before continuing, verify the record is deployed.
    ```
    Copy the `TXT_VALUE`. 
    
4. Open a new console and set the environment variables from the [Environment variables](#Environment-variables) section. Export the `TXT_VALUE`.
    
    ```
    export TXT_VALUE={YOUR_TXT_VALUE}
    ```
    To modify TXT record for your domain, run:
    ```
    az network dns record-set txt delete -n "_acme-challenge.$SUB_DOMAIN" -g $RS_GROUP -z $DNS_DOMAIN --yes
    az network dns record-set txt create -n "_acme-challenge.$SUB_DOMAIN" -g $RS_GROUP -z $DNS_DOMAIN --ttl 60 > /dev/null
    az network dns record-set txt add-record -n "_acme-challenge.$SUB_DOMAIN" -g $RS_GROUP -z $DNS_DOMAIN --value $TXT_VALUE
    ``` 
5. Go back to the first console, wait 2 minutes and press enter. 

6. Export the certificate and key as environment variables. Run these commands:

    ```<commit_msg>Update dead links in docs of aks installation (#2432)<commit_after>---
title: Install Kyma on an AKS cluster
type: Installation
---

This Installation guide shows developers how to quickly deploy Kyma on an [Azure Kubernetes Service](https://azure.microsoft.com/services/kubernetes-service/) (AKS) cluster. Kyma installs on a cluster using a proprietary installer based on a Kubernetes operator.

## Prerequisites
- A domain for your AKS cluster
- [Microsoft Azure](https://azure.microsoft.com)
- [Docker](https://www.docker.com/)
- [Docker Hub](https://hub.docker.com/) account
- [az](https://docs.microsoft.com/pl-pl/cli/azure/install-azure-cli)
- set the environment variables

### Environment variables

Set the following environment variables:
```
export RS_GROUP={YOUR_RESOURCE_GROUP_NAME}
export CLUSTER_NAME={YOUR_CLUSTER_NAME}
export REGION={YOUR_REGION} #westeurope
```

If you use a custom domain, set also these variables:
```
export DNS_DOMAIN={YOUR_DOMAIN} # example.com
export SUB_DOMAIN={YOUR_SUBDOMAIN} # cluster (in this case the full name of your cluster is cluster.example.com)
```

Create a resource group that will contain all your resources:
```
az group create --name $RS_GROUP --location $REGION
```

>**NOTE:** If you don't own a domain which you can use or you don't want to assign a domain to a cluster, see the [document](#installation-install-kyma-on-an-aks-cluster-with-wildcard-dns) which shows you how to create a cluster-based playground environment using a wildcard DNS provided by xip.io. 

## DNS setup

Delegate the management of your domain to Azure DNS. Follow these steps:


1. Create a DNS-managed zone in your Azure subscription. Run:

    ```
    az network dns zone create -g $RS_GROUP -n $DNS_DOMAIN
    ```

    Alternatively, create it through the Azure UI. In the **Networking** section, go to **All services**, click **DNS zones**, and select **Add**.

2. Delegate your domain to Azure name servers.

    - Get the list of the name servers from the zone details. This is a sample list:
      ```
      ns1-05.azure-dns.com.
      ns2-05.azure-dns.net.
      ns3-05.azure-dns.org.
      ns4-05.azure-dns.info.
      ```

    - Set up your domain to use these name servers.

3. Check if everything is set up correctly and your domain is managed by Azure name servers. Run:
    ```
    host -t ns $DNS_DOMAIN
    ```
    A successful response returns the list of the name servers you fetched from Azure.

## Get the TLS certificate

>**NOTE:** Azure DNS is not yet supported by Certbot so you must perform a manual verification.

1. Create a folder for certificates. Run:
    ```
    mkdir letsencrypt
    ```
2. Run the Certbot Docker image with the `letsencrypt` folder mounted. Certbot stores the TLS certificates in that folder. Export your email address:
    ```
    export YOUR_EMAIL={YOUR_EMAIL}
    ```
    To obtain a certificate, run:
    ```
    docker run -it --name certbot --rm \
        -v "$(pwd)/letsencrypt:/etc/letsencrypt" \
        certbot/certbot \
        certonly \
        -m $YOUR_EMAIL --agree-tos --no-eff-email \
        --manual \
        --manual-public-ip-logging-ok \
        --preferred-challenges dns \
        --server https://acme-v02.api.letsencrypt.org/directory \
        -d "*.$SUB_DOMAIN.$DNS_DOMAIN"
    ```
    You will see the following message:
    
    ```
    Please deploy a DNS TXT record under the name
    _acme-challenge.rc2-test.kyma.online with the following value:

    # TXT_VALUE
    
    Before continuing, verify the record is deployed.
    ```
    Copy the `TXT_VALUE`. 
    
3. Open a new console and set the environment variables from the [Environment variables](#installation-install-kyma-on-an-aks-cluster-environment-variables) section. Export the `TXT_VALUE`.
    
    ```
    export TXT_VALUE={YOUR_TXT_VALUE}
    ```
    To modify TXT record for your domain, run:
    ```
    az network dns record-set txt delete -n "_acme-challenge.$SUB_DOMAIN" -g $RS_GROUP -z $DNS_DOMAIN --yes
    az network dns record-set txt create -n "_acme-challenge.$SUB_DOMAIN" -g $RS_GROUP -z $DNS_DOMAIN --ttl 60 > /dev/null
    az network dns record-set txt add-record -n "_acme-challenge.$SUB_DOMAIN" -g $RS_GROUP -z $DNS_DOMAIN --value $TXT_VALUE
    ``` 
4. Go back to the first console, wait 2 minutes and press enter. 

5. Export the certificate and key as environment variables. Run these commands:

    ```
{'fraction_non_alphanumeric': 0.10419532324621733, 'fraction_numerical': 0.006419073819348923, 'mean_word_length': 3.117508258612553, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 12, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5437422', 'n_tokens_mistral': 2765, 'n_tokens_neox': 2595, 'n_words': 994}