Skip to content

Commit

Permalink
support backup.barmanObjectStore.s3Credentials.inheritFromIAMRole (#488)
Browse files Browse the repository at this point in the history
Signed-off-by: jessebot <[email protected]>
Co-authored-by: Itay Grudev <[email protected]>
  • Loading branch information
jessebot and itay-grudev authored Jan 7, 2025
1 parent 4bc725d commit dc3137e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/cluster/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ name: cluster
description: Deploys and manages a CloudNativePG cluster and its associated resources.
icon: https://raw.githubusercontent.com/cloudnative-pg/artwork/main/cloudnativepg-logo.svg
type: application
version: 0.1.3
version: 0.2.0
sources:
- https://github.com/cloudnative-pg/charts
keywords:
Expand Down
6 changes: 5 additions & 1 deletion charts/cluster/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# cluster

![Version: 0.1.3](https://img.shields.io/badge/Version-0.1.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

> **Warning**
> ### This chart is under active development.
Expand Down Expand Up @@ -136,6 +136,7 @@ refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentat
| backups.retentionPolicy | string | `"30d"` | Retention policy for backups |
| backups.s3.accessKey | string | `""` | |
| backups.s3.bucket | string | `""` | |
| backups.s3.inheritFromIAMRole | bool | `false` | Use the role based authentication without providing explicitly the keys |
| backups.s3.path | string | `"/"` | |
| backups.s3.region | string | `""` | |
| backups.s3.secretKey | string | `""` | |
Expand Down Expand Up @@ -237,6 +238,7 @@ refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentat
| recovery.provider | string | `"s3"` | One of `s3`, `azure` or `google` |
| recovery.s3.accessKey | string | `""` | |
| recovery.s3.bucket | string | `""` | |
| recovery.s3.inheritFromIAMRole | bool | `false` | Use the role based authentication without providing explicitly the keys |
| recovery.s3.path | string | `"/"` | |
| recovery.s3.region | string | `""` | |
| recovery.s3.secretKey | string | `""` | |
Expand Down Expand Up @@ -279,3 +281,5 @@ TODO
* IAM Role for S3 Service Account
* Automatic provisioning of a Alert Manager configuration

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
4 changes: 4 additions & 0 deletions charts/cluster/templates/_barman_object_store.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@
{{- end }}
{{- $secretName := coalesce .scope.secret.name (printf "%s-%s-s3-creds" .chartFullname .secretPrefix) }}
s3Credentials:
{{- if .scope.s3.inheritFromIAMRole }}
inheritFromIAMRole: true
{{- else }}
accessKeyId:
name: {{ $secretName }}
key: ACCESS_KEY_ID
secretAccessKey:
name: {{ $secretName }}
key: ACCESS_SECRET_KEY
{{- end }}
{{- else if eq .scope.provider "azure" }}
{{- if empty .scope.destinationPath }}
destinationPath: "https://{{ required "You need to specify Azure storageAccount if destinationPath is not specified." .scope.azure.storageAccount }}.{{ .scope.azure.serviceName }}.core.windows.net/{{ .scope.azure.containerName }}{{ .scope.azure.path }}"
Expand Down
2 changes: 1 addition & 1 deletion charts/cluster/templates/backup-s3-creds.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Values.backups.enabled (eq .Values.backups.provider "s3") .Values.backups.secret.create }}
{{- if and .Values.backups.enabled (eq .Values.backups.provider "s3") (not .Values.backups.s3.inheritFromIAMRole) .Values.backups.secret.create }}
apiVersion: v1
kind: Secret
metadata:
Expand Down
4 changes: 4 additions & 0 deletions charts/cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ recovery:
path: "/"
accessKey: ""
secretKey: ""
# -- Use the role based authentication without providing explicitly the keys
inheritFromIAMRole: false
azure:
path: "/"
connectionString: ""
Expand Down Expand Up @@ -326,6 +328,8 @@ backups:
path: "/"
accessKey: ""
secretKey: ""
# -- Use the role based authentication without providing explicitly the keys
inheritFromIAMRole: false
azure:
path: "/"
connectionString: ""
Expand Down

0 comments on commit dc3137e

Please sign in to comment.