From 6fd0c2f749a8e7b33f0d581c0f3af7e66312d33b Mon Sep 17 00:00:00 2001 From: sHa Date: Fri, 10 Apr 2026 21:26:21 +0300 Subject: [PATCH] chore: Add Gitea Mirror Helm chart with deployment, service, ingress, PVC, and values files --- gitea-mirror/Chart.yaml | 9 ++++ gitea-mirror/templates/deployment.yaml | 71 ++++++++++++++++++++++++++ gitea-mirror/templates/ingress.yaml | 27 ++++++++++ gitea-mirror/templates/pvc.yaml | 13 +++++ gitea-mirror/templates/service.yaml | 16 ++++++ gitea-mirror/values.yaml | 38 ++++++++++++++ 6 files changed, 174 insertions(+) create mode 100644 gitea-mirror/Chart.yaml create mode 100644 gitea-mirror/templates/deployment.yaml create mode 100644 gitea-mirror/templates/ingress.yaml create mode 100644 gitea-mirror/templates/pvc.yaml create mode 100644 gitea-mirror/templates/service.yaml create mode 100644 gitea-mirror/values.yaml diff --git a/gitea-mirror/Chart.yaml b/gitea-mirror/Chart.yaml new file mode 100644 index 0000000..db90a69 --- /dev/null +++ b/gitea-mirror/Chart.yaml @@ -0,0 +1,9 @@ +apiVersion: v2 +name: gitea-mirror +description: Gitea Mirror Helm chart +type: application +version: 0.1.0 +appVersion: "3.12.5" +annotations: + version-source: github-release:RayLabsHQ/gitea-mirror + version-pattern: "s|^v||" diff --git a/gitea-mirror/templates/deployment.yaml b/gitea-mirror/templates/deployment.yaml new file mode 100644 index 0000000..eef0ed0 --- /dev/null +++ b/gitea-mirror/templates/deployment.yaml @@ -0,0 +1,71 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }} + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} + app.kubernetes.io/component: mirror + annotations: + version-source: {{ index .Chart.Annotations "version-source" }} + version-pattern: {{ index .Chart.Annotations "version-pattern" | quote }} +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }} + spec: + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:v{{ .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - containerPort: {{ .Values.port }} + name: http + protocol: TCP + env: + - name: PORT + value: {{ .Values.port | quote }} + {{- range $key, $value := .Values.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + {{- range .Values.secretEnvKeys }} + - name: {{ .envName }} + valueFrom: + secretKeyRef: + name: {{ $.Values.existingSecret }} + key: {{ .secretKey }} + {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + - name: data + mountPath: /app/data + livenessProbe: + httpGet: + path: /api/health + port: http + initialDelaySeconds: 30 + periodSeconds: 30 + timeoutSeconds: 5 + failureThreshold: 3 + readinessProbe: + httpGet: + path: /api/health + port: http + initialDelaySeconds: 10 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 3 + volumes: + - name: data + persistentVolumeClaim: + claimName: {{ .Release.Name }}-data diff --git a/gitea-mirror/templates/ingress.yaml b/gitea-mirror/templates/ingress.yaml new file mode 100644 index 0000000..6a80701 --- /dev/null +++ b/gitea-mirror/templates/ingress.yaml @@ -0,0 +1,27 @@ +{{- range $name, $config := .Values.ingresses }} +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ $.Release.Name }}-{{ $name }} + {{- with $config.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + rules: + - host: {{ $config.host }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ $.Release.Name }} + port: + number: {{ $.Values.port }} + {{- with $config.tls }} + tls: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/gitea-mirror/templates/pvc.yaml b/gitea-mirror/templates/pvc.yaml new file mode 100644 index 0000000..5cdf35f --- /dev/null +++ b/gitea-mirror/templates/pvc.yaml @@ -0,0 +1,13 @@ +{{- if .Values.persistence.enabled }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-data +spec: + accessModes: + - ReadWriteOnce + storageClassName: {{ .Values.persistence.storageClass }} + resources: + requests: + storage: {{ .Values.persistence.size }} +{{- end }} diff --git a/gitea-mirror/templates/service.yaml b/gitea-mirror/templates/service.yaml new file mode 100644 index 0000000..cff6060 --- /dev/null +++ b/gitea-mirror/templates/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }} + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} +spec: + type: ClusterIP + selector: + app: {{ .Release.Name }} + ports: + - name: http + port: {{ .Values.port }} + targetPort: http + protocol: TCP diff --git a/gitea-mirror/values.yaml b/gitea-mirror/values.yaml new file mode 100644 index 0000000..a68039c --- /dev/null +++ b/gitea-mirror/values.yaml @@ -0,0 +1,38 @@ +# Default values for Gitea Mirror Helm Chart +image: + repository: ghcr.io/raylabshq/gitea-mirror + pullPolicy: IfNotPresent + +port: 4321 + +env: + NODE_ENV: "production" + HOST: "0.0.0.0" + DATABASE_URL: "file:data/gitea-mirror.db" + ALLOW_REGISTRATION: "true" + +existingSecret: "" +secretEnvKeys: [] + # - envName: BETTER_AUTH_SECRET + # secretKey: BETTER_AUTH_SECRET + +resources: + requests: + cpu: "100m" + memory: "256Mi" + limits: + cpu: "1" + memory: "1Gi" + +persistence: + enabled: true + storageClass: local-path + size: 5Gi + +ingresses: {} + # https: + # host: mirror.example.com + # annotations: {} + # tls: + # - hosts: + # - mirror.example.com