Skip to content

Commit

Permalink
feat(minio): use the built-in bucket creation mechanism of the MinIO …
Browse files Browse the repository at this point in the history
…chart

- Remove the `create-minio-bucket` init container since the MinIO chart now handles bucket creation via the `buckets` configuration.
- Update the `LAGO_AWS_S3_BUCKET` environment variable to use the name of the first bucket defined in `minio.buckets`.
- Enable MinIO in `values.yaml` by setting `enabled: true`.
- Add the (commented) bucket configuration in `values.yaml` with a note indicating that only the first bucket will be used.

This change simplifies deployment by leveraging the MinIO chart's built-in mechanism for bucket creation, eliminating the need for a custom script.
  • Loading branch information
electrosenpai committed Sep 19, 2024
1 parent dd22962 commit 7d9a780
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 20 deletions.
17 changes: 1 addition & 16 deletions templates/api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,6 @@ spec:
- pod/{{ .Release.Name }}-minio-0
- --for=condition=ready
- --timeout=180s

- name: create-minio-bucket
image: minio/mc
command: ["sh", "-c", "mc alias set myminio http://{{ .Release.Name }}-minio:9000 $MINIO_ACCESS_KEY $MINIO_SECRET_KEY && mc mb myminio/{{ .Values.minio.bucket }} || echo 'Bucket already exists'"]
env:
- name: MINIO_ACCESS_KEY
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-minio
key: rootUser
- name: MINIO_SECRET_KEY
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-minio
key: rootPassword
{{ end }}
- name: wait-for-migrations
image: "docker.io/bitnami/kubectl:{{ include "kubectlVersion" . }}"
Expand Down Expand Up @@ -205,7 +190,7 @@ spec:

- name: LAGO_AWS_S3_BUCKET
value: {{ if .Values.minio.enabled }}
{{ .Values.minio.bucket | quote }}
{{ (index .Values.minio.buckets 0).name | quote }}
{{ else }}
{{ .Values.global.s3.bucket | quote }}
{{ end }}
Expand Down
34 changes: 30 additions & 4 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,33 @@ job:
resources: {}

minio:
enable: false
fullnameOverride: "{{ .Release.Name }}-minio"
#persistence:
# size: 10Gi
enabled: true
# replicas: 2
# fullnameOverride: "my-lago-minio"
# endpoint: "http://minio.lago.dev"
# nameOverride: "minio"
# resources:
# requests:
# memory: "512Mi"
# cpu: "500m"
# limits:
# memory: "1Gi"
# cpu: "1"
# persistence:
# size: 10Gi
# ingress:
# enabled: true
# ingressClassName: nginx
# labels: {}
# annotations: {}
# path: /
# hosts:
# - minio.lago.dev
# tls: []
# Note : only the first one will be used
# buckets:
# - name: my-lago-minio
# policy: none
# purge: false
# versioning: false
# objectlocking: false

0 comments on commit 7d9a780

Please sign in to comment.