This page describes the steps for deploying The Things Stack on Azure Kubernetes Service.
Azure Infrastructure
Start with the 1-infrastructure
templates that create the foundation for your deployment.
If you haven’t done this before create a Terraform backend configuration file config.azurerm.tfbackend
. You can read more about it in the Configuration section.
Initialize the Terraform state.
$ make init
Plan the deployment and verify everything is going to be set up correctly.
$ make plan
This template will deploy the Azure Kubernetes Service cluster, Azure Storage containers and Azure Database Flexible Server for Postgres, with their supporting infrastructure. You can apply it after validating the deployment plan. The deployment should take about 10 to 15 minutes. If you encounter any issues, please refer to Troubleshooting.
$ make apply
After the AKS cluster is deployed you can get the kubeconfig
file next.
# Set KUBECONFIG if you don't want to override the default kubeconfig.
$ export KUBECONFIG='local.kubeconfig'
# Set KUBE_CONFIG_PATH to the location of the kubeconfig.
# If you didn't set the KUBECONFIG variable use '~/.kube/config' instead.
# Ref https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs#file-config
$ export KUBE_CONFIG_PATH="$(pwd)/${KUBECONFIG}"
$ az aks get-credentials --resource-group $(terraform output -raw resource_group_name) --name $(terraform output -raw aks_cluster_name)
Note:
Ifvar.allow_cluster_admin_access
is disabled, then kubelogin
must be installed.
Follow the prompt to authenticate the kubectl
.
$ kubectl get pods
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code xxxxxx to authenticate.
Export the DNS values used for DNS Infrastructure. Use the provider chosen during the Configuration.
$ DNS_PROVIDER='<provider>'
$ make dns.values | jq > "$(git rev-parse --show-toplevel)/dns/${DNS_PROVIDER}/dns.auto.tfvars.json"
Export the Infrastructural values used for Kubernetes Templates.
$ make infra.values | jq > '../2-kubernetes/infra.auto.tfvars.json'
DNS Infrastructure
Now we need to set up the DNS infrastructure. Head over to the directory of the provider you chose during the last steps of the Azure Infrastructure section.
If you haven’t done this before create a Terraform backend configuration file config.azurerm.tfbackend
. You can read more about it in Terraform Backend Configuration.
Initialize the Terraform state.
Note:
KUBE_CONFIG_PATH
should point to your kubeconfig
.
# Example
$ export KUBE_CONFIG_PATH='~/.kube/config'
$ make init
Plan the deployment and verify everything is going to be set up correctly.
$ make plan
Now apply the template.
$ make apply
Verify the certificate is in ready state. This may take a couple of minutes after the deployment for the certificate to reach a ready state.
$ kubectl -n tts get cert
In case the certificate won’t reach a ready state head over to Troubleshooting Problems with ACME / Let’s Encrypt Certificates.
Kubernetes Templates
Head over to the 2-kubernetes
directory next.
If you haven’t done this before create a Terraform backend configuration file config.azurerm.tfbackend
. You can read more about it in Terraform Backend Configuration.
Initialize the Terraform state.
$ make init
Plan the deployment and verify everything is going to be set up correctly.
Note:
KUBE_CONFIG_PATH
should point to your kubeconfig
.
# Example
$ export KUBE_CONFIG_PATH='~/.kube/config'
$ make plan
Now apply the template.
$ make apply
Once all the targets are healthy and if the configuration was correct, The Things Stack console will be accessible at https://<tenantID>.<domain>
.