Ceph-RGW: Support rotation of s3 key pairs

This updates the helm-toolkit script for creating rgw s3 users
to first check if a user exists, then create the user if it does
not exist or modify the user's keys if it does exist. This is
accomplished by using jq to identify all existing access keys for
the specified user, removing those key pairs using the access key,
then modifies the existing user with the supplied access/secret
key pair for the given user

This also updates the ceph-rgw chart to use the helm-toolkit s3
user script for creating the admin s3 user instead of using a
similar script defined directly in the ceph-rgw chart

Change-Id: I575b66415d44db7bb752102e45595305d86e623b
This commit is contained in:
Steve Wilkerson
2019-02-06 15:34:58 -06:00
parent f4aa5dc574
commit cf0ed142f6
5 changed files with 47 additions and 49 deletions

View File

@@ -92,17 +92,17 @@ spec:
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.jobs.rgw_s3_admin | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
env:
- name: S3_ADMIN_USERNAME
- name: S3_USERNAME
valueFrom:
secretKeyRef:
name: {{ $s3AdminSecret }}
key: S3_ADMIN_USERNAME
- name: S3_ADMIN_ACCESS_KEY
- name: S3_ACCESS_KEY
valueFrom:
secretKeyRef:
name: {{ $s3AdminSecret }}
key: S3_ADMIN_ACCESS_KEY
- name: S3_ADMIN_SECRET_KEY
- name: S3_SECRET_KEY
valueFrom:
secretKeyRef:
name: {{ $s3AdminSecret }}