diff --git a/chart/templates/gitlab/secret-objectstore.yaml b/chart/templates/gitlab/secret-objectstore.yaml index 96ebf4e1e411c458271c9d25e4ed69e1094caf90..36fcc01bab68eb6eaeff0c6f05324323c7361f72 100644 --- a/chart/templates/gitlab/secret-objectstore.yaml +++ b/chart/templates/gitlab/secret-objectstore.yaml @@ -1,5 +1,5 @@ {{- if or .Values.addons.gitlab.enabled .Values.addons.gitlabRunner.enabled }} -{{- if .Values.addons.gitlab.objectStorage.endpoint }} +{{- if or .Values.addons.gitlab.objectStorage.region .Values.addons.gitlab.objectStorage.endpoint }} {{- if and (ne .Values.addons.gitlab.objectStorage.iamProfile "") (ne .Values.addons.gitlab.objectStorage.accessKey "") }}{{- fail "Must choose to use an IAM profile OR an AWS accessKey/accessSecret at .Values.addons.gitlab.objectStorage" }}{{- end }} apiVersion: v1 kind: Secret @@ -16,8 +16,6 @@ stringData: {{- else if eq .Values.addons.gitlab.objectStorage.iamProfile "" }} aws_access_key_id: {{ .Values.addons.gitlab.objectStorage.accessKey }} aws_secret_access_key: {{ .Values.addons.gitlab.objectStorage.accessSecret }} - {{- end }} - {{- if .Values.addons.gitlab.objectStorage.endpoint }} endpoint: "{{ .Values.addons.gitlab.objectStorage.endpoint }}" {{- end }} {{- if eq .Values.addons.gitlab.objectStorage.type "minio" }} @@ -40,7 +38,7 @@ stringData: secretkey: {{ .Values.addons.gitlab.objectStorage.accessSecret }} {{- end }} region: {{ .Values.addons.gitlab.objectStorage.region }} - {{- if .Values.addons.gitlab.objectStorage.endpoint }} + {{- if eq .Values.addons.gitlab.objectStorage.iamProfile "" }} regionendpoint: "{{ .Values.addons.gitlab.objectStorage.endpoint }}" {{- end }} {{- if eq .Values.addons.gitlab.objectStorage.type "s3" }} @@ -57,7 +55,9 @@ stringData: secret_key = {{ .Values.addons.gitlab.objectStorage.accessSecret }} {{- end }} bucket_location = {{ .Values.addons.gitlab.objectStorage.region }} + {{- if eq .Values.addons.gitlab.objectStorage.iamProfile "" }} host_bucket = %(bucket)s.{{ regexReplaceAll "http(s*)://" .Values.addons.gitlab.objectStorage.endpoint "" }} + {{- end }} multipart_chunk_size_mb = 128 {{- end }} {{- end }} diff --git a/chart/templates/gitlab/values.yaml b/chart/templates/gitlab/values.yaml index 9621931fea1424c5e0b0f953c08e73fce063042b..2425446af3d8eb788b3f47727c33fde2d3ca4d85 100644 --- a/chart/templates/gitlab/values.yaml +++ b/chart/templates/gitlab/values.yaml @@ -10,7 +10,7 @@ domain: {{ $domainName }} # Define variables to help with conditionals later {{- $istioInjection := (and (eq (dig "istio" "injection" "enabled" .Values.addons.gitlab) "enabled") .Values.istio.enabled) }} -{{- $iamProfile := (and (ne .Values.addons.gitlab.objectStorage.iamProfile "") .Values.addons.gitlab.objectStorage.endpoint) }} +{{- $iamProfile := (and (ne .Values.addons.gitlab.objectStorage.iamProfile "") (or .Values.addons.gitlab.objectStorage.region .Values.addons.gitlab.objectStorage.endpoint)) }} openshift: {{ .Values.openshift }} @@ -68,9 +68,9 @@ postgresql: {{- end }} {{- end }} -{{- if or .Values.addons.gitlab.objectStorage.endpoint $istioInjection }} +{{- if or .Values.addons.gitlab.objectStorage.region $istioInjection }} registry: - {{- if .Values.addons.gitlab.objectStorage.endpoint }} + {{- if .Values.addons.gitlab.objectStorage.region }} storage: secret: gitlab-object-storage key: registry @@ -98,9 +98,9 @@ registry: {{- end }} gitlab: - {{- if or .Values.addons.gitlab.objectStorage.endpoint $istioInjection }} + {{- if or .Values.addons.gitlab.objectStorage.region $istioInjection }} toolbox: - {{- if .Values.addons.gitlab.objectStorage.endpoint }} + {{- if .Values.addons.gitlab.objectStorage.region }} backups: objectStorage: config: @@ -278,7 +278,7 @@ global: registry: name: {{ .Values.addons.gitlab.hostnames.registry }}.{{ $domainName }} - {{- if .Values.addons.gitlab.objectStorage.endpoint }} + {{- if or (ne .Values.addons.gitlab.objectStorage.iamProfile "") .Values.addons.gitlab.objectStorage.region }} minio: enabled: false {{- end }} @@ -294,7 +294,7 @@ global: key: PGPASSWORD {{- end }} - {{- if .Values.addons.gitlab.objectStorage.endpoint }} + {{- if .Values.addons.gitlab.objectStorage.region }} registry: {{- if .Values.addons.gitlab.objectStorage.bucketPrefix }} bucket: {{ .Values.addons.gitlab.objectStorage.bucketPrefix }}-gitlab-registry @@ -303,7 +303,7 @@ global: {{- end }} {{- end }} - {{- if or .Values.addons.gitlab.sso.enabled .Values.addons.gitlab.objectStorage.endpoint }} + {{- if or .Values.addons.gitlab.sso.enabled .Values.addons.gitlab.objectStorage.region }} appConfig: {{- end }} @@ -329,17 +329,19 @@ global: key: gitlab-sso.json {{- end }} - {{- if .Values.addons.gitlab.objectStorage.endpoint }} + {{- if .Values.addons.gitlab.objectStorage.region }} lfs: {{- if .Values.addons.gitlab.objectStorage.bucketPrefix }} bucket: {{ .Values.addons.gitlab.objectStorage.bucketPrefix }}-gitlab-lfs {{- else }} bucket: gitlab-lfs {{- end }} - + {{- if not (dig "global" "appConfig" "object_store" "enabled" false .Values.addons.gitlab.values)}} connection: secret: gitlab-object-storage key: rails + {{- end }} + {{- end }} artifacts: {{- if .Values.addons.gitlab.objectStorage.bucketPrefix }} @@ -347,9 +349,11 @@ global: {{- else }} bucket: gitlab-artifacts {{- end }} + {{- if not (dig "global" "appConfig" "object_store" "enabled" false .Values.addons.gitlab.values)}} connection: secret: gitlab-object-storage key: rails + {{- end }} uploads: {{- if .Values.addons.gitlab.objectStorage.bucketPrefix }} @@ -357,9 +361,11 @@ global: {{- else }} bucket: gitlab-uploads {{- end }} + {{- if not (dig "global" "appConfig" "object_store" "enabled" false .Values.addons.gitlab.values)}} connection: secret: gitlab-object-storage key: rails + {{- end }} packages: {{- if .Values.addons.gitlab.objectStorage.bucketPrefix }} @@ -367,10 +373,11 @@ global: {{- else }} bucket: gitlab-packages {{- end }} - + {{- if not (dig "global" "appConfig" "object_store" "enabled" false .Values.addons.gitlab.values)}} connection: secret: gitlab-object-storage key: rails + {{- end }} externalDiffs: {{- if .Values.addons.gitlab.objectStorage.bucketPrefix }} @@ -378,9 +385,11 @@ global: {{- else }} bucket: gitlab-mr-diffs {{- end }} + {{- if not (dig "global" "appConfig" "object_store" "enabled" false .Values.addons.gitlab.values)}} connection: secret: gitlab-object-storage key: rails + {{- end }} terraformState: {{- if .Values.addons.gitlab.objectStorage.bucketPrefix }} @@ -388,9 +397,11 @@ global: {{- else }} bucket: gitlab-terraform-state {{- end }} + {{- if not (dig "global" "appConfig" "object_store" "enabled" false .Values.addons.gitlab.values)}} connection: secret: gitlab-object-storage key: rails + {{- end }} dependencyProxy: {{- if .Values.addons.gitlab.objectStorage.bucketPrefix }} @@ -398,9 +409,11 @@ global: {{- else }} bucket: gitlab-dependency-proxy {{- end }} + {{- if not (dig "global" "appConfig" "object_store" "enabled" false .Values.addons.gitlab.values)}} connection: secret: gitlab-object-storage key: rails + {{- end }} pseudonymizer: {{- if .Values.addons.gitlab.objectStorage.bucketPrefix }} @@ -422,7 +435,6 @@ global: tmpBucket: {{ .Values.addons.gitlab.objectStorage.bucketPrefix }}-gitlab-backup-tmp {{- else }} tmpBucket: gitlab-backup-tmp - {{- end }} {{- end }} {{- if and (ne .Values.addons.gitlab.redis.password "") (or .Values.addons.gitlab.enabled .Values.addons.gitlabRunner.enabled) }}