-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from mongodb/sharded_cluster-v1
Sharded cluster v1, update operator 1.9.2, Additional Config
- Loading branch information
Showing
12 changed files
with
383 additions
and
15 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
89 changes: 89 additions & 0 deletions
89
charts/ent-operator-database/templates/database-shard.yaml
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,89 @@ | ||
{{- if eq .Values.type "ShardedCluster" }} | ||
--- | ||
apiVersion: mongodb.com/v1 | ||
kind: MongoDB | ||
metadata: | ||
name: {{ .Values.name }} | ||
namespace: {{ .Release.Namespace }} | ||
annotations: | ||
"meta.helm.sh/release-name": {{ .Release.Name }} | ||
"meta.helm.sh/release-namespace": {{ .Release.Namespace }} | ||
labels: | ||
"helm.sh/chart": {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} | ||
"app.kubernetes.io/managed-by": {{ .Release.Service }} | ||
|
||
spec: | ||
type: {{ .Values.type | quote }} | ||
version: {{ .Values.version }} | ||
persistent : true | ||
backup: | ||
enabled: {{ .Values.backup }} | ||
|
||
{{- with .Values.mongos }} | ||
{{- toYaml . | nindent 2 }} | ||
{{- end }} | ||
|
||
{{- with .Values.shardServer }} | ||
{{- toYaml . | nindent 2 }} | ||
{{- end }} | ||
|
||
{{- with .Values.configServer }} | ||
{{- toYaml . | nindent 2 }} | ||
{{- end }} | ||
|
||
opsManager: | ||
configMapRef: | ||
{{- if .Values.opsManager.configMap }} | ||
name: {{ .Values.opsManager.configMap }} | ||
{{- else }} | ||
name: {{ .Values.name }}-configmap | ||
{{- end }} | ||
{{- if .Values.opsManager.secretRef }} | ||
credentials: {{ .Values.opsManager.secretRef }} | ||
{{- else }} | ||
credentials: {{ .Values.name }}-credential | ||
{{- end }} | ||
|
||
security: | ||
authentication: | ||
enabled: true | ||
modes: | ||
{{- range .Values.security.authentication.modes }} | ||
- {{ . | quote }} # Valid authentication modes are "SCRAM' and "X509" | ||
{{- end }} | ||
{{- if .Values.security.tls.enabled }} | ||
tls: | ||
enabled: {{ .Values.security.tls.enabled }} | ||
ca: {{ .Values.security.tls.caRef }} | ||
{{- end }} | ||
|
||
# Optional field - ignoreUnknownUsers | ||
# A value of true means that any users not configured via the Operator or the Ops Manager or Cloud Manager UI | ||
# will not be altered in any way | ||
|
||
# If you need to manage MongoDB users directly via the mongods, set this value to true | ||
ignoreUnknownUsers: false # default value false | ||
podSpec: | ||
podTemplate: | ||
spec: | ||
terminationGracePeriodSeconds: 10 | ||
topologySpreadConstraints: | ||
- maxSkew: 1 | ||
topologyKey: zone | ||
whenUnsatisfiable: DoNotSchedule | ||
labelSelector: | ||
matchLabels: | ||
foo: bar | ||
# This container will be added to each pod as a sidecar | ||
containers: | ||
- name: mongodb-enterprise-database | ||
resources: | ||
{{- toYaml .Values.resources | nindent 14 }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 10 }} | ||
{{- end }} | ||
|
||
persistence: | ||
{{- toYaml .Values.persistence | nindent 6 }} | ||
{{- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
## MongoDB Enterprise Database | ||
|
||
# Set this to true if your cluster is managing SecurityContext for you. | ||
# If running OpenShift (Cloud, Minishift, etc.), set this to true. | ||
managedSecurityContext: false | ||
|
||
# Section to describe components that needs to be installed | ||
mongodb-enterprise-operator: | ||
enabled: true | ||
watchOpsManager: false | ||
watchDatabase: true | ||
|
||
# Optional configuration. | ||
deployValidationWebhooks: true | ||
|
||
name: mdbreplset | ||
type: ShardedCluster | ||
version: 4.4.2-ent | ||
backup: false | ||
|
||
mongos: | ||
mongodsPerShardCount: 3 | ||
mongosCount: 2 | ||
mongosPodSpec: | ||
# additionalMongodConfig: | ||
persistence: | ||
single: 1G | ||
# multiple: | ||
# data: | ||
# journal: | ||
# logs: | ||
podTemplate: | ||
# metadata: | ||
spec: | ||
containers: | ||
- name: mongodb-enterprise-database | ||
resources: | ||
limits: | ||
cpu: "0.8" | ||
memory: 1G | ||
# tolerations: | ||
# - key: "key" | ||
# operator: "Exists" | ||
# effect: "NoSchedule" | ||
agentConfigServer: | ||
startupOptions: | ||
maxLogFiles: "30" | ||
dialTimeoutSeconds: "40" | ||
|
||
shardServer: | ||
shardCount: 2 | ||
shardPodSpec: | ||
# additionalMongodConfig: | ||
persistence: | ||
single: 1G | ||
# multiple: | ||
# data: | ||
# journal: | ||
# logs: | ||
podTemplate: | ||
# metadata: | ||
spec: | ||
containers: | ||
- name: mongodb-enterprise-database | ||
resources: | ||
limits: | ||
cpu: "0.8" | ||
memory: 1G | ||
# tolerations: | ||
# - key: "key" | ||
# operator: "Exists" | ||
# effect: "NoSchedule" | ||
agentConfigServer: | ||
startupOptions: | ||
maxLogFiles: "30" | ||
dialTimeoutSeconds: "40" | ||
|
||
configServer: | ||
configServerCount: 3 | ||
configSrvPodSpec: | ||
# additionalMongodConfig: | ||
persistence: | ||
single: 1G | ||
# multiple: | ||
# data: | ||
# journal: | ||
# logs: | ||
podTemplate: | ||
# metadata: | ||
spec: | ||
containers: | ||
- name: mongodb-enterprise-database | ||
resources: | ||
limits: | ||
cpu: "0.8" | ||
memory: 1G | ||
# tolerations: | ||
# - key: "key" | ||
# operator: "Exists" | ||
# effect: "NoSchedule" | ||
agentConfigServer: | ||
startupOptions: | ||
maxLogFiles: "30" | ||
dialTimeoutSeconds: "40" | ||
|
||
opsManager: | ||
# Ops Manager connection could be configured with Values and This HELM chart will create | ||
# nesessary Secret and Config Map. | ||
URL: | ||
orgid: | ||
APIKey: | ||
APISecret: | ||
# Alternatevly an existing secret and config map could be provided directly | ||
configMap: opsmanager-configmap | ||
secretRef: opsmanager-org-access-key | ||
|
||
security: | ||
authentication: | ||
modes: ["SCRAM"] # Valid authentication modes are "SCRAM", "LDAP" and "X509" | ||
tls: | ||
enabled: false | ||
caRef: mdbreplset-ca | ||
# Note: Operator would expect Pem secret to have name: <metadata.name>-cert | ||
|
||
clusterName: cluster.local | ||
|
||
registry: | ||
imagePullSecrets: | ||
# TODO: specify for each image and move there? | ||
pullPolicy: Always | ||
# Specify if images are pulled from private registry | ||
|
||
users: | ||
- username: admin-user | ||
db: admin | ||
password: "%SomeLong%password$foradmin" | ||
roles: | ||
- db: admin | ||
name: clusterAdmin | ||
- db: admin | ||
name: userAdminAnyDatabase | ||
- db: admin | ||
name: readWrite | ||
- db: admin | ||
name: userAdminAnyDatabase | ||
- username: app-user | ||
db: admin | ||
password: "%SomeLong%password$" | ||
roles: | ||
- db: admin | ||
name: readWrite |
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
Oops, something went wrong.