Need example using sqlite with chart. #388

Closed
opened 2022-12-28 22:11:33 +00:00 by reefland · 4 comments

The chart documentation doesn't even contain the word sqlite. Hopefully someone can point me in the right direction.

I've dug into previous issues such as #95 and #124 trying to get something working.

I've not been able to get the init container passed this:

2022/12/28 19:33:45 ...e/cli@v1.22.9/app.go:277:Run() [I] PING DATABASE postgres 2 2022/12/28 19:33:45 cmd/migrate.go:41:runMigrate() [F] Failed to initialize ORM engine: dial tcp: lookup gitea-postgresql.gitea.svc.cluster.local: no such host 

My values yaml:

 image: repository: gitea/gitea pullPolicy: IfNotPresent rootless: true podSecurityContext: fsGroup: 1000 containerSecurityContext: allowPrivilegeEscalation: false capabilities: drop: - ALL privileged: false readOnlyRootFilesystem: true runAsGroup: 1000 runAsNonRoot: true runAsUser: 1000 service: http: type: ClusterIP port: 3000 clusterIP: None ssh: type: ClusterIP port: 22 clusterIP: None ingress: {} statefulset: terminationGracePeriodSeconds: 60 labels: {} annotations: {} persistence: enabled: true size: 5Gi accessModes: - ReadWriteOnce labels: {} annotations: {} signing: enabled: false gpgHome: /data/git/.gnupg gitea: admin: existingSecret: gitea-admin-secret metrics: enabled: false serviceMonitor: enabled: false config: APP_NAME: "Gitea: Git with a cup of tea" RUN_MODE: prod ## Use internal sqlite3 database database: DB_TYPE: sqlite3 ## Note that the intit script checks to see if the IP & port of the database service is accessible ## so make sure you set those to something that resolves as successful ## (since sqlite uses files on disk setting the port & ip won't affect the running of gitea) HOST: example.com:80 additionalConfigFromEnvs: [] podAnnotations: {} # Modify the liveness probe for your needs or completely disable it by commenting out. livenessProbe: tcpSocket: port: http initialDelaySeconds: 200 timeoutSeconds: 1 periodSeconds: 10 successThreshold: 1 failureThreshold: 10 # Modify the readiness probe for your needs or completely disable it by commenting out. readinessProbe: tcpSocket: port: http initialDelaySeconds: 5 timeoutSeconds: 1 periodSeconds: 10 successThreshold: 1 failureThreshold: 3 memcached: enabled: false service: port: 11211 postgresql: enabled: false mysql: enabled: false # Set it to false to skip this basic validation check. checkDeprecation: true 
The chart [documentation](https://gitea.com/gitea/helm-chart) doesn't even contain the word `sqlite`. Hopefully someone can point me in the right direction. I've dug into previous issues such as #95 and #124 trying to get something working. I've not been able to get the init container passed this: ``` 2022/12/28 19:33:45 ...e/cli@v1.22.9/app.go:277:Run() [I] PING DATABASE postgres 2 2022/12/28 19:33:45 cmd/migrate.go:41:runMigrate() [F] Failed to initialize ORM engine: dial tcp: lookup gitea-postgresql.gitea.svc.cluster.local: no such host ``` My values yaml: ``` image: repository: gitea/gitea pullPolicy: IfNotPresent rootless: true podSecurityContext: fsGroup: 1000 containerSecurityContext: allowPrivilegeEscalation: false capabilities: drop: - ALL privileged: false readOnlyRootFilesystem: true runAsGroup: 1000 runAsNonRoot: true runAsUser: 1000 service: http: type: ClusterIP port: 3000 clusterIP: None ssh: type: ClusterIP port: 22 clusterIP: None ingress: {} statefulset: terminationGracePeriodSeconds: 60 labels: {} annotations: {} persistence: enabled: true size: 5Gi accessModes: - ReadWriteOnce labels: {} annotations: {} signing: enabled: false gpgHome: /data/git/.gnupg gitea: admin: existingSecret: gitea-admin-secret metrics: enabled: false serviceMonitor: enabled: false config: APP_NAME: "Gitea: Git with a cup of tea" RUN_MODE: prod ## Use internal sqlite3 database database: DB_TYPE: sqlite3 ## Note that the intit script checks to see if the IP & port of the database service is accessible ## so make sure you set those to something that resolves as successful ## (since sqlite uses files on disk setting the port & ip won't affect the running of gitea) HOST: example.com:80 additionalConfigFromEnvs: [] podAnnotations: {} # Modify the liveness probe for your needs or completely disable it by commenting out. livenessProbe: tcpSocket: port: http initialDelaySeconds: 200 timeoutSeconds: 1 periodSeconds: 10 successThreshold: 1 failureThreshold: 10 # Modify the readiness probe for your needs or completely disable it by commenting out. readinessProbe: tcpSocket: port: http initialDelaySeconds: 5 timeoutSeconds: 1 periodSeconds: 10 successThreshold: 1 failureThreshold: 3 memcached: enabled: false service: port: 11211 postgresql: enabled: false mysql: enabled: false # Set it to false to skip this basic validation check. checkDeprecation: true ```
Collaborator

The helm chart runs by default with postgres. What is your motivation for sqlite here? sqlite does not work AFAIK when using multiple replicas (which is not fully supported anyhow right now).

For a dev deployment you can just use the default chart config.
For a prod deployment you are most often better off using an external postgres DB (for backups etc.).

The helm chart runs by default with postgres. What is your motivation for sqlite here? sqlite does not work AFAIK when using multiple replicas (which is not fully supported anyhow right now). For a dev deployment you can just use the default chart config. For a prod deployment you are most often better off using an external postgres DB (for backups etc.).
Author

Thanks for the response. I took a closer look at the Helm chart and it looks like the previous support added (that I referenced above) has since been removed. However, when you scroll through the Chart history there is nothing about Sqlite support being removed.

I use Gitea for work at home development / homelab kubernetes / GitOps workflows. I have about a dozen repositories with about 2,000 commits so far. Some repositories are push replicated to GitHub.

My SQlite3 database is 1.6MB and under 50MB of disk space consumed of a 5Gib ceph-block PVC. Even the default chart with its database is just beyond overkill (but appreciated for when its needed).

If anyone else is looking for just Sqlite3 support, I put together a Kustomize and an optional ArgoCD Application Deployment wrapper for Gitea:

https://github.com/reefland/ansible-k3s-argocd-renovate/tree/master/_extra_apps/gitea-argocd-kustomize

Just the basics:

  • Rootless container
  • Init Container for Initial app.ini placement
  • PVC
  • StatefulSet
  • SVC & Ingress for HTTP
  • SVC & optional LoadBalancer for SSH
  • Patches section to customize the above

Thanks again. Closing issue.

Thanks for the response. I took a closer look at the Helm chart and it looks like the previous support added (that I referenced above) has since been removed. However, when you scroll through the Chart history there is nothing about Sqlite support being removed. I use Gitea for work at home development / homelab kubernetes / GitOps workflows. I have about a dozen repositories with about 2,000 commits so far. Some repositories are push replicated to GitHub. My SQlite3 database is 1.6MB and under 50MB of disk space consumed of a 5Gib ceph-block PVC. Even the default chart with its database is just beyond overkill (but appreciated for when its needed). If anyone else is looking for just Sqlite3 support, I put together a Kustomize and an optional ArgoCD Application Deployment wrapper for Gitea: <https://github.com/reefland/ansible-k3s-argocd-renovate/tree/master/_extra_apps/gitea-argocd-kustomize> Just the basics: * Rootless container * Init Container for Initial app.ini placement * PVC * StatefulSet * SVC & Ingress for HTTP * SVC & optional LoadBalancer for SSH * Patches section to customize the above Thanks again. Closing issue.
Collaborator

Thanks for the response. I took a closer look at the Helm chart and it looks like the previous support added (that I referenced above) has since been removed. However, when you scroll through the Chart history there is nothing about Sqlite support being removed.

I can't comment on that since I haven't been contributing at this point in time.

I use Gitea for work at home development / homelab kubernetes / GitOps workflows. I have about a dozen repositories with about 2,000 commits so far. Some repositories are push replicated to GitHub.

In DB standards, this is "tiny". It's not about "overkill" here but about avoiding a potential migration once the DB grows larger.

May I ask what your primary motivation wanting to use sqlite instead of the preconfigured postgres? Postgres does not need that much more memory and if you're on k8s you should have more than one node available anyway.

Especially k8s installs are often used in PROD with a much higher workload. Sqlite is the default when running Gitea in plain docker.

> Thanks for the response. I took a closer look at the Helm chart and it looks like the previous support added (that I referenced above) has since been removed. However, when you scroll through the Chart history there is nothing about Sqlite support being removed. I can't comment on that since I haven't been contributing at this point in time. > I use Gitea for work at home development / homelab kubernetes / GitOps workflows. I have about a dozen repositories with about 2,000 commits so far. Some repositories are push replicated to GitHub. In DB standards, this is "tiny". It's not about "overkill" here but about avoiding a potential migration once the DB grows larger. May I ask what your primary motivation wanting to use sqlite instead of the preconfigured postgres? Postgres does not need that much more memory and if you're on k8s you should have more than one node available anyway. Especially k8s installs are often used in PROD with a much higher workload. Sqlite is the default when running Gitea in plain docker.
Author

May I ask what your primary motivation wanting to use sqlite instead of the preconfigured postgres?

I'm using Kubernetes 1.25 on the pinned version of PostGres in the Gitea Helm Chart is not supported on this version.

Postgres does not need that much more memory and if you're on k8s you should have more than one node available anyway.

I looked at suggested resources of doing my own external database install and they suggested 10G of disk and think something like 1 gig of RAM as an initial install.

It's not a lot, the added resources and complexity is just not needed for my use case. I had no problem with Gitea / SQLlite3 that needed to be solved by adding Postgres.

Especially k8s installs are often used in PROD with a much higher workload. Sqlite is the default when running Gitea in plain docker.

I've been using it under docker for many years, it has served me very well. Now it is migrated to Kubernetes and still working great.

BTW - There pretty much was no decent Grafana dashboards for Gitea. I made one and tossed it up of Grafana's web site:

https://grafana.com/grafana/dashboards/17802-gitea-server-monitor/

Gitea Dashboard

> May I ask what your primary motivation wanting to use sqlite instead of the preconfigured postgres? I'm using Kubernetes 1.25 on the pinned version of PostGres in the Gitea Helm Chart is not supported on this version. >Postgres does not need that much more memory and if you're on k8s you should have more than one node available anyway. I looked at suggested resources of doing my own external database install and they suggested 10G of disk and think something like 1 gig of RAM as an initial install. It's not a lot, the added resources and complexity is just not needed for my use case. I had no problem with Gitea / SQLlite3 that needed to be solved by adding Postgres. > Especially k8s installs are often used in PROD with a much higher workload. Sqlite is the default when running Gitea in plain docker. I've been using it under docker for many years, it has served me very well. Now it is migrated to Kubernetes and still working great. BTW - There pretty much was no decent Grafana dashboards for Gitea. I made one and tossed it up of Grafana's web site: <https://grafana.com/grafana/dashboards/17802-gitea-server-monitor/> ![Gitea Dashboard](https://grafana.com/api/dashboards/17802/images/13639/image)
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gitea/helm-gitea#388
No description provided.