diff --git a/charts/lemmy/Chart.yaml b/charts/lemmy/Chart.yaml index 496d36f..721fe19 100644 --- a/charts/lemmy/Chart.yaml +++ b/charts/lemmy/Chart.yaml @@ -6,7 +6,7 @@ icon: https://join-lemmy.org/static/assets/images/lemmy.svg appVersion: 0.17.4 type: application -version: 0.2.0 +version: 0.2.1 maintainers: - name: Alexander Olofsson diff --git a/charts/lemmy/templates/deployment-pictrs.yaml b/charts/lemmy/templates/deployment-pictrs.yaml index 297ae7b..70046df 100644 --- a/charts/lemmy/templates/deployment-pictrs.yaml +++ b/charts/lemmy/templates/deployment-pictrs.yaml @@ -51,6 +51,19 @@ spec: name: {{ include "lemmy.fullname" . }} key: pictrs_apikey {{- end }} + {{- if and (eq .Values.pictrs.storage.method "object_storage") .Values.pictrs.storage.objectStorage.existingSecret }} + {{- $existingS3 := .Values.pictrs.storage.objectStorage.existingSecret }} + - name: PICTRS__STORE__ACCESS_KEY + valueFrom: + secretKeyRef: + name: {{ $existingS3 }} + key: {{ .Values.pictrs.storage.objectStorage.existingSecretAccessKey | default "access-key" }} + - name: PICTRS__STORE__SECRET_KEY + valueFrom: + secretKeyRef: + name: {{ $existingS3 }} + key: {{ .Values.pictrs.storage.objectStorage.existingSecretSecretKey | default "secret-key" }} + {{- end }} {{- with .Values.pictrs.env }} {{- range $key, $value := . }} - name: {{ $key }} diff --git a/charts/lemmy/templates/secret-pictrs.yaml b/charts/lemmy/templates/secret-pictrs.yaml index 4e55bbe..67da82c 100644 --- a/charts/lemmy/templates/secret-pictrs.yaml +++ b/charts/lemmy/templates/secret-pictrs.yaml @@ -17,8 +17,10 @@ data: PICTRS__STORE__USE_PATH_STYLE: {{ $s3.usePathStyle | default false | toString | b64enc }} PICTRS__STORE__BUCKET_NAME: {{ required "S3 bucket must be specified" $s3.bucketName | b64enc }} PICTRS__STORE__REGION: {{ required "S3 region must be specified" $s3.region | b64enc }} + {{- if not $s3.existingSecret }} PICTRS__STORE__ACCESS_KEY: {{ required "S3 access key must be specified" $s3.accessKey | b64enc }} PICTRS__STORE__SECRET_KEY: {{ required "S3 secret key must be specified" $s3.secretKey | b64enc }} + {{- end }} {{- if $s3.sessionToken }} PICTRS__STORE__SESSION_TOKEN: {{ $s3.sessionToken | b64enc }} {{- end }} diff --git a/charts/lemmy/values.yaml b/charts/lemmy/values.yaml index ee4b18a..943ebb0 100644 --- a/charts/lemmy/values.yaml +++ b/charts/lemmy/values.yaml @@ -144,6 +144,7 @@ frontend: affinity: {} pictrs: + ## NB: pict-rs uses a Sled database by default, which can only be opened by a single instance replicaCount: 1 strategy: