Skip to content

Commit 6c9f51e

Browse files
committed
Adding ability to add 'extraManifests'
1 parent 0d545ba commit 6c9f51e

File tree

5 files changed

+88
-3
lines changed

5 files changed

+88
-3
lines changed

charts/community-operator/templates/database_roles.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ kind: ServiceAccount
44
metadata:
55
name: {{ .Values.database.name }}
66
namespace: {{ if .Values.database.namespace }} {{ .Values.database.namespace }} {{ else }} {{ .Release.Namespace }} {{ end }}
7-
7+
{{- with .Values.database.serviceAccount.annotations }}
8+
annotations:
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
811
---
912
apiVersion: rbac.authorization.k8s.io/v1
1013
kind: Role
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{{ range .Values.extraObjects }}
2+
---
3+
{{ tpl (toYaml .) $ }}
4+
{{ end }}

charts/community-operator/templates/mongodbcommunity_cr_with_tls.yaml

+9-1
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,13 @@ spec:
7575
{{- end }}
7676
authentication:
7777
modes: ["SCRAM"]
78-
users: []
78+
{{ with .Values.resource.statefulSet }}
79+
statefulSet:
80+
{{- toYaml . | nindent 4 }}
81+
{{- end}}
82+
83+
{{- with .Values.resource.users }}
84+
users:
85+
{{- toYaml . | nindent 4 }}
86+
{{- end }}
7987
{{- end }}

charts/community-operator/templates/operator_roles.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ kind: ServiceAccount
44
metadata:
55
name: {{ .Values.operator.name }}
66
namespace: {{ .Release.Namespace }}
7-
7+
{{- with .Values.operator.serviceAccount.annotations }}
8+
annotations:
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
811
---
912
apiVersion: rbac.authorization.k8s.io/v1
1013
kind: {{ if eq (.Values.operator.watchNamespace | default "") "*" }} ClusterRole {{ else }} Role {{ end }}

charts/community-operator/values.yaml

+67
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ operator:
44
# Deployment, ServiceAccount, Role etc.
55
name: mongodb-kubernetes-operator
66

7+
# serviceAccount annotations, if any to add
8+
serviceAccount:
9+
annotations: {}
10+
711
# Name of the operator image
812
operatorImageName: mongodb-kubernetes-operator
913

@@ -33,7 +37,13 @@ operator:
3337

3438
## Operator's database
3539
database:
40+
# Name that will be assigned to most of internal Kubernetes objects like
41+
# ServiceAccount, Role etc.
3642
name: mongodb-database
43+
# serviceAccount annotations, if any to add
44+
serviceAccount:
45+
annotations: {}
46+
3747
# set this to the namespace where you would like
3848
# to deploy the MongoDB database,
3949
# Note if the database namespace is not same
@@ -77,11 +87,68 @@ resource:
7787
members: 3
7888
tls:
7989
enabled: false
90+
# users: []
91+
# - name: my-user
92+
# db: admin
93+
# passwordSecretRef: # a reference to the secret that will be used to generate the user's password
94+
# name: my-user-password
95+
# roles:
96+
# - name: clusterAdmin
97+
# db: admin
98+
# - name: userAdminAnyDatabase
99+
# db: admin
100+
# - name: readWriteAnyDatabase
101+
# db: admin
102+
# - name: dbAdminAnyDatabase
103+
# db: admin
104+
# scramCredentialsSecretName: my-scram
80105

106+
# overwrite MDBC resource statefulset defaults
107+
# statefulSet:
108+
# spec:
109+
# template:
110+
# spec:
111+
# imagePullSecrets:
112+
# - name: my-secret
113+
# volumes:
114+
# - name: secretmanager-secretproviderclass
115+
# csi:
116+
# driver: secrets-store.csi.k8s.io
117+
# readOnly: true
118+
# volumeAttributes:
119+
# secretProviderClass: mysecretclass
120+
# containers:
121+
# - name: mongodb-agent
122+
# volumeMounts:
123+
# - name: secretmanager-secretproviderclass
124+
# mountPath: "/mnt/secrets-store"
125+
# readOnly: true
81126
# Installs Cert-Manager in this cluster.
82127
useCertManager: true
83128
certificateKeySecretRef: tls-certificate
84129
caCertificateSecretRef: tls-ca-key-pair
85130
certManager:
86131
certDuration: 8760h # 365 days
87132
renewCertBefore: 720h # 30 days
133+
134+
# -- Array of extra K8s manifests to deploy
135+
extraObjects: []
136+
# - apiVersion: secrets-store.csi.x-k8s.io/v1
137+
# kind: SecretProviderClass
138+
# metadata:
139+
# name: mongodb-secrets-store
140+
# spec:
141+
# provider: aws
142+
# parameters:
143+
# objects: |
144+
# - objectName: "mongodb"
145+
# objectType: "secretsmanager"
146+
# jmesPath:
147+
# - path: "password"
148+
# objectAlias: "password"
149+
# secretObjects:
150+
# - data:
151+
# - key: password
152+
# objectName: password
153+
# secretName: my-user-password
154+
# type: Opaque

0 commit comments

Comments
 (0)