lemmy: Fix existing S3 usage for pict-rs

This commit is contained in:
Alexander Olofsson 2023-06-23 07:56:25 +02:00
parent 6df2f48a35
commit e445cde04c
No known key found for this signature in database
GPG key ID: D439C9470CB04C73
4 changed files with 17 additions and 1 deletions

View file

@ -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

View file

@ -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 }}

View file

@ -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 }}

View file

@ -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: