Skip to content

Commit 6214491

Browse files
feat: added configuration support for S3_SHARDED storage type (#20)
* feat: added configuration support for S3_SHARDED storage type * chore: add path style property * fix: s3_sharded properties * adds comments Signed-off-by: George <egor.ivanov@qameta.io> * pathstyle Signed-off-by: George <egor.ivanov@qameta.io> * pathstle Signed-off-by: George <egor.ivanov@qameta.io> * appVersion: 26.2.1 Signed-off-by: George <egor.ivanov@qameta.io> * version: 26.2.1 Signed-off-by: George <egor.ivanov@qameta.io> * first admin email Signed-off-by: George <egor.ivanov@qameta.io> * fu linter Signed-off-by: George <egor.ivanov@qameta.io> * let's see Signed-off-by: George <egor.ivanov@qameta.io> --------- Signed-off-by: George <egor.ivanov@qameta.io> Co-authored-by: George <egor.ivanov@qameta.io>
1 parent b828415 commit 6214491

4 files changed

Lines changed: 106 additions & 14 deletions

File tree

charts/testops/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ Entries are ordered by priority:
1010
4. `[BUGFIX]` Fixes for defects
1111
5. `[DOCS]` Update of the documentation in `values.yaml`
1212

13+
## 5.27.0
14+
15+
- [FEATURE] Added configuration support for `S3_SHARDED` storage type, allowing users to configure multiple S3 storages and map them to specific projects.
16+
1317
## 5.26.2
1418

1519
- [BUGFIX] Fixed scientific notation in the application's thread pool configuration.

charts/testops/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: testops
3-
version: 5.26.2
4-
appVersion: 26.1.1
3+
version: 5.27.0
4+
appVersion: 26.2.1
55
kubeVersion: '>= 1.20.0-0'
66

77
dependencies:

charts/testops/templates/_helpers.tpl

Lines changed: 59 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,7 @@
559559

560560

561561
{{- define "renderS3Envs" }}
562+
{{- $s3Prefix := ternary "S3SHARDED" "S3" (eq .Values.storage.type "S3_SHARDED") }}
562563
- name: ALLURE_BLOBSTORAGE_TYPE
563564
value: {{ .Values.storage.type }}
564565
- name: ALLURE_BLOBSTORAGE_MAXCONCURRENCY
@@ -577,48 +578,97 @@
577578
- name: ALLURE_BLOBSTORAGE_COPYSUPPORTED
578579
value: {{ .Values.storage.s3.advancedS3SDK.copySupported | quote}}
579580
{{- end }}
580-
- name: ALLURE_BLOBSTORAGE_S3_ENDPOINT
581+
- name: ALLURE_BLOBSTORAGE_{{ $s3Prefix }}_ENDPOINT
581582
{{- if .Values.minio.enabled }}
582583
value: http://{{ template "testops.minio.fullname" . }}:{{ .Values.minio.service.ports.api }}
583-
- name: ALLURE_BLOBSTORAGE_S3_PATHSTYLEACCESS
584+
- name: ALLURE_BLOBSTORAGE_{{ $s3Prefix }}_PATHSTYLEACCESS
584585
value: "true"
585586
{{- else }}
586587
value: {{ .Values.storage.s3.endpoint }}
587-
- name: ALLURE_BLOBSTORAGE_S3_PATHSTYLEACCESS
588+
- name: ALLURE_BLOBSTORAGE_{{ $s3Prefix }}_PATHSTYLEACCESS
588589
value: "{{ .Values.storage.s3.pathstyle }}"
589590
{{- end }}
590-
- name: ALLURE_BLOBSTORAGE_S3_BUCKET
591+
- name: ALLURE_BLOBSTORAGE_{{ $s3Prefix }}_BUCKET
591592
{{- if .Values.minio.enabled }}
592593
value: {{ .Values.minio.defaultBuckets }}
593594
{{- else }}
594595
value: {{ .Values.storage.s3.bucket }}
595596
{{- end }}
596-
- name: ALLURE_BLOBSTORAGE_S3_REGION
597+
- name: ALLURE_BLOBSTORAGE_{{ $s3Prefix }}_REGION
597598
{{- if .Values.minio.enabled }}
598599
value: {{ .Values.minio.defaultRegion }}
599600
{{- else }}
600601
value: {{ .Values.storage.s3.region}}
601602
{{- end }}
602603
{{- if not .Values.storage.awsSTS.enabled }}
603-
- name: ALLURE_BLOBSTORAGE_S3_ACCESSKEY
604+
- name: ALLURE_BLOBSTORAGE_{{ $s3Prefix }}_ACCESSKEY
604605
valueFrom:
605606
secretKeyRef:
606607
name: {{ template "testops.secret.name" . }}
607608
key: "s3AccessKey"
608-
- name: ALLURE_BLOBSTORAGE_S3_SECRETKEY
609+
- name: ALLURE_BLOBSTORAGE_{{ $s3Prefix }}_SECRETKEY
609610
valueFrom:
610611
secretKeyRef:
611612
name: {{ template "testops.secret.name" . }}
612613
key: "s3SecretKey"
613614
{{- end }}
614615
{{- if .Values.storage.s3.serverSideEncryption.enabled }}
615-
- name: ALLURE_BLOB_STORAGE_S3_SERVER_SIDE_ENCRYPTION
616+
- name: ALLURE_BLOBSTORAGE_{{ $s3Prefix }}_SERVERSIDEENCRYPTION
616617
value: {{ .Values.storage.s3.serverSideEncryption.type | quote }}
617618
{{- if .Values.storage.s3.serverSideEncryption.keyId }}
618-
- name: ALLURE_BLOB_STORAGE_S3_KMS_KEY_ID
619+
- name: ALLURE_BLOBSTORAGE_{{ $s3Prefix }}_KMSKEYID
619620
value: {{ .Values.storage.s3.serverSideEncryption.keyId | quote }}
620621
{{- end }}
621622
{{- end }}
623+
624+
{{- if eq .Values.storage.type "S3_SHARDED" }}
625+
{{- range $index, $storage := .Values.storage.s3.additionalStorages }}
626+
- name: ALLURE_BLOBSTORAGE_S3SHARDED_STORAGES_{{ $index }}_NAME
627+
value: {{ $storage.name | quote }}
628+
{{- if $storage.endpoint }}
629+
- name: ALLURE_BLOBSTORAGE_S3SHARDED_STORAGES_{{ $index }}_ENDPOINT
630+
value: {{ $storage.endpoint | quote }}
631+
{{- end }}
632+
{{- if $storage.bucket }}
633+
- name: ALLURE_BLOBSTORAGE_S3SHARDED_STORAGES_{{ $index }}_BUCKET
634+
value: {{ $storage.bucket | quote }}
635+
{{- end }}
636+
{{- if $storage.region }}
637+
- name: ALLURE_BLOBSTORAGE_S3SHARDED_STORAGES_{{ $index }}_REGION
638+
value: {{ $storage.region | quote }}
639+
{{- end }}
640+
{{- if $storage.accessKey }}
641+
- name: ALLURE_BLOBSTORAGE_S3SHARDED_STORAGES_{{ $index }}_ACCESSKEY
642+
value: {{ $storage.accessKey | quote }}
643+
{{- end }}
644+
{{- if $storage.secretKey }}
645+
- name: ALLURE_BLOBSTORAGE_S3SHARDED_STORAGES_{{ $index }}_SECRETKEY
646+
value: {{ $storage.secretKey | quote }}
647+
{{- end }}
648+
{{- if $storage.pathstyle }}
649+
- name: ALLURE_BLOBSTORAGE_S3SHARDED_STORAGES_{{ $index }}_PATHSTYLEACCESS
650+
value: {{ $storage.pathstyle | quote }}
651+
{{- end }}
652+
{{- if and $storage.serverSideEncryption $storage.serverSideEncryption.enabled }}
653+
- name: ALLURE_BLOBSTORAGE_S3SHARDED_STORAGES_{{ $index }}_SERVERSIDEENCRYPTION
654+
value: {{ $storage.serverSideEncryption.type | quote }}
655+
{{- if $storage.serverSideEncryption.keyId }}
656+
- name: ALLURE_BLOBSTORAGE_S3SHARDED_STORAGES_{{ $index }}_KMSKEYID
657+
value: {{ $storage.serverSideEncryption.keyId | quote }}
658+
{{- end }}
659+
{{- end }}
660+
{{- end }}
661+
{{- range $projectId, $config := .Values.storage.s3.projects }}
662+
{{- if $config.storage }}
663+
- name: ALLURE_BLOBSTORAGE_S3SHARDED_PROJECTS_{{ $projectId }}_STORAGE
664+
value: {{ $config.storage | quote }}
665+
{{- end }}
666+
{{- if $config.bucket }}
667+
- name: ALLURE_BLOBSTORAGE_S3SHARDED_PROJECTS_{{ $projectId }}_BUCKET
668+
value: {{ $config.bucket | quote }}
669+
{{- end }}
670+
{{- end }}
671+
{{- end }}
622672
{{- end }}
623673

624674
{{- define "renderFSEnvs" }}

charts/testops/values.yaml

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ timeZone: "Europe/London"
112112
# Make sure SMTP parameters are set to send the invite.
113113
# SMTP server settings are mandatory for the creation of first user.
114114
############################################################################################################
115-
email: you@company.com
115+
email: first.admin@email.company.com
116116

117117
############################################################################################################
118118
# cryptoPass parameter is used to encrypt sensitive data (passwords, API tokens in the database)
@@ -366,7 +366,9 @@ smtp:
366366
# 2) S3_ASYNC - recommended for AWS S3, this option supports parameters described in .Values.storage.s3.advancedS3SDK
367367
# S3_ASYNC allows usage of optimised commands towards S3 solution (e.g. delete objects). Consult your solution
368368
# documentation before using this option
369-
# 3) CSI
369+
# 3) S3_SHARDED - allows configuring multiple S3 storages
370+
# and mapping them to specific projects via .Values.storage.s3.additionalStorages and .Values.storage.s3.projects
371+
# 4) CSI
370372
# For CSI refer to https://kubernetes-csi.github.io/docs/drivers.html
371373
# S3 is preferable. The best option is using SaaS S3 AWS or other S3 comparable services.
372374
# It's highly recommended disabling versioning for S3 from the very start
@@ -377,6 +379,7 @@ storage:
377379
# Options are:
378380
# - S3
379381
# - S3_ASYNC
382+
# - S3_SHARDED
380383
# - CSI
381384
type: "S3"
382385
s3:
@@ -399,7 +402,7 @@ storage:
399402
# Some providers have path style access like s3.provider.com/bucket-name others have domain style
400403
# Like bucket-name.s3.provider.com. Choose your provider's
401404
############################################################################################################
402-
# AWS S3 supports both pathstyle: false/true, other solutions most likely support false only
405+
# AWS S3 supports both pathstyle: false/true, other solutions (minio, ceph etc) most likely support TRUE only
403406
############################################################################################################
404407
pathstyle: false
405408
bucket: testops-testops
@@ -423,6 +426,41 @@ storage:
423426
# The ARN format is: arn:aws:kms:<region>:<account-id>:key/<key-id>
424427
# Ref: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html#aws-managed-customer-managed-keys
425428
keyId:
429+
## @param storage.s3.additionalStorages defines an array of additional S3 storages for S3_SHARDED mode.
430+
## Storage represents an isolated solution with its own endpoint, bucket, region, accessKey, secretKey, and serverSideEncryption settings.
431+
## Each storage requires a unique 'name' and can override default S3 parameters like endpoint, bucket, region, accessKey, secretKey, pathstyleand serverSideEncryption.
432+
## e.g:
433+
## additionalStorages:
434+
## - name: "eu-storage"
435+
## endpoint: "https://s3.eu-central-1.amazonaws.com"
436+
## bucket: "allure-eu-bucket"
437+
## region: "eu-central-1"
438+
## accessKey: "EU_ACCESS_KEY"
439+
## secretKey: "EU_SECRET_KEY"
440+
## pathstyle: false
441+
## serverSideEncryption:
442+
## enabled: true
443+
## type: "AWS_KMS"
444+
## keyId: "arn:aws:kms:eu-central-1:123456789012:key/12345678-1234-1234-1234-123456789012"
445+
##
446+
additionalStorages: []
447+
## @param storage.s3.projects defines a map of project-specific S3 configurations for S3_SHARDED mode.
448+
## The key is the project ID. You can specify a custom 'bucket' and/or a 'storage' name (referencing an entry from additionalStorages).
449+
## If a property is not set, the default S3 configuration will be used.
450+
## e.g:
451+
## projects:
452+
##
453+
## 12: // project 12 uses default bucket defined for "eu-storage"
454+
## storage: "eu-storage"
455+
##
456+
## 45: //project 45 uses default S3 solution but dedicated bucket "custom-us-bucket"
457+
## bucket: "custom-us-bucket"
458+
##
459+
## 90: project 90 uses storage "eu-storage" but its own (not default) bucket – "custom-eu-bucket"
460+
## storage: "eu-storage"
461+
## bucket: "custom-eu-bucket"
462+
##
463+
projects: []
426464
csi:
427465
storageClass: ""
428466
existingVolumeName: ""

0 commit comments

Comments
 (0)