How to run multiple gitea replicas in kubernetes?

238 views Asked by At

I'm trying to run gitea in kubernetes with helm and it works for a single instance, but if I try to set replicaCount to 2, pods won't start.

Error: INSTALLATION FAILED: 
template: gitea/templates/gitea/deployment.yaml:29:28: 
executing "gitea/templates/gitea/deployment.yaml" at <include (print $.Template.BasePath "/gitea/config.yaml") .>: 
error calling include: template: gitea/templates/gitea/config.yaml:28:40: 
executing "gitea/templates/gitea/config.yaml" at <"cron.GIT_GC_REPOS">: wrong type for value; expected map[string]interface {}; got string

Where does it come from? Do I need to change some other settings as well?

my values.yaml

replicaCount: 2

redis-cluster:
  enabled: false
postgresql:
  enabled: false
postgresql-ha:
  enabled: false

persistence:
  enabled: true
  create: false
  mount: true
  claimName: cluster-nfs-pvc
  size: 10Gi
  accessModes:
    - ReadWriteMany
  labels: {}
  storageClass:
  subPath:
  annotations:
    helm.sh/resource-policy: keep

gitea:
  admin:
    existingSecret:
    username: admin
    password: admin
    email: "[email protected]"

  config:
    server:
      DOMAIN: gitea.qtest.example.com
      ROOT_URL: https://gitea.qtest.example.com
      SSH_LISTEN_PORT: 2222
    database:
      DB_TYPE: postgres
      HOST: db.example.com:5432
      NAME: gitea_db
      USER: gitea_user
      PASSWD: xxxxxx
      SCHEMA: public
    session:
      PROVIDER: memory
    cache:
      ADAPTER: memory
    queue:
      TYPE: level

I use nfs share for pv:

pv-pvc.yaml

apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-nfs-cluster
spec:
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  nfs:
    server: nfs.example.com
    path: /nfs/qtest/gitea

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: cluster-nfs-pvc
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: 10Gi
1

There are 1 answers

0
Lugojan Emanuel On

You just need to disable it yourself

gitea:
  config:
    cron.GIT_GC_REPOS:
      ENABLED: false