Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ability to add 'extraManifests' #212

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion charts/community-operator/templates/database_roles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ kind: ServiceAccount
metadata:
name: {{ .Values.database.name }}
namespace: {{ if .Values.database.namespace }} {{ .Values.database.namespace }} {{ else }} {{ .Release.Namespace }} {{ end }}

{{- with .Values.database.serviceAccount.annotations }}
annotations:
JunaidChaudry marked this conversation as resolved.
Show resolved Hide resolved
{{- toYaml . | nindent 4 }}
{{- end }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand Down
4 changes: 4 additions & 0 deletions charts/community-operator/templates/extraObjects.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{ range .Values.extraObjects }}
---
{{ tpl (toYaml .) $ }}
{{ end }}
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ spec:
{{- end }}
authentication:
modes: ["SCRAM"]
{{ with .Values.resource.statefulSet }}
statefulSet:
{{- toYaml . | nindent 4 }}
{{- end}}
{{- with .Values.resource.users }}
users:
{{- toYaml . | nindent 4 }}
Expand Down
5 changes: 4 additions & 1 deletion charts/community-operator/templates/operator_roles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ kind: ServiceAccount
metadata:
name: {{ .Values.operator.name }}
namespace: {{ .Release.Namespace }}

{{- with .Values.operator.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: {{ if eq (.Values.operator.watchNamespace | default "") "*" }} ClusterRole {{ else }} Role {{ end }}
Expand Down
54 changes: 52 additions & 2 deletions charts/community-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ operator:
# Deployment, ServiceAccount, Role etc.
name: mongodb-kubernetes-operator

# serviceAccount annotations, if any to add
serviceAccount:
annotations: {}

# Name of the operator image
operatorImageName: mongodb-kubernetes-operator

Expand Down Expand Up @@ -38,7 +42,13 @@ operator:

## Operator's database
database:
# Name that will be assigned to most of internal Kubernetes objects like
# ServiceAccount, Role etc.
name: mongodb-database
# serviceAccount annotations, if any to add
serviceAccount:
annotations: {}

# set this to the namespace where you would like
# to deploy the MongoDB database,
# Note if the database namespace is not same
Expand Down Expand Up @@ -82,15 +92,33 @@ resource:
members: 3
tls:
enabled: false

# overwrite MDBC resource statefulset defaults
# statefulSet:
# spec:
# template:
# spec:
# imagePullSecrets:
# - name: my-secret
# volumes:
# - name: secretmanager-secretproviderclass
# csi:
# driver: secrets-store.csi.k8s.io
# readOnly: true
# volumeAttributes:
# secretProviderClass: mysecretclass
# containers:
# - name: mongodb-agent
# volumeMounts:
# - name: secretmanager-secretproviderclass
# mountPath: "/mnt/secrets-store"
# readOnly: true
# Installs Cert-Manager in this cluster.
useCertManager: true
certificateKeySecretRef: tls-certificate
caCertificateSecretRef: tls-ca-key-pair
certManager:
certDuration: 8760h # 365 days
renewCertBefore: 720h # 30 days

users: []
# if using the MongoDBCommunity Resource, list any users to be added to the resource
# users:
Expand All @@ -108,3 +136,25 @@ resource:
# - name: dbAdminAnyDatabase
# db: admin
# scramCredentialsSecretName: my-scram

# -- Array of extra K8s manifests to deploy
extraObjects: []
# - apiVersion: secrets-store.csi.x-k8s.io/v1
# kind: SecretProviderClass
# metadata:
# name: mongodb-secrets-store
# spec:
# provider: aws
# parameters:
# objects: |
# - objectName: "mongodb"
# objectType: "secretsmanager"
# jmesPath:
# - path: "password"
# objectAlias: "password"
# secretObjects:
# - data:
# - key: password
# objectName: password
# secretName: my-user-password
# type: Opaque