# Installing Utopia in Azure

Check out this video running through the process, alternatively follow the instructions below

{% embed url="<https://youtu.be/JYYwN_L179Q>" %}

Azure simplifies the process of creating a Kubernetes cluster with its Azure Kubernetes Services (AKS). Setting up AKS is as straightforward as launching a virtual machine or a database in Azure. For most options, the default settings work well, but there are a few key areas you might want to customize:

1. **Basics Tab:**
   * Here, you'll define basic settings like your cluster's naming conventions and regions.
   * The Kubernetes version and upgrade settings are preset to sensible defaults, and it's usually fine to leave these as they are.
2. **Node Pools Tab:**
   * This tab lets you choose the size of the nodes (similar to VM size) in your cluster.
   * We recommend a minimum specification of 4-core CPUs and 7 GB RAM, typically using the Ubuntu OS, for a balanced performance.
3. **Networking Tab:**
   * Consider whether you need external access to your Kubernetes cluster. If so, enable public access by checking the 'Set authorized IP ranges' box.
   * If you're not familiar with Calico network policies and configurations, it's advisable to choose 'None' under the Network policy options.
4. **Integrations Tab:**
   * The default settings on this tab are usually sufficient, so you can leave them as is.
5. **Monitoring Tab:**
   * The monitoring settings can also be left at their defaults unless you have specific monitoring needs.
6. **Advanced Tab:**
   * Like the previous tabs, default settings here typically suffice.
7. **Tags Tab:**
   * Apply any necessary tags as per your usual Azure management practices. Tags are useful for categorizing and managing resources within Azure.
8. **Review + Create Tab:**
   * Finally, review all your settings. If everything looks good and aligns with your requirements, proceed to create your Kubernetes cluster.

What Azure will do now, is create a second resource group specifically for your Kubernetes cluster, this will include a few things in the background including Storage!&#x20;

Once it is up the easiest way to install Utopia is connect your local terminal to your new Kube cluster. to do this you will need to to have the Azure CLI installed. If you have not done this already please check out <https://learn.microsoft.com/en-us/cli/azure/install-azure-cli>

Once installed, from your local (where ever you have the utopia helm chart downloaded) terminal you can run:

```
az login
```

You must then navigate to this resource to connect with it, navigating from your subscription to your resource:

Get a list of all your subscriptions

```
az account list
```

Set to the subscription you are looking for:

```
az account set --subscription "your-account"
```

Get a list of the resource groups

```
az group list -o table
```

Find the resource group you created for the Kube cluster and then run this command to get the resource names

```
az aks list --resource-group resource-abcde --query "[].name"
```

Find the Kubernetes resource name and then you can merge the kube config to your local kube config file by running the following:

```
az aks get-credentials --resource-group resource-abcde --name kube-1234
```

now you should be able to see your azure cluster on your local terminal if you run

```
kubectl config get-contexts
```

to select it you can use

```
kubectl config use-context kube-1234
```

Next check you storage classes available, for Azure you can use default

```
kubectl get sc
```

Make sure your utopia values.yaml file has the correct storage class name here (see [Databases](/integration-hub/installation-guide/kubernetes-installation/the-installation-configurator/databases.md))

When you have your utopia helm chart finalised ( [Kubernetes Installation](/integration-hub/installation-guide/kubernetes-installation.md)) navigate to the utopia folder in your local terminal and run

```
helm install utopia .
```

Back in your azure kubernetes resource you will see the workloads and services start provisioning.

Once everything is up, you will notice that you will not be able to connect to your Loadbalancer service, you can read up in more detail about this in this article: <https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#custom-load-balancer-health-probe> and <https://learn.microsoft.com/en-us/azure/aks/ingress-basic?tabs=azure-cli#basic-configuration>

however essentially it means navigating into your kubernetes services, selecting your Loadbalancer service and navigate to its yaml file from the left hand panel. Once open you will need to add the following to the ingress-nginx-controller:\
metadata -> annotations node

```
service.beta.kubernetes.io/azure-load-balancer-health-probe-request-path: /healthz
```

after editting your yaml should look something like this

```
apiVersion: v1
kind: Service
metadata:
  name: ingress-nginx-controller
  namespace: default
  uid: 951417bc-856b-4532-9149-59bc34b3e99a
  resourceVersion: '54497756'
  creationTimestamp: '2023-10-23T13:55:14Z'
  labels:
    app.kubernetes.io/component: controller
    app.kubernetes.io/instance: ingress-nginx
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
    app.kubernetes.io/version: 1.9.3
    helm.sh/chart: ingress-nginx-4.8.2
  annotations:
    meta.helm.sh/release-name: ingress-nginx
    meta.helm.sh/release-namespace: default
    service.beta.kubernetes.io/azure-load-balancer-health-probe-request-path: "/healthz"
.....    
```

Now you should be able to access your Loadbalancer! which will mean you can finish off your installation by adding your DNS 'A' records as per the [Final Stage DNS setup](/integration-hub/installation-guide/kubernetes-installation/final-stage-dns-setup.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://university.utopiasync.com/integration-hub/installation-guide/cluster-craft/installing-utopia-in-azure.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
