Skip to content

Commit aeaec72

Browse files
committed
Deploy: added gitea helm.
1 parent 4cd965f commit aeaec72

4 files changed

Lines changed: 186 additions & 1 deletion

File tree

deploy/Makefile

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ HELM_POSTGRESQL_NAMESPACE ?= cogstack
1818
HELM_POSTGRESQL_CHART ?= ./charts/postgresql
1919
HELM_POSTGRESQL_VALUES_FILE ?= ./helm/postgresql.values.yaml
2020
HELM_POSTGRESQL_VALUES_ARG = -f $(HELM_POSTGRESQL_VALUES_FILE)
21+
HELM_GITEA_RELEASE ?= cogstack-gitea
22+
HELM_GITEA_NAMESPACE ?= cogstack
23+
HELM_GITEA_REPO_NAME ?= gitea-charts
24+
HELM_GITEA_REPO_URL ?= https://dl.gitea.com/charts/
25+
HELM_GITEA_CHART ?= $(HELM_GITEA_REPO_NAME)/gitea
26+
HELM_GITEA_CHART_VERSION ?= 12.5.0
27+
HELM_GITEA_VALUES_FILE ?= ./helm/gitea.values.yaml
28+
HELM_GITEA_VALUES_ARG = -f $(HELM_GITEA_VALUES_FILE)
2129
CNPG_OPERATOR_MINOR ?= 1.28
2230
CNPG_OPERATOR_VERSION ?= 1.28.1
2331
CNPG_OPERATOR_MANIFEST ?= https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/release-$(CNPG_OPERATOR_MINOR)/releases/cnpg-$(CNPG_OPERATOR_VERSION).yaml
@@ -97,6 +105,18 @@ helm-template-postgresql: ## Render CloudNativePG PostgreSQL chart using chart d
97105
helm-install-postgresql: ## Install/upgrade CloudNativePG PostgreSQL chart using chart defaults plus ./helm/postgresql.values.yaml
98106
helm upgrade --install $(HELM_POSTGRESQL_RELEASE) $(HELM_POSTGRESQL_CHART) $(HELM_POSTGRESQL_VALUES_ARG) --namespace $(HELM_POSTGRESQL_NAMESPACE) --create-namespace
99107

108+
helm-repo-add-gitea: ## Add/update the official Gitea Helm repository
109+
@if ! helm repo list | awk '$$1 == "$(HELM_GITEA_REPO_NAME)" { found=1 } END { exit !found }'; then \
110+
helm repo add $(HELM_GITEA_REPO_NAME) $(HELM_GITEA_REPO_URL); \
111+
fi
112+
helm repo update $(HELM_GITEA_REPO_NAME)
113+
114+
helm-template-gitea: helm-repo-add-gitea ## Render the official Gitea chart using ./helm/gitea.values.yaml
115+
helm template $(HELM_GITEA_RELEASE) $(HELM_GITEA_CHART) --version $(HELM_GITEA_CHART_VERSION) $(HELM_GITEA_VALUES_ARG) --namespace $(HELM_GITEA_NAMESPACE)
116+
117+
helm-install-gitea: helm-repo-add-gitea ## Install/upgrade the official Gitea chart using ./helm/gitea.values.yaml
118+
helm upgrade --install $(HELM_GITEA_RELEASE) $(HELM_GITEA_CHART) --version $(HELM_GITEA_CHART_VERSION) $(HELM_GITEA_VALUES_ARG) --namespace $(HELM_GITEA_NAMESPACE) --create-namespace
119+
100120

101121
remote-deploy-service: ## Deploy one or more services to a remote machine via SSH + docker compose
102122
remote-deploy-service: _check-remote-params
@@ -124,7 +144,7 @@ _check-remote-params:
124144
exit 1; \
125145
fi
126146

127-
.PHONY: remote-deploy-service remote-stop-service remote-delete-service _check-remote-params helm-template-opensearch helm-install-opensearch kube-install-cnpg-operator helm-template-postgresql helm-install-postgresql
147+
.PHONY: remote-deploy-service remote-stop-service remote-delete-service _check-remote-params helm-template-opensearch helm-install-opensearch kube-install-cnpg-operator helm-template-postgresql helm-install-postgresql helm-repo-add-gitea helm-template-gitea helm-install-gitea
128148

129149
# start services
130150

deploy/helm/gitea.values.yaml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Cluster-specific overrides for the official Gitea Helm chart.
2+
#
3+
# The Makefile targets add/update the `gitea-charts` repo automatically and pin
4+
# the chart version. This file keeps only the overrides needed to stay close to
5+
# the current Docker Compose GitEA service.
6+
7+
replicaCount: 1
8+
9+
service:
10+
http:
11+
type: ClusterIP
12+
port: 3000
13+
clusterIP: ""
14+
ssh:
15+
type: ClusterIP
16+
port: 2222
17+
clusterIP: ""
18+
19+
resources:
20+
requests:
21+
cpu: "500m"
22+
memory: "512Mi"
23+
limits:
24+
cpu: "1"
25+
memory: "1Gi"
26+
27+
persistence:
28+
size: 10Gi
29+
30+
# Keep the initial Helm migration close to the current Compose deployment:
31+
# single pod, embedded SQLite, and no bundled database/cache subcharts.
32+
valkey-cluster:
33+
enabled: false
34+
35+
valkey:
36+
enabled: false
37+
38+
postgresql-ha:
39+
enabled: false
40+
41+
postgresql:
42+
enabled: false
43+
44+
# Create this Secret before install if you want Helm to bootstrap an admin user:
45+
# kubectl create secret generic gitea-admin-credentials \
46+
# --from-literal=username=admin \
47+
# --from-literal=password='change-me'
48+
#
49+
# Create this Secret before install to preserve the current direct-HTTPS setup:
50+
# kubectl create secret generic gitea-root-ca \
51+
# --from-file=root-ca.pem=./security/certificates/root/root-ca.pem \
52+
# --from-file=root-ca.key=./security/certificates/root/root-ca.key
53+
gitea:
54+
admin:
55+
# existingSecret: gitea-admin-credentials
56+
username: ""
57+
password: ""
58+
email: "gitea@localhost"
59+
passwordMode: initialOnlyNoReset
60+
config:
61+
APP_NAME: "Gitea: Git with a cup of tea"
62+
RUN_MODE: prod
63+
server:
64+
PROTOCOL: https
65+
DOMAIN: localhost
66+
ROOT_URL: https://localhost:3000/
67+
HTTP_PORT: 3000
68+
START_SSH_SERVER: true
69+
SSH_DOMAIN: localhost
70+
SSH_PORT: 2222
71+
SSH_LISTEN_HOST: 0.0.0.0
72+
SSH_LISTEN_PORT: 2222
73+
CERT_FILE: /certificates/root/root-ca.pem
74+
KEY_FILE: /certificates/root/root-ca.key
75+
database:
76+
DB_TYPE: sqlite3
77+
PATH: /data/gitea/gitea.db
78+
HOST: localhost
79+
SSL_MODE: disable
80+
LOG_SQL: false
81+
oauth2:
82+
ENABLED: true
83+
mailer:
84+
ENABLED: false
85+
repository:
86+
ENABLE_PUSH_CREATE_USER: true
87+
ENABLE_PUSH_CREATE_ORG: true
88+
DEFAULT_PUSH_CREATE_PRIVATE: true
89+
"cron.update_checker":
90+
ENABLED: false
91+
"repository.pull-request":
92+
DEFAULT_MERGE_STYLE: merge
93+
"repository.signing":
94+
DEFAULT_TRUST_MODEL: committer
95+
96+
extraVolumes:
97+
- name: gitea-root-ca
98+
secret:
99+
secretName: gitea-root-ca
100+
101+
extraInitVolumeMounts:
102+
- name: gitea-root-ca
103+
mountPath: /certificates/root
104+
readOnly: true
105+
106+
extraContainerVolumeMounts:
107+
- name: gitea-root-ca
108+
mountPath: /certificates/root
109+
readOnly: true

deploy/helm/postgresql.values.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Cluster-specific overrides for the CloudNativePG PostgreSQL chart.
2+
#
3+
# Shared database env, database user env, and bootstrap SQL files are not listed
4+
# here: the chart already consumes the repo's canonical files from deploy/,
5+
# security/, and services/ via its bundled defaults.
6+
7+
cluster:
8+
instances: 3
9+
storage:
10+
size: 20Gi
11+
# storageClass: local-path
12+
ownerSuperuser: false
13+
enableSuperuserAccess: false
14+
15+
# For a single-node dev cluster only:
16+
# cluster:
17+
# instances: 1
18+
19+
# To use a pre-created Secret instead of users_database.env defaults:
20+
# credentials:
21+
# existingAppSecret: cogstack-postgresql-app

docs/deploy/deployment.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,41 @@ helm upgrade --install cogstack-opensearch ./deploy/charts/opensearch \
8282
> The chart already consumes the shared OpenSearch, Dashboards, and security YAML files automatically from this repo.
8383
> The values file is only for cluster-specific overrides such as secret names, storage classes, replicas, and snapshot PVC claims.
8484
85+
## ⎈ Helm (GitEA / Gitea)
86+
87+
GitEA can be deployed with the official Gitea Helm chart. The Makefile adds the
88+
upstream repo automatically and pins a chart version for reproducible installs.
89+
90+
Quick usage:
91+
92+
```bash
93+
# render manifests
94+
make -C deploy helm-template-gitea
95+
96+
# install or upgrade
97+
make -C deploy helm-install-gitea
98+
```
99+
100+
Key defaults live in:
101+
102+
```bash
103+
./deploy/helm/gitea.values.yaml
104+
```
105+
106+
Current defaults keep the Helm deployment close to the existing Docker Compose
107+
service:
108+
109+
- single replica
110+
- embedded SQLite
111+
- bundled PostgreSQL/Valkey disabled
112+
- ClusterIP services on ports `3000` and `2222`
113+
- direct HTTPS inside the Gitea pod using the shared root CA
114+
115+
Before install, create:
116+
117+
- `gitea-root-ca` Secret with `root-ca.pem` and `root-ca.key` from `security/certificates/root/`
118+
- optionally `gitea-admin-credentials` with `username` and `password` if you want Helm to bootstrap an admin user
119+
85120
## 🧰 Makefile Command Overview
86121

87122
A concise reference for controlling the full CogStack deployment stack (NiFi, Elasticsearch, JupyterHub, MedCAT, OCR-service, GitEA, Beats, DB, etc.).

0 commit comments

Comments
 (0)