Testing/CI/KubernetesRunners: Difference between revisions
(Extend the Setup section with Gitlab, CLI and Agent) |
(Add instructions to connect to the cluster) |
||
Line 2: | Line 2: | ||
=== Kubernetes Cluster === | === Kubernetes Cluster === | ||
Create a Kubernetes cluster on Azure AKS. Single node pool "agentpool" for the Kubernetes system pods. | Create a Kubernetes cluster on Azure (AKS). Single node pool "agentpool" for the Kubernetes system pods. | ||
Enable virtual nodes [https://learn.microsoft.com/en-us/azure/aks/virtual-nodes] to have on-demand capacity for the CI workloads. | Enable virtual nodes [https://learn.microsoft.com/en-us/azure/aks/virtual-nodes] to have on-demand capacity for the CI workloads. | ||
Line 16: | Line 16: | ||
podman run -it mcr.microsoft.com/azure-cli | podman run -it mcr.microsoft.com/azure-cli | ||
Install the Kubernetes CLI (kubectl) [https://learn.microsoft.com/en-us/cli/azure/aks?view=azure-cli-latest#az-aks-install-cli]: | Install the Kubernetes CLI (kubectl) [https://learn.microsoft.com/en-us/cli/azure/aks?view=azure-cli-latest#az-aks-install-cli]: | ||
Line 28: | Line 24: | ||
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash | curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash | ||
Sign in to Azure [https://learn.microsoft.com/en-us/cli/azure/authenticate-azure-cli]: | |||
az login | |||
Connect to your Kubernetes Cluster. Open the Azure web dashboard for your cluster and push the "Connect" button. | |||
A list of commands will be displayed to connect to your cluster. | |||
Something like the following: | |||
az account set --subscription ... | |||
az aks get-credentials ... | |||
=== Agent === | === Agent === |
Revision as of 14:28, 15 March 2023
Setup
Kubernetes Cluster
Create a Kubernetes cluster on Azure (AKS). Single node pool "agentpool" for the Kubernetes system pods. Enable virtual nodes [1] to have on-demand capacity for the CI workloads.
Gitlab
Follow the docs to Register the agent with GitLab.
Make sure you keep the command under "Recommended installation method" (last step).
CLI
Follow the docs to Install the Azure CLI.
Alternatively, run the Azure CLI in a container [2]:
podman run -it mcr.microsoft.com/azure-cli
Install the Kubernetes CLI (kubectl) [3]:
az aks install-cli
Install the Helm CLI [4]:
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
Sign in to Azure [5]:
az login
Connect to your Kubernetes Cluster. Open the Azure web dashboard for your cluster and push the "Connect" button. A list of commands will be displayed to connect to your cluster. Something like the following:
az account set --subscription ... az aks get-credentials ...
Agent
Now it's time to install the agent with Helm [6]. Paste and run the command you got earlier from Gitlab. The "Recommended installation method".
The command you run should look like this:
helm repo add gitlab https://charts.gitlab.io helm repo update helm upgrade --install ...