-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: add object store secret generation (#229)
## Description - add object store secret generation - switch to minio operator for object store dependency ## Related Issue Fixes # <!-- or --> Relates to # ## Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Other (security config, docs update, etc) ## Checklist before merging - [ ] Test, docs, adr added or updated as needed - [ ] [Contributor Guide Steps](https://github.com/defenseunicorns/uds-package-gitlab/blob/main/CONTRIBUTING.md#developer-workflow) followed
- Loading branch information
1 parent
e78a74d
commit e2eb77a
Showing
12 changed files
with
140 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Copyright 2024 Defense Unicorns | ||
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial | ||
|
||
{{- if .Values.storage.createSecret.enabled }} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: gitlab-object-store | ||
namespace: gitlab | ||
type: kubernetes.io/opaque | ||
stringData: | ||
{{- $awsAccessKey := "" }} | ||
{{- $awsSecretKey := "" }} | ||
|
||
{{- if eq .Values.storage.createSecret.provider "minio" }} | ||
|
||
{{- $secret := lookup "v1" "Secret" .Values.storage.createSecret.secretRef.secretNamespace .Values.storage.createSecret.secretRef.secretName }} | ||
{{- if and $secret (index $secret.data .Values.storage.createSecret.secretRef.secretIDKey) }} | ||
{{- $awsAccessKey = (index $secret.data .Values.storage.createSecret.secretRef.secretIDKey | b64dec) }} | ||
{{- else }} | ||
{{- $awsAccessKey = .Values.storage.createSecret.accessKey | quote }} | ||
{{- end }} | ||
|
||
{{- if and $secret (index $secret.data .Values.storage.createSecret.secretRef.secretPasswordKey) }} | ||
{{- $awsSecretKey = (index $secret.data .Values.storage.createSecret.secretRef.secretPasswordKey | b64dec) }} | ||
{{- else }} | ||
{{- $awsSecretKey = .Values.storage.createSecret.secretKey | quote }} | ||
{{- end }} | ||
|
||
connection: |- | ||
provider: AWS | ||
region: {{ .Values.storage.createSecret.region | quote }} | ||
aws_access_key_id: {{ $awsAccessKey }} | ||
aws_secret_access_key: {{ $awsSecretKey }} | ||
endpoint: {{ .Values.storage.endpoint | quote }} | ||
aws_signature_version: 4 | ||
path_style: true | ||
registry: |- | ||
s3: | ||
bucket: {{ .Values.storage.createSecret.bucketPrefix }}gitlab-registry{{ .Values.storage.createSecret.bucketSuffix }} | ||
aws_access_key_id: {{ $awsAccessKey }} | ||
aws_secret_access_key: {{ $awsSecretKey }} | ||
regionendpoint: {{ .Values.storage.endpoint | quote }} | ||
region: {{ .Values.storage.createSecret.region | quote }} | ||
aws_signature_version: 4 | ||
path_style: true | ||
backups: |- | ||
[default] | ||
aws_access_key_id = {{ $awsAccessKey }} | ||
aws_secret_access_key = {{ $awsSecretKey }} | ||
host_base = {{ .Values.storage.endpoint | quote }} | ||
host_bucket = {{ .Values.storage.endpoint | quote }} | ||
bucket_location = {{ .Values.storage.createSecret.region | quote }} | ||
multipart_chunk_size_mb = 128 | ||
use_https = False | ||
{{- else if eq .Values.storage.createSecret.provider "aws" }} | ||
### AWS | ||
connection: |- | ||
provider: AWS | ||
region: {{ .Values.storage.createSecret.region | quote }} | ||
use_iam_profile: true | ||
aws_signature_version: 4 | ||
path_style: false | ||
registry: |- | ||
s3: | ||
bucket: {{ .Values.storage.createSecret.bucketPrefix }}gitlab-registry{{ .Values.storage.createSecret.bucketSuffix }} | ||
region: {{ .Values.storage.createSecret.region | quote }} | ||
backups: |- | ||
[default] | ||
host_base = "s3.{{ .Values.storage.createSecret.region }}.amazonaws.com" | ||
host_bucket = "s3.{{ .Values.storage.createSecret.region }}.amazonaws.com" | ||
bucket_location = AWS | ||
multipart_chunk_size_mb = 128 | ||
use_https = True | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.