Gitea installation against an external database without redis-cluster #515

Closed
opened 2023-09-21 17:03:53 +00:00 by Ceddaerrix · 1 comment
Ceddaerrix commented 2023-09-21 17:03:53 +00:00 (Migrated from gitea.com)

Using the Gitea helm chart v9.4.0 (with gitea v1.20.4), the default values have been overridden with:

image:
  rootless: true
  pullPolicy: IfNotPresent
securityContext:
  readOnlyRootFilesystem: true
  runAsGroup: 1000
  runAsNonRoot: true
  runAsUser: 1000
imagePullSecrets:
  - name: regsecret
persistence:
  storageClass: 'local-path'
ingress:
  enabled: true
  className: nginx
  annotations:
      nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
      nginx.ingress.kubernetes.io/proxy-body-size: "0"
      nginx.ingress.kubernetes.io/annotation-value-word-blocklist: "load_module,lua_package,_by_lua,location,root,proxy_pass,serviceaccount,{,},',\""
  hosts:
    - host: 'gitea.example.com'
      paths:
        - path: /
          pathType: Prefix
  tls:
    - secretName: gitea-tls
      hosts:
        - 'gitea.example.com'
redis-cluster:
  enabled: false
postgresql:
  enabled: false
postgresql-ha:
  enabled: false
gitea:
  admin:
    username: <some-user>
    password: <some-pwd>
  config:
    database:
      DB_TYPE: postgres
      HOST: <my-cluster-db-svc>:5432
      NAME: postgres
      USER: postgres
      PASSWD: <some-pwd>
      SSL_MODE: require
  session:
    PROVIDER: db
  cache:
    ADAPTER: memory
  queue:
    TYPE: channel

The requirement is to install Gitea with an external postgres database but without a redis-cluster (hence, redis-cluster.enabled: false).

Nevertheless, the gitea pod runs with a warning (from Lens UI)...
From the gitea container logs, the following error appears:

2023/09/21 17:28:53 ...s/graceful/server.go:62:NewServer() [I] Starting new SSH server: tcp::2222 on PID: 7
2023/09/21 17:28:53 ...eful/manager_unix.go:208:handleSignals() [W] PID: 7. Background context for manager closed - context canceled - Shutting down...
2023/09/21 17:28:53 cmd/web.go:212:func1() [F] PANIC: dial tcp 127.0.0.1:6379: connect: connection refused
/go/pkg/mod/gitea.com/go-chi/session@v0.0.0-20230415140235-3182bcc14852/session.go:239 (0x17105ad)

It seems that the gitea container from the pod tries to connect to a redis instance in the pod...

Shall other variables be overridden to be able to such set-up functional?

Using the Gitea helm chart v9.4.0 (with gitea v1.20.4), the default values have been overridden with: ``` image: rootless: true pullPolicy: IfNotPresent securityContext: readOnlyRootFilesystem: true runAsGroup: 1000 runAsNonRoot: true runAsUser: 1000 imagePullSecrets: - name: regsecret persistence: storageClass: 'local-path' ingress: enabled: true className: nginx annotations: nginx.ingress.kubernetes.io/force-ssl-redirect: "true" nginx.ingress.kubernetes.io/proxy-body-size: "0" nginx.ingress.kubernetes.io/annotation-value-word-blocklist: "load_module,lua_package,_by_lua,location,root,proxy_pass,serviceaccount,{,},',\"" hosts: - host: 'gitea.example.com' paths: - path: / pathType: Prefix tls: - secretName: gitea-tls hosts: - 'gitea.example.com' redis-cluster: enabled: false postgresql: enabled: false postgresql-ha: enabled: false gitea: admin: username: <some-user> password: <some-pwd> config: database: DB_TYPE: postgres HOST: <my-cluster-db-svc>:5432 NAME: postgres USER: postgres PASSWD: <some-pwd> SSL_MODE: require session: PROVIDER: db cache: ADAPTER: memory queue: TYPE: channel ``` The requirement is to install Gitea with an external postgres database but without a redis-cluster (hence, _redis-cluster.enabled: false_). Nevertheless, the gitea pod runs with a warning (from Lens UI)... From the gitea container logs, the following error appears: > 2023/09/21 17:28:53 ...s/graceful/server.go:62:NewServer() [I] Starting new SSH server: tcp::2222 on PID: 7 > 2023/09/21 17:28:53 ...eful/manager_unix.go:208:handleSignals() [W] PID: 7. Background context for manager closed - context canceled - Shutting down... > 2023/09/21 17:28:53 cmd/web.go:212:func1() [F] PANIC: dial tcp 127.0.0.1:6379: connect: connection refused > /go/pkg/mod/gitea.com/go-chi/session@v0.0.0-20230415140235-3182bcc14852/session.go:239 (0x17105ad) It seems that the _gitea_ container from the pod tries to connect to a redis instance in the pod... Shall other variables be overridden to be able to such set-up functional?
Ceddaerrix commented 2023-09-22 07:41:15 +00:00 (Migrated from gitea.com)

Issue solved: It was an indentation issue.
Session, cache and queue were not under gitea.config as follow:

gitea:
  admin:
    username: <some-user>
    password: <some-pwd>
  config:
    database:
      DB_TYPE: postgres
      HOST: <my-cluster-db-svc>:5432
      NAME: postgres
      USER: postgres
      PASSWD: <some-pwd>
      SSL_MODE: require
    session:
      PROVIDER: memory
    cache:
      ADAPTER: memory
    queue:
    TYPE: channel
**Issue solved**: It was an indentation issue. _Session_, _cache_ and _queue_ were not under _gitea.config_ as follow: ``` gitea: admin: username: <some-user> password: <some-pwd> config: database: DB_TYPE: postgres HOST: <my-cluster-db-svc>:5432 NAME: postgres USER: postgres PASSWD: <some-pwd> SSL_MODE: require session: PROVIDER: memory cache: ADAPTER: memory queue: TYPE: channel ```
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lunny/helm-chart#515
No description provided.