Commit graph

238 commits

Author SHA1 Message Date
Michael Kriese
c2e51defc0 fix(deps): update helm release memcached to v6.5.8 2023-08-18 00:07:22 +00:00
Michael Kriese
f1ce20e593 fix(deps): update helm release memcached to v6.5.7 2023-08-17 00:08:54 +00:00
Michael Kriese
19d4916943 fix(deps): update helm release postgresql to v12.7.1 (#169)
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-on: https://codeberg.org/forgejo-contrib/forgejo-helm/pulls/169
2023-07-27 06:16:19 +00:00
Michael Kriese
fd2810afab fix(deps): update helm release memcached to v6.5.6 2023-07-27 00:12:36 +00:00
Michael Kriese
e172610698 fix(deps): update helm release postgresql to v12.6.9 2023-07-25 00:07:46 +00:00
Michael Kriese
5b7cf738f4 fix(deps): update helm release postgresql to v12.6.8 (#164)
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-on: https://codeberg.org/forgejo-contrib/forgejo-helm/pulls/164
2023-07-21 06:37:27 +00:00
Michael Kriese
57d4de9535 fix(deps): update helm release postgresql to v12.6.7 2023-07-20 00:07:28 +00:00
pat-s
ede76d4b68
update helm deps and add makefile rule 2023-07-17 21:26:45 +02:00
pat-s
8e27bb9bae [Breaking] Add HA-support; switch to Deployment (#437)
# Changes

A big shoutout to @luhahn for all his work in #205 which served as the base for this PR.

## Documentation

- [x] After thinking for some time about it, I still prefer the distinct option (as started in #350), i.e. having a standalone "HA" doc under `docs/ha-setup.md` to not have a very long README (which is already quite long).
      Most of the information below should go into it with more details and explanations behind all of the individual components.

## Chart deps

~~- Adds `meilisearch` as a chart dependency for a HA-ready issue indexer. Only works with >= Gitea 1.20~~
~~- Adds `redis` as a chart dependency for a HA-ready session and queue store.~~
- Adds `redis-cluster` as a chart dependency for a HA-ready session and queue store (alternative to `redis`). Only works with >= Gitea 1.19.2.
- Removes `memcached` instead of `redis-cluster`
- Add `postgresql-ha` as default DB dep in favor of `postgres`

## Adds smart HA chart logic

The goal is to set smart config values that result in a HA-ready Gitea deployment if `replicaCount` > 1.

- If `replicaCount` > 1,
  - `gitea.config.session.PROVIDER` is automatically set to `redis-cluster`
  - `gitea.config.indexer.REPO_INDEXER_ENABLED` is automatically set to `false` unless the value is `elasticsearch` or `meilisearch`
  - `redis-cluster` is used for `[queue]` and `[cache]` and `[session]`mode or not

Configuration of external instances of `meilisearch` and `minio` are documented in a new markdown doc.

## Deployment vs Statefulset

Given all the discussions about this lately (#428), I think we could use both.
In the end, we do not have the requirement for a sequential pod scale up/scale down as it would happen in statefulsets.
On the other side, we do not have actual stateless pods as we are attaching a RWX to the deployment.
Yet I think because we do not have a leader-election requirement, spawning the pods as a deployment makes "Rolling Updates" easier and also signals users that there is no "leader election" logic and each pod can just be "destroyed" at anytime without causing interruption.

Hence I think we should be able to switch from a statefulset to a deployment, even in the single-replica case.

This change also brought up a templating/linting issue: the definition of `.Values.gitea.config.server.SSH_LISTEN_PORT` in `ssh-svc.yaml` just "luckily" worked so far due to naming-related lint processing. Due to the change from "statefulset" to "deployment", the processing queue changed and caused a failure complaining about `config.server.SSH_LISTEN_PORT` not being defined yet.
The only way I could see to fix this was to "properly" define the value in `values.yaml` instead of conditionally definining it in `helpers.tpl`. Maybe there's a better way?

## Chart PVC Creation

I've adapted the automated PVC creation from another chart to be able to provide the `storageClassName` as I couldn't get dynamic provisioning for EFS going with the current implementation.
In addition the naming and approach within the Gitea chart for PV creation is a bit unusual and aligning it might be beneficial.

A semi-unrelated change which will result in a breaking change for existing users but this PR includes a lot of breaking changes already, so including another one might not make it much worse...

- New `persistence.mount`: whether to mount an existing PVC (via `persistence.existingClaim`
- New `persistence.create`: whether to create a new PVC

## Testing

As this PR does a lot of things, we need proper testing.
The helm chart can be installed from the Git branch via `helm-git` as follows:

```
helm repo add gitea-charts git+https://gitea.com/gitea/helm-chart@/?ref=deployment
helm install gitea --version 0.0.0
```
It is **highly recommended** to test the chart in a dedicated namespace.

I've tested this myself with both `redis` and `redis-cluster` and it seemed to work fine.
I just did some basic operations though and we should do more niche testing before merging.

Examplary `values.yml` for testing (only needs a valid RWX storage class):

<details>

<summary>values.yaml</summary>

```yml
image:
  tag: "dev"
  PullPolicy: "Always"
  rootless: true

replicaCount: 2

persistence:
  enabled: true
  accessModes:
    - ReadWriteMany
  storageClass: FIXME

redis-cluster:
  enabled: false
  global:
    redis:
      password: gitea

gitea:
  config:
    indexer:
      ISSUE_INDEXER_ENABLED: true
      REPO_INDEXER_ENABLED: false
```
</details>

## Preferred setup

The preferred HA setup with respect to performance and stability might currently be as follows:

- Repos: RWX (e.g. EFS or Azurefiles NFS)
- Issue indexer: Meilisearch (HA)
- Session and cache: Redis Cluster (HA)
- Attachments/Avatars: Minio (HA)

This will result in a ~ 10-pod HA setup overall.
All pods have very low resource requests.

fix #98

Co-authored-by: pat-s <pat-s@noreply.gitea.io>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/437
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2023-07-17 19:09:42 +00:00
Michael Kriese
f9bfe6b22d fix(deps): update helm release postgresql to v12.6.6 2023-07-17 00:07:35 +00:00
Michael Kriese
f105e0b8a6 fix(deps): update helm release memcached to v6.5.5 2023-07-16 00:07:17 +00:00
Michael Kriese
9febe33951 fix(deps): update helm release postgresql to v12.6.0 (#157)
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-on: https://codeberg.org/forgejo-contrib/forgejo-helm/pulls/157
2023-07-03 13:01:28 +00:00
Michael Kriese
459375b870 fix(deps): update helm release memcached to v6.5.4 2023-06-28 00:07:06 +00:00
Michael Kriese
b9079ceda6 fix(deps): update helm release postgresql to v12.5.8 2023-06-20 00:07:05 +00:00
Michael Kriese
843a790239 fix(deps): update helm release memcached to v6.5.3 2023-06-17 00:07:06 +00:00
Michael Kriese
cf27151e1a fix(deps): update helm release postgresql to v12.5.7 2023-06-13 00:06:04 +00:00
Michael Kriese
683aae50a5 fix(deps): update helm release postgresql to v12.5.6 2023-05-31 00:07:12 +00:00
Michael Kriese
ceb78bbf3d fix(deps): update helm release postgresql to v12.5.5 2023-05-24 00:07:06 +00:00
Michael Kriese
e2b926153e fix(deps): update helm release postgresql to v12.5.4 2023-05-23 00:07:11 +00:00
Michael Kriese
fc8edfc4eb fix(deps): update helm release memcached to v6.5.2 2023-05-22 00:07:21 +00:00
Michael Kriese
549cba59a6 fix(deps): update helm release postgresql to v12.5.2 2023-05-17 00:14:43 +00:00
Michael Kriese
57a5171970 fix(deps): update helm release postgresql to v12.5.1 (#139)
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-on: https://codeberg.org/forgejo-contrib/forgejo-helm/pulls/139
2023-05-16 04:30:21 +00:00
Michael Kriese
ac6f84079e fix(deps): update helm release memcached to v6.5.1 (#140)
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-on: https://codeberg.org/forgejo-contrib/forgejo-helm/pulls/140
2023-05-16 04:26:23 +00:00
Michael Kriese
742a21b55e fix(deps): update helm release postgresql to v12.4.3 2023-05-10 06:03:36 +00:00
Michael Kriese
6cdddc6414 fix(deps): update helm release memcached to v6.4.2 2023-05-10 00:07:04 +00:00
Michael Kriese
39778770d3 fix(deps): update helm release memcached to v6.4.1 (#131)
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-on: https://codeberg.org/forgejo-contrib/forgejo-helm/pulls/131
2023-05-02 09:32:58 +00:00
pat-s
5876a9e7fc Update Gitea to 1.19.2 and bump chart deps (#442)
No substantial changes in chart deps.

Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/442
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.io>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2023-04-30 11:05:33 +08:00
Michael Kriese
4416cc666b fix(deps): update helm release postgresql to v12.4.2 2023-04-30 00:07:12 +00:00
Michael Kriese
f6465619c0 fix(deps): update helm release postgresql to v12.4.1 (#127)
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-on: https://codeberg.org/forgejo-contrib/forgejo-helm/pulls/127
2023-04-28 10:44:11 +00:00
Michael Kriese
43a9b4a677 fix(deps): update helm release postgresql to v12.2.8 2023-04-17 09:42:30 +00:00
Michael Kriese
00c8377d5b
feat!: add gitea chart v8 changes
BREAKING CHANGE: MySQL and MariaDB subcharts are removed.
2023-04-04 17:00:16 +02:00
Michael Kriese
57bbebe3b6 fix(deps): update helm release postgresql to v12.2.7 2023-04-04 00:07:06 +00:00
Michael Kriese
727f0592f9 fix(deps): update helm release mysql to v9.7.1 2023-04-03 06:51:44 +00:00
Michael Kriese
730c4b179a fix(deps): update helm release memcached to v6.3.14 2023-04-03 00:07:06 +00:00
Michael Kriese
92e10d10c0 fix(deps): update helm release mariadb to v11.5.6 2023-04-02 00:07:06 +00:00
pat-s
25500d7ca2 Ignore Chart.lock for formatters/linters (#424)
This might hopefully help with the formatting issues around `Chart.lock`.

Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/424
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2023-04-01 19:18:17 +08:00
Michael Kriese
ee1a9fc2ee fix(deps): update helm release mysql to v9.7.0 (#114)
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-on: https://codeberg.org/forgejo-contrib/forgejo-helm/pulls/114
2023-03-30 04:45:31 +00:00
pat-s
87c59b2fca Format all files with prettier VSCode plugin and add yamllint in CI (#413)
@justusbunsi to end my formatting mess... ;)

I am not fully sure myself about the linebreaks in `values.yaml` but I don't think there's an easy way to change that behavior.

Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/413
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2023-03-29 05:18:23 +08:00
pat-s
a0ba3c9bef Bump memcached to add arm64 support (#422)
And allow overriding the `image` section so users could possible also use other image tags.

fix #285

Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/422
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2023-03-29 05:11:33 +08:00
pat-s
ae9a71ea11 Remove mysql and mariadb chart deps (#417)
As discussed in Discord.

Supersedes #412 and #407.

**⚠️ BREAKING**

Users depending on the built-in MySQL or MariaDB chart have to switch to an self-managed database, or Postgres

Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/417
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Reviewed-by: John Olheiser <john+gitea@jolheiser.com>
Reviewed-by: yardenshoham <yardenshoham@noreply.gitea.io>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2023-03-29 01:02:04 +08:00
pat-s
5cb0802b7b [Breaking] Bump postgres chart to latest release (#391)
See discussion in #387

Upgrade notes to Chart v11.x and Postgres 14.x: https://docs.bitnami.com/kubernetes/infrastructure/postgresql/administration/upgrade/

The current version in Gitea is using `11.11.0-debian-10-r62` from 2021-04.

Bumping the chart to the latest (v12.x) would use the image `15.2.0-debian-11-r14` which would be a jump from postgres 11 to postgres 15. There are no specific notes for the v12.x chart release, hence we might be able to just go to 12.x directly.

There have been some param renamings which I've reflected in the README.

**⚠️ BREAKING**

Users have to migrate their Postgres DB by e.g. restoring a previously created database dump into a clean installation.

Co-authored-by: justusbunsi <sk.bunsenbrenner@gmail.com>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/391
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.io>
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2023-03-28 01:12:29 +08:00
Michael Kriese
c2cf0a2b47 fix(deps): update mariadb docker tag to v11.5.5 2023-03-24 00:07:11 +00:00
Michael Kriese
3a706fa107 fix(deps): update postgresql docker tag to v12.2.6 2023-03-23 00:07:29 +00:00
Michael Kriese
a2a9ee6430 fix(deps): update mysql docker tag to v9.6.0 (#101)
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-on: https://codeberg.org/forgejo-contrib/forgejo-helm/pulls/101
2023-03-21 11:23:23 +00:00
Michael Kriese
e8fece23dc feat: use binamiy oci charts (#109)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Reviewed-on: https://codeberg.org/forgejo-contrib/forgejo-helm/pulls/109
2023-03-21 10:19:39 +00:00
Michael Kriese
6e6f64f7bf fix(deps): update helm release postgresql to v12.2.5 2023-03-21 00:08:20 +00:00
Michael Kriese
02a17be0db fix(deps): update helm release memcached to v6.3.13 2023-03-20 00:08:29 +00:00
Michael Kriese
6a24d2bea6 fix(deps): update helm release mariadb to v11.5.4 2023-03-19 00:08:20 +00:00
Michael Kriese
261eb46582 fix(deps): update helm release postgresql to v12.2.3 2023-03-16 00:08:13 +00:00
Michael Kriese
5c5b801290 fix(deps): update helm release memcached to v6.3.12 2023-03-15 00:08:34 +00:00