Preparing AKS resources for the GitLab chart

For a fully functional GitLab instance, you need a few resources before deploying the GitLab chart to Azure Kubernetes Service (AKS).

Creating the AKS cluster

To get started easier, a script is provided to automate the cluster creation. Alternatively, a cluster can be created manually as well.

Prerequisites:

Scripted cluster creation

A bootstrap script has been created to automate much of the setup process for users on Azure.

It reads an argument of up, down or creds, with additional optional parameters from environment variables, or command line arguments:

  • To create the cluster:

    ./scripts/aks_bootstrap_script.sh up
    

    This will:

    1. Create a new Resource Group (optional).
    2. Create a new AKS cluster.
    3. Create a new Public IP (optional).
  • To clean up the created AKS resources:

    ./scripts/aks_bootstrap_script.sh down
    

    This will:

    1. Delete the specified Resource Group (optional).
    2. Delete the AKS cluster.
    3. Delete the Resource Group created by the cluster.

    The down argument will send the command to delete all resources and finish instantly. The actual deletion can take several minutes to complete.

  • To connect kubectl to the cluster:

    ./scripts/aks_bootstrap_script.sh creds
    

The table below describes all available variables.

VariableDescriptionDefault valueScope
-g --resource-groupName of the resource group to use.gitlab-resourcesAll
-n --cluster-nameName of the cluster to use.gitlab-clusterAll
-r --regionRegion to install the cluster in.eastusup
-v --cluster-versionVersion of Kubernetes to use for creating the cluster.Latestup
-c --node-countNumber of nodes to use.2up
-s --node-vm-sizeType of nodes to use.Standard_D4s_v3up
-p --public-ip-nameName of the public IP to create.gitlab-ext-ipup
--create-resource-groupCreate a new resource group to hold all created resources.falseup
--create-public-ipCreate a public IP to use with the new cluster.falseup
--delete-resource-groupDelete the resource group when using the down command.falsedown
-f --kubctl-config-fileKubernetes configuration file to update. Use - to print YAML to stdout instead.~/.kube/configcreds

Manual cluster creation

A cluster with 8vCPU and 30GB of RAM is recommended.

For the most up to date instructions, follow Microsoft’s AKS walkthrough.

External Access to GitLab

An external IP is required so that your cluster can be reachable. For the most up to date instructions, follow Microsoft’s Create a static IP address guide.

Next Steps

Continue with the installation of the chart once you have the cluster up and running, and the static IP and DNS entry ready.