Gitea is a low resource consumption application for CI/CD.
It's also provides containers, helm charts and other types of registries.
Gitea compared to other Git hosting options
Edit all/all.yaml
gitea_enabled: true
# (Optional) Publish Gitea web with proxy
gitea_publish_web: false
# (Optional) Publish Gitea ssh port with proxy
gitea_publish_ssh: false
# (Required) Set loadbalancer ip for ingress
gitea_loadbalancer_ip: "192.168.250.5"
ansible-playbook -i inventory/ghp/${ENV} playbooks/ghp/site.yaml --tags=gitea
Get Gitea admin password:
awk '/gitea_admin_pass/{gsub("\"","") ; print $2}' inventory/ghp/${ENV}/group_vars/all/passwords.yaml
Open https://gitea.{{ domain }}
and login with username gitea
You can use S3-compatible object storage for data like LFS, Packages, etc.
Edit group_vars/k8s/gitea.yaml:
gitea_values:
gitea:
config:
storage:
STORAGE_TYPE: "minio"
MINIO_ENDPOINT: "<your_s3_endpoint>"
MINIO_ACCESS_KEY_ID: "<your_access_key_id>"
MINIO_SECRET_ACCESS_KEY: "<your_secret_access_key"
MINIO_USE_SSL: "true"
MINIO_BUCKET: "<your_backet_name>"
A persistent volume name was changed. After update you need to copy the data from the old volume to the new one:
# Scale down gitea
kubectl -n ${ENV} scale deployment ghp-gitea --replicas 0
# Delete the new volume
rm -rf ghp-gitea-shared-storage-pvc-bc062eb4-b6b8-4bb2-825a-601aa73513dc
# Copy the old volume as new one
cp -a ghp-data-ghp-gitea-0-pvc-a6271775-b379-4823-b255-8db55e899219 ghp-gitea-shared-storage-pvc-bc062eb4-b6b8-4bb2-825a-601aa73513dc
# Fix ssh owner if needed
chown YOUR_GROUP_HERE:YOUR_USER_HERE -R ghp-gitea-shared-storage-pvc-bc062eb4-b6b8-4bb2-825a-601aa73513dc/ssh
# Scale up
kubectl -n ${ENV} scale deployment ghp-gitea --replicas 1
Sometimes Gitea helm chart leave configuration options in app.ini and secret you have deleted.
In this case you should edit ${ENV}-gitea-inline-config in namespace ${ENV} and delete this options:
kubectl -n ${ENV} edit secret ${ENV}-gitea-inline-config
Then you should backup and move/delete/cleanup app.ini and restart pod:
kubectl -n ${ENV} rollout restart deployments/${ENV}-gitea
Gitea Actions are available as a built-in CI/CD solution and designed to be compatible with GitHub Actions.
Login to Gitea as administrator and go to Site Administration -> Runners -> Create New Runner and copy registration token.
Edit all/all.yaml and paste copied registration token
gitea_act_runner_token: <your_registration_token>
ansible-playbook -i inventory/ghp/${ENV} playbooks/ghp/site.yaml --tags=gitea-act-runner
Compared to GitHub Actions
Cron schedule is not implemented yet