Skip to content

Commit

Permalink
feat(helm-chart): add Bitnami's MinIO chart to default configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
clementguillot committed Aug 21, 2024
1 parent ef374cb commit afe05a6
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 4 deletions.
7 changes: 5 additions & 2 deletions apps/helm-chart/src/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
dependencies:
- name: minio
repository: https://charts.bitnami.com/bitnami
version: 14.7.1
- name: mongodb
repository: https://charts.bitnami.com/bitnami
version: 15.6.1
- name: nginx
repository: https://charts.bitnami.com/bitnami
version: 18.0.1
digest: sha256:c05c16045648a51dec1bff82e3571661b720b97fe5d516550531a68d581a4393
generated: "2024-06-06T19:56:41.397493834Z"
digest: sha256:bfc7cb256c921e752d6348ac0ab392d479cdd6a577b7441bd54a8c59f1b4d4b6
generated: "2024-08-20T16:15:02.771396128+02:00"
4 changes: 4 additions & 0 deletions apps/helm-chart/src/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ maintainers:
sources:
- https://github.com/clementguillot/nx-cloud-ce
dependencies:
- name: minio
version: 14.7.1
repository: https://charts.bitnami.com/bitnami
condition: minio.enabled
- name: mongodb
version: 15.6.1
repository: https://charts.bitnami.com/bitnami
Expand Down
30 changes: 28 additions & 2 deletions apps/helm-chart/src/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,41 @@ Create the default port of the server.
Create the MongoDB connection string of the server.
*/}}
{{- define "nx-cloud-ce.server.database.connection-string" -}}
{{- if .Values.mongodb.enabled }}
{{- if .Values.mongodb.enabled -}}
valueFrom:
secretKeyRef:
name: {{ template "nx-cloud-ce.name" . }}-mongodb-svcbind-0
key: uri
{{- else }}
{{- else -}}
valueFrom:
secretKeyRef:
name: {{ .Values.server.database.connectionStringSecretName | quote }}
key: {{ .Values.server.database.connectionStringSecretKeyRef | quote }}
{{- end -}}
{{- end -}}

{{/*
Create the embedded MinIO S3 settings.
*/}}
{{- define "nx-cloud-ce.server.s3.settings" -}}
{{- if .Values.minio.enabled -}}
- name: NX_SERVER_STORAGE_S3_ENDPOINT
value: "http://{{ template "nx-cloud-ce.name" . }}-minio.{{ .Release.Namespace }}.svc.cluster.local:9000"
- name: NX_SERVER_STORAGE_S3_REGION
value: "us-east-1"
- name: NX_SERVER_STORAGE_S3_BUCKET
value: "nx-cloud-ce"
- name: NX_SERVER_STORAGE_S3_FORCE_PATH_STYLE
value: "true"
- name: NX_SERVER_STORAGE_S3_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: {{ template "nx-cloud-ce.name" . }}-minio
key: root-user
- name: NX_SERVER_STORAGE_S3_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: {{ template "nx-cloud-ce.name" . }}-minio
key: root-password
{{- end -}}
{{- end -}}
1 change: 1 addition & 0 deletions apps/helm-chart/src/templates/server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ spec:
{{- include "nx-cloud-ce.server.database.connection-string" . | nindent 12 }}
- name: QUARKUS_MONGODB_DATABASE
value: {{ default .Values.server.name .Values.server.database.dbName }}
{{- include "nx-cloud-ce.server.s3.settings" . | nindent 10 }}
{{- with .Values.server.envFrom }}
envFrom:
{{- toYaml . | nindent 10 }}
Expand Down
8 changes: 8 additions & 0 deletions apps/helm-chart/src/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,14 @@ server:
# -- Server clean-up numbers of days to truncate on
days: 30

## Embedded MinIO configuration (Bitnami Helm Chart)
minio:
# If `enabled`, Bitnami's chart is installed.
enabled: true

# Comma, semi-colon or space separated list of buckets to create at initialization (only in standalone mode)
defaultBuckets: "nx-cloud-ce"

## Embedded MongoDB configuration (Bitnami Helm Chart)
mongodb:
# If `enabled`, Bitnami's chart is installed.
Expand Down

0 comments on commit afe05a6

Please sign in to comment.