From 7d9a780e1bc16726337ff7d82495262faf2e4cd0 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste DONNETTE Date: Thu, 19 Sep 2024 17:41:35 +0200 Subject: [PATCH] feat(minio): use the built-in bucket creation mechanism of the MinIO 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. --- templates/api-deployment.yaml | 17 +---------------- values.yaml | 34 ++++++++++++++++++++++++++++++---- 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/templates/api-deployment.yaml b/templates/api-deployment.yaml index 0265531..a237eb1 100644 --- a/templates/api-deployment.yaml +++ b/templates/api-deployment.yaml @@ -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" . }}" @@ -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 }} diff --git a/values.yaml b/values.yaml index 95f5cec..3801830 100644 --- a/values.yaml +++ b/values.yaml @@ -185,7 +185,33 @@ job: resources: {} minio: - enable: false - fullnameOverride: "{{ .Release.Name }}-minio" - #persistence: - # size: 10Gi \ No newline at end of file + 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 \ No newline at end of file