I am trying to install gitea on kubernetes, using a separate(external) mariadb database.
This is the config I use for the helm chart:
# Default values for gitea.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
clusterDomain: cluster.local
securityContext:
capabilities:
add: ["SYS_CHROOT"]
image:
repository: gitea/gitea
tag: 1.14.2
pullPolicy: Always
rootless: false # only possible when running 1.14 or later
service:
http:
annotations:
metallb.universe.tf/allow-shared-ip: gitea
type: LoadBalancer
loadBalancerIP: 192.168.80.2
externalTrafficPolicy: Local
port: 80
ssh:
annotations:
metallb.universe.tf/allow-shared-ip: gitea
type: LoadBalancer
loadBalancerIP: 192.168.80.2
externalTrafficPolicy: Local
persistence:
enabled: true
gitea:
admin:
username: gitea_admin
password: ********
email: "gitea@local.domain"
database:
builtIn:
postgresql:
enabled: false
cache:
builtIn:
enabled: false
config:
server:
DOMAIN: git.kri.st
HTTP_PORT: 3000
database:
DB_TYPE: mysql
HOST: mariadb.mariadb.svc.cluster.local:3306
NAME: gitea
USER: gitea
PASSWD: ********
cache:
ENABLED: true
ADAPTER: memory
INTERVAL: 60
HOST: memcached-helm-memcached.memcached.svc.cluster.local:11211
This led to the init container getting in a CrashLoop. To debug this I generate the amnifest from the helm chart, modified the init container to go in to pause, and applied the manifest manually.
That allowed me to exec in to the init container, and run the setup script by hand.
This is part what I saw:
+ gitea migrate
2021/05/25 05:01:46 ...dules/setting/git.go:101:newGit() [I] Git Version: 2.30.2, Wire Protocol Version 2 Enabled
2021/05/25 05:01:46 cmd/migrate.go:31:runMigrate() [T] AppPath: /usr/local/bin/gitea
2021/05/25 05:01:46 cmd/migrate.go:32:runMigrate() [T] AppWorkPath: /data
2021/05/25 05:01:46 cmd/migrate.go:33:runMigrate() [T] Custom path: /data/gitea
2021/05/25 05:01:46 cmd/migrate.go:34:runMigrate() [T] Log path: /data/log
2021/05/25 05:01:46 ...om/urfave/cli/app.go:277:Run() [I] PING DATABASE mysql
2021/05/25 05:01:46 cmd/migrate.go:38:runMigrate() [F] Failed to initialize ORM engine: commands out of sync. Did you run multiple statements at once?
I noticed that nothing is created in my mariadb instance. So it appears that somehow “gitea migrate” is failing to creating the database initial layout… Why ?