Skip to content

Commit 5f2cd62

Browse files
Merge pull request #19 Replace SeaweedFS with MinIO
Replace SeaweedFS with MinIO
2 parents 4d420c0 + ec9dfcb commit 5f2cd62

12 files changed

Lines changed: 148 additions & 138 deletions

.github/workflows/helm-chart-release.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ jobs:
3434
- name: add helm repos
3535
run: |
3636
helm repo add bitnami https://charts.bitnami.com/bitnami
37-
helm repo add seaweedfs https://seaweedfs.github.io/seaweedfs/helm
37+
helm repo add minio https://charts.min.io
3838
helm repo update
39+
helm dep up
3940
4041
- name: Run chart-releaser
4142
run: |

.github/workflows/helm-lint-test.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ permissions:
2020
contents: read
2121

2222
jobs:
23-
lint-test:
23+
lint-serverside-dryrun:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Checkout
@@ -38,17 +38,14 @@ jobs:
3838

3939
- name: Set up chart-testing
4040
uses: helm/chart-testing-action@v2.6.1
41-
42-
- name: Run chart-testing (lint)
43-
run: |
44-
ct lint --chart-dirs . --charts . --validate-maintainers=false
4541

4642
- name: Create kind cluster
4743
uses: helm/kind-action@v1.10.0
4844

4945
- name: Run chart-testing (install)
5046
run: |
5147
helm repo add bitnami https://charts.bitnami.com/bitnami
52-
helm repo add seaweedfs https://seaweedfs.github.io/seaweedfs/helm
48+
helm repo add minio https://charts.min.io
5349
helm repo update
50+
helm dep up
5451
helm template ctfd . -f values.yaml | kubectl create --dry-run=server -f -

Chart.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ icon: https://ctfd.io/static/img/ctfd.svg
55

66
type: application
77

8-
version: 0.2.0
8+
# Dev note: trigger a helm chart release by bumping the version
9+
version: 0.3.0
910

1011
# Redis, MySQL/MariaDB and Seaweedfs
1112
dependencies:
@@ -17,7 +18,8 @@ dependencies:
1718
version: 14.0.12
1819
repository: https://charts.bitnami.com/bitnami
1920
condition: mariadb-galera.enabled
20-
- name: seaweedfs
21-
version: 4.0.0
22-
repository: https://seaweedfs.github.io/seaweedfs/helm
23-
condition: seaweedfs.enabled
21+
- name: minio
22+
alias: minio
23+
version: 5.4.0
24+
repository: https://charts.min.io/
25+
condition: minio.enabled

README.md

Lines changed: 37 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ helm install ctfd ctfd/ctfd -f values.yaml
1717

1818
## Install from source
1919

20-
Build helm dependencies (MariaDB/Redis/SeaweedFS) before installing the chart.
20+
Build helm dependencies (MariaDB/Redis/Minio) before installing the chart.
2121

2222
```bash
2323
helm dependency update
@@ -38,12 +38,12 @@ helm uninstall release-name --namespace ctfd
3838

3939
- CTFd `SECRET_KEY` is automatically generated during installation/upgrade. You can find it in the secret `release-name-ctfd-secret-key`. This secret is injected as environment variable in all CTFd pods.
4040
- Redis in this chart uses single master with multiple workers.
41-
- This chart deploys SeaweedFS S3 as an uploadprovider. You can use AWS S3 or any other external S3 compatible storage as an upload provider. Just set `seaweedfs.enabled` to `false` and configure the external S3 provider in `ctfd.uploadprovider.s3`.
41+
- This chart deploys Minio S3 bucket as an uploadprovider. You can use AWS S3 or any other external S3 compatible storage as an upload provider. Just set `minio.enabled` to `false` and configure the external S3 provider in `ctfd.uploadprovider.s3`.
4242
- This chart intentionally refrains from supporting `filesystem` uploadprovider. This needs `ReadWriteMany` PVCs which are expensive in cloud providers and not recommended for production use. S3 is fast and cheap.
4343

4444
## Values examples
4545

46-
### Deploy Bitnami MariaDB/Redis and SeaweedFS S3
46+
### Deploy Bitnami MariaDB/Redis and Minio
4747
```yaml
4848
ctfd:
4949
image:
@@ -52,17 +52,17 @@ ctfd:
5252
enabled: true
5353
minReplicas: 2
5454
maxReplicas: 10
55-
mariadb:
55+
mariadb-galera:
5656
enabled: true
57-
architecture: standalone
58-
primary:
57+
persistence:
58+
enabled: true
5959
size: 2Gi
6060
redis:
6161
enabled: true
62-
seaweedfs:
62+
minio:
6363
enabled: true
64-
s3:
65-
enabled: true
64+
persistence:
65+
size: 10Gi
6666
```
6767
6868
### Configure your own external DB/Redis/S3
@@ -80,7 +80,7 @@ ctfd:
8080
endpoint_url: ""
8181
secret_access_key: ""
8282
access_key_id: ""
83-
mariadb:
83+
mariadb-galera:
8484
enabled: false
8585
external:
8686
port: 3306
@@ -95,7 +95,7 @@ redis:
9595
host: ""
9696
username: ""
9797
password: ""
98-
seaweedfs:
98+
minio:
9999
enabled: false
100100
```
101101
@@ -107,32 +107,25 @@ ctfd:
107107
replicas: 2
108108
autoscaling:
109109
enabled: false
110-
resources:
111-
limits:
112-
cpu: "2"
113-
memory: 2Gi
114-
requests:
115-
cpu: "1"
116-
memory: 1Gi
117110
```
118111
119112
## Features
120113
121114
- [x] HA and horizontal autoscaling with CPU and memory metrics
122115
- [x] Configurable CPU/memory requests and limits
123-
- [x] Deploys bitnami Redis, bitnami MariaDB and SeaweedFS S3 as Helm dependencies
116+
- [x] Deploys bitnami Redis, bitnami MariaDB-Galera and ~~SeaweedFS S3~~ (REPLACED WITH MINIO) as Helm dependencies
124117
- [X] Option to use AWS S3 or any other external S3 compatible storage as an upload provider
125118
- [x] Option to use external Redis and MariaDB (e.g., AWS RDS, ElastiCache)
126119
- [x] Customizable CTFd configuration
127-
- [x] Adjustable configurations for Redis and MariaDB
128-
- [x] Integration with external storage as upload provider (AWS S3 or SeaweedFS or any S3 compatible storage)
120+
- [x] Adjustable configurations for Redis and MariaDB-Galera
121+
- [x] Integration with external storage as upload provider (AWS S3 or Minio or any S3 compatible storage)
129122
- [x] Liveness and Readiness checks
130123
- [x] Affinity/Toleration/nodeSelector rules
131124
- [x] Automatically rolls out config updates to CTFd pods (Using checksum annotation)
132125
- [ ] Deploys self-hosted mail server for CTFd email notifications as a helm dependency
133126
- [ ] Automated backups (CTFd export. This could be done with batch/v1 CronJob)
134127
- [ ] Deploys postgres db as a helm dependency (ctfd.io doesn't actively support it so this is a low priority)
135-
- [ ] Support for custom CTFd themes/plugin (using initContainers?)
128+
- [ ] Support for custom CTFd themes/plugin (using initContainers? this is WIP)
136129
137130
## To Do
138131
@@ -155,7 +148,7 @@ ctfd:
155148
|------------|------|---------|
156149
| https://charts.bitnami.com/bitnami | mariadb-galera | 14.0.12 |
157150
| https://charts.bitnami.com/bitnami | redis | 20.0.5 |
158-
| https://seaweedfs.github.io/seaweedfs/helm | seaweedfs | 4.0.0 |
151+
| https://charts.min.io/ | minio(minio) | 5.4.0 |
159152
160153
## Values
161154
@@ -172,7 +165,8 @@ ctfd:
172165
| ctfd.image.repository | string | `"ghcr.io/ctfd/ctfd"` | repository link to the CTFd docker image |
173166
| ctfd.image.tag | string | `latest` | CTFd image tag (check https://github.com/CTFd/CTFd/pkgs/container/ctfd) |
174167
| ctfd.imagePullSecrets | list | `[]` | Image pull secrets (use this for private repos) |
175-
| ctfd.ingress.annotations | object | `{}` | Ingress annotations |
168+
| ctfd.ingress.annotations | object | `{"nginx.ingress.kubernetes.io/proxy-body-size":"2G"}` | Ingress annotations |
169+
| ctfd.ingress.annotations."nginx.ingress.kubernetes.io/proxy-body-size" | string | `"2G"` | Max body size for uploads (Check CTFd github repository's nginx configurations) |
176170
| ctfd.ingress.className | string | `""` | Ingress class |
177171
| ctfd.ingress.enabled | bool | `true` | Enables ingress |
178172
| ctfd.initContainers | list | `[]` | |
@@ -206,18 +200,29 @@ ctfd:
206200
| ctfd.uploadprovider.s3.secret_access_key | string | `""` | AWS S3 bucket access key |
207201
| ctfd.volumeMounts | list | `[]` | CTFd volumeMounts |
208202
| ctfd.volumes | list | `[]` | CTFd volumes |
209-
| mariadb-galera.db.name | string | `"ctfd"` | |
210-
| mariadb-galera.db.password | string | `"ctfd"` | |
211-
| mariadb-galera.db.user | string | `"ctfd"` | |
203+
| extraObjects | list | `[]` | Made for deploying custom manifests with this helm chart |
204+
| mariadb-galera.db.name | string | `"ctfd"` | ctfd database name |
205+
| mariadb-galera.db.password | string | `"ctfd"` | ctfd database password |
206+
| mariadb-galera.db.user | string | `"ctfd"` | ctfd database user |
212207
| mariadb-galera.enabled | bool | `true` | Deploys bitnami's mariadb-galera (set to false if you want to use an external database) |
213208
| mariadb-galera.external | object | ignored | External database connection details. Takes effect if `mariadb.enabled` is set to false |
214209
| mariadb-galera.extraFlags | string | Check `values.yaml`. Used by official CTFd `docker-compose.yml` | MariaDB primary entrypoint extra flags |
215-
| mariadb-galera.galera.mariabackup.password | string | `"ctfd"` | |
216-
| mariadb-galera.metrics.enabled | bool | `true` | |
210+
| mariadb-galera.galera | object | `{"mariabackup":{"password":"ctfd"}}` | backup user (This is required by the subchart to do helm upgrades) |
211+
| mariadb-galera.galera.mariabackup.password | string | `"ctfd"` | backup user (This is required by the subchart to do helm upgrades) |
212+
| mariadb-galera.metrics.enabled | bool | `false` | |
217213
| mariadb-galera.persistence.enabled | bool | `true` | |
218-
| mariadb-galera.persistence.size | string | `"2Gi"` | |
219-
| mariadb-galera.resourcesPreset | string | `"large"` | |
220-
| mariadb-galera.rootUser.password | string | `"ctfd"` | |
214+
| mariadb-galera.persistence.size | string | `"2Gi"` | PVC size |
215+
| mariadb-galera.replicaCount | int | `3` | Number of primary nodes replicas |
216+
| mariadb-galera.resourcesPreset | string | `"large"` | request and limits preset (check bitnami's mariadb-galera chart for details) |
217+
| mariadb-galera.rootUser.password | string | `"ctfd"` | root user |
218+
| minio.buckets[0] | object | `{"name":"ctfd-bucket","policy":"download","purge":false}` | Default bucket to be used by CTFd `download` policy means this bucket is readonly for anonymous access (competitors) |
219+
| minio.drivesPerNode | int | `1` | Minio number of drives per replica/node |
220+
| minio.enabled | bool | `true` | Deploys Minio (set to false if you want to use an external S3 bucket) |
221+
| minio.ingress | object | `{"annotations":{"nginx.ingress.kubernetes.io/proxy-body-size":"0"},"enabled":true,"hosts":["minio.example.com"]}` | Ingress configurations of minio (Used by both CTFd and competitiors) |
222+
| minio.ingress.annotations."nginx.ingress.kubernetes.io/proxy-body-size" | string | `"0"` | Max Body size `0 -> unlimited` (if you are using another ingress controller then look for the equivalent annotation) |
223+
| minio.persistence | object | `{"size":"10Gi"}` | Minio PVC size (change according to your needs) |
224+
| minio.replicas | int | `3` | Minio number of replicas |
225+
| minio.resources.requests.memory | string | `"2Gi"` | |
221226
| redis.auth.enabled | bool | `false` | |
222227
| redis.enabled | bool | `true` | Deploys bitnami's redis (set to false if you want to use an external cache) |
223228
| redis.external | object | ignored | External redis cache connection details. Takes effect if `redis.enabled` is set to false |
@@ -231,18 +236,5 @@ ctfd:
231236
| redis.replica.resourcesPreset | string | `"micro"` | Check Bintami's documentation |
232237
| redis.sysctl.enabled | bool | `true` | |
233238
| redis.volumePermissions.enabled | bool | `true` | |
234-
| seaweedfs.enabled | bool | `true` | Deploys seaweedfs (set to false if you want to use an bucket) |
235-
| seaweedfs.filer.data.size | string | `"5Gi"` | seaweedfs-filer storage size |
236-
| seaweedfs.filer.data.type | string | `"persistentVolumeClaim"` | seaweedfs-filer data storage type |
237-
| seaweedfs.filer.enablePVC | bool | `true` | seaweedfs-filer enable PVC for data persistence |
238-
| seaweedfs.filer.replicas | int | `1` | seaweedfs-filer replicas |
239-
| seaweedfs.filer.s3.createBuckets | list | `[{"name":"ctfd-bucket"}]` | seaweedfs-s3 create bucket upon deploying |
240-
| seaweedfs.filer.s3.enableAuth | bool | `false` | seaweedfs-s3 enable authentication (no need since seaweed is private to the cluster) |
241-
| seaweedfs.filer.s3.enabled | bool | `true` | seaweedfs-s3 enable. This enables S3 API (Should be left to `true`) |
242-
| seaweedfs.filer.storage | string | `"5Gi"` | seaweedfs-filer PVC storage size |
243-
| seaweedfs.master.data.size | string | `"5Gi"` | seaweedfs storage size |
244-
| seaweedfs.master.data.type | string | `"persistentVolumeClaim"` | seaweedfs data storage type |
245-
| seaweedfs.master.replicas | int | `1` | seaweedfs-master replicas |
246-
| seaweedfs.volume.replicas | int | `1` | seaweedfs-volume replicas |
247239

248240
Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs)

README.md.gotmpl

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ helm install ctfd ctfd/ctfd -f values.yaml
1717

1818
## Install from source
1919

20-
Build helm dependencies (MariaDB/Redis/SeaweedFS) before installing the chart.
20+
Build helm dependencies (MariaDB/Redis/Minio) before installing the chart.
2121

2222
```bash
2323
helm dependency update
@@ -38,12 +38,12 @@ helm uninstall release-name --namespace ctfd
3838

3939
- CTFd `SECRET_KEY` is automatically generated during installation/upgrade. You can find it in the secret `release-name-ctfd-secret-key`. This secret is injected as environment variable in all CTFd pods.
4040
- Redis in this chart uses single master with multiple workers.
41-
- This chart deploys SeaweedFS S3 as an uploadprovider. You can use AWS S3 or any other external S3 compatible storage as an upload provider. Just set `seaweedfs.enabled` to `false` and configure the external S3 provider in `ctfd.uploadprovider.s3`.
41+
- This chart deploys Minio S3 bucket as an uploadprovider. You can use AWS S3 or any other external S3 compatible storage as an upload provider. Just set `minio.enabled` to `false` and configure the external S3 provider in `ctfd.uploadprovider.s3`.
4242
- This chart intentionally refrains from supporting `filesystem` uploadprovider. This needs `ReadWriteMany` PVCs which are expensive in cloud providers and not recommended for production use. S3 is fast and cheap.
4343

4444
## Values examples
4545

46-
### Deploy Bitnami MariaDB/Redis and SeaweedFS S3
46+
### Deploy Bitnami MariaDB/Redis and Minio
4747
```yaml
4848
ctfd:
4949
image:
@@ -52,17 +52,17 @@ ctfd:
5252
enabled: true
5353
minReplicas: 2
5454
maxReplicas: 10
55-
mariadb:
55+
mariadb-galera:
5656
enabled: true
57-
architecture: standalone
58-
primary:
57+
persistence:
58+
enabled: true
5959
size: 2Gi
6060
redis:
6161
enabled: true
62-
seaweedfs:
62+
minio:
6363
enabled: true
64-
s3:
65-
enabled: true
64+
persistence:
65+
size: 10Gi
6666
```
6767

6868
### Configure your own external DB/Redis/S3
@@ -80,7 +80,7 @@ ctfd:
8080
endpoint_url: ""
8181
secret_access_key: ""
8282
access_key_id: ""
83-
mariadb:
83+
mariadb-galera:
8484
enabled: false
8585
external:
8686
port: 3306
@@ -95,7 +95,7 @@ redis:
9595
host: ""
9696
username: ""
9797
password: ""
98-
seaweedfs:
98+
minio:
9999
enabled: false
100100
```
101101

@@ -107,32 +107,25 @@ ctfd:
107107
replicas: 2
108108
autoscaling:
109109
enabled: false
110-
resources:
111-
limits:
112-
cpu: "2"
113-
memory: 2Gi
114-
requests:
115-
cpu: "1"
116-
memory: 1Gi
117110
```
118111

119112
## Features
120113

121114
- [x] HA and horizontal autoscaling with CPU and memory metrics
122115
- [x] Configurable CPU/memory requests and limits
123-
- [x] Deploys bitnami Redis, bitnami MariaDB and SeaweedFS S3 as Helm dependencies
116+
- [x] Deploys bitnami Redis, bitnami MariaDB-Galera and ~~SeaweedFS S3~~ (REPLACED WITH MINIO) as Helm dependencies
124117
- [X] Option to use AWS S3 or any other external S3 compatible storage as an upload provider
125118
- [x] Option to use external Redis and MariaDB (e.g., AWS RDS, ElastiCache)
126119
- [x] Customizable CTFd configuration
127-
- [x] Adjustable configurations for Redis and MariaDB
128-
- [x] Integration with external storage as upload provider (AWS S3 or SeaweedFS or any S3 compatible storage)
120+
- [x] Adjustable configurations for Redis and MariaDB-Galera
121+
- [x] Integration with external storage as upload provider (AWS S3 or Minio or any S3 compatible storage)
129122
- [x] Liveness and Readiness checks
130123
- [x] Affinity/Toleration/nodeSelector rules
131124
- [x] Automatically rolls out config updates to CTFd pods (Using checksum annotation)
132125
- [ ] Deploys self-hosted mail server for CTFd email notifications as a helm dependency
133126
- [ ] Automated backups (CTFd export. This could be done with batch/v1 CronJob)
134127
- [ ] Deploys postgres db as a helm dependency (ctfd.io doesn't actively support it so this is a low priority)
135-
- [ ] Support for custom CTFd themes/plugin (using initContainers?)
128+
- [ ] Support for custom CTFd themes/plugin (using initContainers? this is WIP)
136129

137130
## To Do
138131

templates/NOTES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
{{ if or (index .Values "mariadb-galera" "enabled") (.Values.redis.enabled) -}}
24-
** Please be patient while MariaDB or Redis are being deployed **
24+
** Please be patient while MariaDB and/or Redis are being deployed **
2525
{{ end }}
2626

2727
Get the list of pods by executing:

templates/_helpers.tpl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,14 @@ redis://{{ .Release.Name }}-redis-master:6379
8383
{{- else -}}
8484
redis://{{ .Values.redis.external.username }}:{{ .Values.redis.external.password }}@{{ .Values.redis.external.host }}:{{ .Values.redis.external.port }}
8585
{{- end -}}
86+
{{- end -}}
87+
88+
{{/*
89+
Generate CTFd MINIO_URL
90+
*/}}
91+
{{- define "ctfd.MINIO_URL" -}}
92+
{{- if .Values.minio.enabled -}}
93+
http://{{ (index .Values.minio.ingress.hosts 0) }}
94+
{{- else -}}
95+
{{- end -}}
8696
{{- end -}}

0 commit comments

Comments
 (0)