Installing Private Git Server on K8s Cluster with Gitea and AKS
Last Updated :
19 Nov, 2025
In this article, we are going to install a self-hosted Gitea server on top of Azure Kubernetes Service with Helm and set up a git repo. Having a private Git server might be beneficial these days.
Gitea is a community-managed Git-compatible lightweight code hosting solution written in Go. It is published under the MIT license.
Azure Kubernetes Service (AKS) is a Microsoft Azure Managed Kubernetes service
In this article, we will set up an AKS cluster using az CLI and cloud shell.
Implementation:
Before creating any resources, we need to verify that Microsoft.OperationsManagement and Microsoft.OperationalInsights are registered on your subscription
az provider show -n Microsoft.OperationsManagement -o table
az provider show -n Microsoft.OperationalInsights -o table
If they are not registered, register using the following commands:
az provider register --namespace Microsoft.OperationsManagement
az provider register --namespace Microsoft.OperationalInsights

First of all, we need to create a resource group since all Azure resources must be in a particular resource group. All resources I'm going to create will be in the West Europe region (westeurope).
az group create --name my-gitea-lab --location westeurope

Install AKS cluster:
Then we will deploy Azure Kubernetes Cluster on a single VM and make it generate ssh keys for us:
az aks create --resource-group my-gitea-lab --name mygiteaAKSCluster --node-count 1 --node-vm-size standard_b2s --generate-ssh-keys
You can check the prices and sizes of VMs in Azure Documentation. For AKS you need a minimum of 3.5 GB RAM worker VM so the cheapest option for our example is standard_b2s.
Note: When you create an AKS cluster, a second resource group is automatically created to store the AKS resources
New k8s cluster is readyTo get access to your newly created cluster you can run the following command:
az aks get-credentials --resource-group my-gitea-lab --name mygiteaAKSCluster

The helm CLI is already installed in Azure Cloud Shell but if you are using another environment - make sure you have helm 3 CLI binary installed with the following command:
which helm
Let's continue by adding gitea-charts helm repository
helm repo add gitea-charts https://dl.gitea.com/charts/
helm repo update
To customize your Gitea deployment you need to download the values.yml file. You can play around with options of your Gitea setup and provide custom storageclass, expose Gitea through Loadbalancer\Ingress, or setup LDAP or Oauth2 integration. Here are a few examples:
- The service.http.type=LoadBalancer default value is ClusterIP but since we are deploying in the public cloud we will use LoadBalancer
- The ingress.enabled will enable ingress, by default it is false.
- The service.ssh.port setup custom port for ssh traffic.
Deploy Gitea:
Let's bootstrap a Gitea deployment on the Azure Kubernetes Service cluster using the Helm package manager
helm install gitea gitea-charts/gitea --set service.http.type=LoadBalancer

You can watch the Load balancer being provisioned
kubectl get --namespace default svc -w gitea-http

Once appeared external IP run those commands to get Gitea URL:
export SERVICE_IP=$(kubectl get svc --namespace default gitea-http --template "{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}")
echo http://$SERVICE_IP:3000
Welcome to a freshly deployed Gitea!default username and password could be found in the values.yml file
username: gitea_admin
password: r8sA8CPHD9!bt6d
Create Repository:
Once logged in let us create a new repository by clicking "+New Repository" in the top right corner

There are plenty of parameters that you can setup during the repo creation process:

Push code:
Let's initiate git repo in cloud shell, add Readme file and push code to our private Gitea server:
git init
echo "Hello from Gitea Repo!" > README.md
git add README.md
git commit -m "first commit"
git remote add origin http://20.126.230.2:3000/gitea_admin/FirstRepo.git
git push -u origin master

Now we can see the first commit on the remote server!

Clean up:
To clean up, you need to delete the helm chart
helm delete gitea
and delete resource group with AKS cluster and worker node
az group delete --name my-gitea-lab --yes --no-wait
In this article, we covered steps to install Azure Kubernetes Service (AKS) with az CLI, customized and installed Gitea helm chart, exposed Gitea with Load Balancer. Then we created a git repository and pushed code to the Gitea server.
-
A container orchestration platform provided by Azure
-
A lightweight, self-hosted Git-compatible code hosting solution
-
A Helm installer for Kubernetes clusters
-
A CI/CD automation server like Jenkins
Explanation:
Gitea is defined as a lightweight, Git-compatible code hosting solution written in Go and licensed under MIT.
Before creating AKS resources, which Azure providers must be registered?
-
Microsoft.AzureCore and Microsoft.VM
-
Microsoft.Storage and Microsoft.Web
-
Microsoft.OperationsManagement and Microsoft.OperationalInsights
-
Microsoft.Kubernetes and Microsoft.DevOps
Explanation:
The commands az provider show/register indicate that Microsoft.OperationsManagement and Microsoft.OperationalInsights must be registered first.
Which command is used to install the Gitea Helm chart onto the AKS cluster?
-
-
-
helm install gitea gitea-charts/gitea --set service.http.type=LoadBalancer
-
kubectl install gitea-charts
Explanation:
The deployment command uses Helm with LoadBalancer configuration:
helm install gitea gitea-charts/gitea --set service.http.type=LoadBalancer
What is the purpose of running kubectl get svc -w gitea-http after deployment?
-
To permanently stop the service
-
To monitor the LoadBalancer until an external IP appears
-
To delete the Gitea deployment
-
To display Helm installation logs
Explanation:
Using -w (watch) allows continuous monitoring until an external IP is assigned, which is required to access Gitea.
Which command pushes the initial commit to the private Gitea server?
-
-
git push -u origin master
-
git commit origin push master
-
git remote push origin main
Explanation:
After repository initialization and remote setup, the first push is done using:
git push -u origin master
Quiz Completed Successfully
Your Score : 2/5
Accuracy : 0%
Login to View Explanation
1/5
1/5
< Previous
Next >
Explore
Git Introduction
Git Installation and Setup
All Git Commands
Most Used Git Commands
Git Branch
Git Merge
Git Tools and Integration
Git Remote Repositories
Collaborating with Git
Advanced Git Commands