Files
herolib/lib/installers/k8s/gitea/templates/gitea.yaml
Mahmoud-Emad 472e4bfaaa feat: Add Gitea Kubernetes installer
- Add Gitea installer module and types
- Implement installation and destruction logic
- Integrate with Kubernetes and TFGW
- Add example usage and documentation
2025-11-03 16:25:21 +02:00

98 lines
2.5 KiB
YAML

apiVersion: v1
kind: Namespace
metadata:
name: @{config_values.namespace}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: gitea-data
namespace: @{config_values.namespace}
spec:
accessModes: [ "ReadWriteOnce" ]
resources: { requests: { storage: @{config_values.storage_size} } }
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: gitea
namespace: @{config_values.namespace}
spec:
replicas: 1
selector:
matchLabels: { app: gitea }
template:
metadata:
labels: { app: gitea }
spec:
securityContext:
fsGroup: 1000
containers:
- name: gitea
image: gitea/gitea:1.22-rootless
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: @{config_values.http_port}
env:
- name: GITEA__server__ROOT_URL
value: "@{config_values.root_url}"
- name: GITEA__server__PROTOCOL
value: "http"
- name: GITEA__server__HTTP_PORT
value: "@{config_values.http_port}"
- name: GITEA__server__DOMAIN
value: "@{config_values.domain}"
- name: GITEA__server__START_SSH_SERVER
value: "false"
- name: GITEA__database__DB_TYPE
value: "@{config_values.db_type}"
- name: GITEA__database__PATH
value: "@{config_values.db_path}"
- name: GITEA__service__DISABLE_REGISTRATION
value: "@{config_values.disable_registration}"
volumeMounts:
- name: data
mountPath: /data
readinessProbe:
httpGet: { path: /, port: @{config_values.http_port} }
initialDelaySeconds: 20
periodSeconds: 10
volumes:
- name: data
persistentVolumeClaim:
claimName: gitea-data
---
apiVersion: v1
kind: Service
metadata:
name: gitea
namespace: @{config_values.namespace}
spec:
selector: { app: gitea }
ports:
- name: http
port: @{config_values.http_port}
targetPort: @{config_values.http_port}
type: ClusterIP
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: gitea
namespace: @{config_values.namespace}
spec:
ingressClassName: traefik
rules:
- host: @{config_values.domain}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: gitea
port:
number: @{config_values.http_port}