diff --git a/README.md b/README.md index 2e975a7..7e12249 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ You can discuss this integration in our [Slack](https://community-slack.mongodb. The MongoDB Enterprise Operator is compatible with Kubernetes v1.11 and above. It has been tested against Openshift 3.11. This Operator requires [Ops Manager](https://docs.opsmanager.mongodb.com/current/) or [Cloud Manager](https://cloud.mongodb.com/user#/cloud/login). In this document, when we refer to "Ops Manager", you may substitute "Cloud Manager". The functionality is the same. -> If this is your first time trying the Operator, Cloud Manager is easier to get started +> If this is your first time trying the Operator, Cloud Manager is easier to get started ## Installation @@ -39,20 +39,20 @@ This Operator requires [Ops Manager](https://docs.opsmanager.mongodb.com/current The Mongodb Enterprise Operator is installed, by default, into the `mongodb` Namespace, but this Namespace is not created automatically. To create this Namespace you should execute: kubectl create namespace mongodb - -If you plan on using any other Namespace, please make sure you update the yaml files' `metadata.namespace` attribute to -point to your preferred Namespace. If using `helm` you need to override the `namespace` attribute with `--set namespace=<..>` + +If you plan on using any other Namespace, please make sure you update the yaml files' `metadata.namespace` attribute to +point to your preferred Namespace. If using `helm` you need to override the `namespace` attribute with `--set namespace=<..>` during helm installation ### Installation using yaml files #### Create CustomResourceDefinitions -The `CustomResourceDefinition` (or `crd`) should be installed before installing the operator into your Kubernetes cluster. To do this, make sure you have logged into your Kubernetes cluster and that you can perform Cluster level operations: +The `CustomResourceDefinition` (or `crds`) should be installed before installing the operator into your Kubernetes cluster. To do this, make sure you have logged into your Kubernetes cluster and that you can perform Cluster level operations: kubectl apply -f https://raw.githubusercontent.com/mongodb/mongodb-enterprise-kubernetes/master/crds.yaml -This will create one new `crd` in your cluster, `MongoDB`. This new object will be the one used by the operator to perform the MongoDb operations needed to prepare each one of the three different types of MongoDB deployments. `Standalone`, `ReplicaSet` and `ShardedCluster` +This will create a new `crd` in your cluster, `MongoDB`. This new object will be the one used by the operator to perform the MongoDb operations needed to prepare each one of the different MongoDb types of deployments. #### Operator Installation @@ -68,13 +68,13 @@ Check the end of the page for instructions on how to remove the Operator. ### Installation using Helm Chart -If you have installed the Helm client locally then you can run (note that `helm install` is a less preferred way as makes upgrades more complicated. +If you have installed the Helm client locally then you can run (note that `helm install` is a less preferred way as makes upgrades more complicated. `kubectl apply` is a much clearer way of installing/upgrading): - helm template helm_chart > operator.yaml + helm template public/helm_chart > operator.yaml kubectl apply -f operator.yaml -You can customize installation by simple overriding of helm variables, for example use `--set operator.env="dev"` to run the Operator in development mode +You can customize installation by simple overriding of helm variables, for example use `--set operator.env="dev"` to run the Operator in development mode (this will turn logging level to `Debug` and will make logging output as non-json) Check the end of the page for instructions on how to remove the Operator. @@ -110,9 +110,9 @@ data: orgId: 5b890e0feacf0b76ff3e7183 # this is an optional parameter baseUrl: https://my-ops-manager-or-cloud-manager-url ``` -> Note, that if `orgId` is skipped then the new organization named `projectName` will be automatically created and new +> Note, that if `orgId` is skipped then the new organization named `projectName` will be automatically created and new project will be added there. - + Apply this file to create the new `Project`: kubectl apply -f my-project.yaml @@ -127,16 +127,16 @@ $ kubectl -n mongodb create secret generic my-credentials --from-literal="user=s ### Creating a MongoDB Object ### -A MongoDB resource (short name `mdb`) in Kubernetes can have a type of Standalone, ReplicaSet or ShardedCluster. We are going to create a replica set to test that everything is working as expected. There is a MongoDBReplicaSet yaml file in `samples/minimal/replicaset.yaml`. +A MongoDB object in Kubernetes is a MongoDB (short name `mdb`). We are going to create a replica set to test that everything is working as expected. There is a MongoDB replica set yaml file in `samples/minimal/replicaset.yaml`. If you have a correctly created Project with the name `my-project` and Credentials stored in a secret called `my-credentials` then, after applying this file then everything should be running and a new Replica Set with 3 members should soon appear in Ops Manager UI. kubectl apply -f samples/minimal/replicaset.yaml - + ### Correct order of Operator/Namespace removal It's important to keep correct order or removal operations. The simple rule is: **never remove Operator before mongodb resources**! -The reason is that the Operator cleans state in Ops Manager on deletion of the MongoDB resource in Kubernetes. +The reason is that the Operator cleans state in Ops Manager on deletion of the MongoDB resource in Kubernetes. These are the correct steps to remove any MongoDB Operator resources: @@ -147,6 +147,5 @@ kubectl delete mdb --all -n # any of the following commands must be called after removing all existing mongodb resources kubectl delete namespace kubectl delete deployment mongodb-enterprise-operator -n -kubectl delete crd --all +kubectl delete crd/mongodb.mongodb.com ``` - diff --git a/crds.yaml b/crds.yaml index f6bdd8d..d652a1e 100644 --- a/crds.yaml +++ b/crds.yaml @@ -1,7 +1,6 @@ --- # Source: mongodb-enterprise-operator/templates/crds.yaml - --- apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition @@ -17,6 +16,23 @@ spec: shortNames: - mdb singular: mongodb + additionalPrinterColumns: + - name: Type + type: string + description: "The type of MongoDB deployment. One of 'ReplicaSet', 'ShardedCluster' and 'Standalone'." + JSONPath: .spec.type + - name: State + type: string + description: The current state of the MongoDB deployment. + JSONPath: .status.phase + - name: Version + type: string + description: The version of MongoDB. + JSONPath: .spec.version + - name: Age + type: date + description: The time since the MongoDB resource was created. + JSONPath: .metadata.creationTimestamp validation: # there are 3 possible schemas, ReplicaSet, ShardedCluster and Standalone openAPIV3Schema: oneOf: @@ -36,6 +52,17 @@ spec: type: type: string pattern: "^Standalone$" + additionalMongodConfig: + properties: + net: + properties: + ssl: + properties: + mode: + type: string + enum: ["disabled", "allowSSL", "preferSSL", "requireSSL", "allowTLS", "preferTLS", "requireTLS"] + exposedExternally: + type: boolean required: - credentials - project @@ -61,6 +88,17 @@ spec: type: type: string pattern: "^ReplicaSet$" + additionalMongodConfig: + properties: + net: + properties: + ssl: + properties: + mode: + type: string + enum: ["disabled", "allowSSL", "preferSSL", "requireSSL", "allowTLS", "preferTLS", "requireTLS"] + exposedExternally: + type: boolean required: - credentials - project @@ -97,6 +135,17 @@ spec: type: type: string pattern: "^ShardedCluster$" + additionalMongodConfig: + properties: + net: + properties: + ssl: + properties: + mode: + type: string + enum: ["disabled", "allowSSL", "preferSSL", "requireSSL", "allowTLS", "preferTLS", "requireTLS"] + exposedExternally: + type: boolean required: - credentials - project @@ -105,4 +154,5 @@ spec: - shardCount - mongodsPerShardCount - mongosCount - - configServerCount \ No newline at end of file + - configServerCount + diff --git a/helm_chart/Chart.yaml b/helm_chart/Chart.yaml index e40bdf8..2b64698 100644 --- a/helm_chart/Chart.yaml +++ b/helm_chart/Chart.yaml @@ -1,6 +1,6 @@ name: mongodb-enterprise-operator description: MongoDB Kubernetes Enterprise Operator -version: '0.10' +version: '0.11' kubeVersion: '>=1.11' keywords: - mongodb diff --git a/helm_chart/templates/crds.yaml b/helm_chart/templates/crds.yaml index 3bd6fe6..fb66f39 100644 --- a/helm_chart/templates/crds.yaml +++ b/helm_chart/templates/crds.yaml @@ -1,8 +1,4 @@ {{ if eq .Values.createCrds true}} ---- -# Source: mongodb-enterprise-operator/templates/crds.yaml - - --- apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition @@ -18,6 +14,23 @@ spec: shortNames: - mdb singular: mongodb + additionalPrinterColumns: + - name: Type + type: string + description: "The type of MongoDB deployment. One of 'ReplicaSet', 'ShardedCluster' and 'Standalone'." + JSONPath: .spec.type + - name: State + type: string + description: The current state of the MongoDB deployment. + JSONPath: .status.phase + - name: Version + type: string + description: The version of MongoDB. + JSONPath: .spec.version + - name: Age + type: date + description: The time since the MongoDB resource was created. + JSONPath: .metadata.creationTimestamp validation: # there are 3 possible schemas, ReplicaSet, ShardedCluster and Standalone openAPIV3Schema: oneOf: @@ -37,6 +50,17 @@ spec: type: type: string pattern: "^Standalone$" + additionalMongodConfig: + properties: + net: + properties: + ssl: + properties: + mode: + type: string + enum: ["disabled", "allowSSL", "preferSSL", "requireSSL", "allowTLS", "preferTLS", "requireTLS"] + exposedExternally: + type: boolean required: - credentials - project @@ -62,6 +86,17 @@ spec: type: type: string pattern: "^ReplicaSet$" + additionalMongodConfig: + properties: + net: + properties: + ssl: + properties: + mode: + type: string + enum: ["disabled", "allowSSL", "preferSSL", "requireSSL", "allowTLS", "preferTLS", "requireTLS"] + exposedExternally: + type: boolean required: - credentials - project @@ -98,6 +133,17 @@ spec: type: type: string pattern: "^ShardedCluster$" + additionalMongodConfig: + properties: + net: + properties: + ssl: + properties: + mode: + type: string + enum: ["disabled", "allowSSL", "preferSSL", "requireSSL", "allowTLS", "preferTLS", "requireTLS"] + exposedExternally: + type: boolean required: - credentials - project diff --git a/helm_chart/templates/operator.yaml b/helm_chart/templates/operator.yaml index 514a294..9e0e828 100644 --- a/helm_chart/templates/operator.yaml +++ b/helm_chart/templates/operator.yaml @@ -19,7 +19,7 @@ spec: serviceAccountName: {{ .Values.operator.name }} containers: - name: {{ .Values.operator.name }} - image: {{ .Values.registry.repository }}/mongodb-enterprise-operator:{{ .Values.operator.version }} + image: {{ .Values.registry.repository }}/{{ .Values.operator.name }}:{{ .Values.operator.version }} imagePullPolicy: {{ .Values.registry.pullPolicy }} {{ if .Values.registry.imagePullSecrets}} imagePullSecrets: @@ -41,7 +41,7 @@ spec: value: 'true' {{ end }} - name: MONGODB_ENTERPRISE_DATABASE_IMAGE - value: {{ .Values.registry.repository }}/mongodb-enterprise-database:{{ .Values.operator.version }} + value: {{ .Values.registry.repository }}/{{ .Values.database.name }}:{{ .Values.operator.version }} - name: IMAGE_PULL_POLICY value: {{ .Values.registry.pullPolicy }} {{ if .Values.registry.imagePullSecrets }} diff --git a/helm_chart/templates/roles.yaml b/helm_chart/templates/roles.yaml index d21fec3..93d4f5c 100644 --- a/helm_chart/templates/roles.yaml +++ b/helm_chart/templates/roles.yaml @@ -24,13 +24,24 @@ rules: - apps resources: - statefulsets - verbs: ["*"] + verbs: + - create + - get + - list + - watch + - delete + - update - apiGroups: - mongodb.com resources: - - "*" + - mongodb + - mongodb/finalizers verbs: - - "*" + - get + - list + - watch + - delete + - update --- kind: {{ if .Values.operator.watchNamespace }} {{ if (eq .Values.operator.watchNamespace "*") }} ClusterRoleBinding {{ else }} RoleBinding {{ end }} {{ else }} RoleBinding {{ end }} @@ -50,3 +61,38 @@ subjects: {{ if .Values.namespace }} namespace: {{ .Values.namespace }} {{ end }} + +# This ClusterRole is needed if the user wants to use the Kubernetes CA +# infrastructure to generate certificates. +{{ if .Values.needsCAInfrastructure }} +--- +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: {{ .Values.operator.name }}-{{ .Values.namespace }}-certs +rules: +- apiGroups: + - certificates.k8s.io + resources: + - certificatesigningrequests + verbs: + - get + - create + - list + +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: {{ .Values.operator.name }}-{{ .Values.namespace }}-certs-binding + namespace: {{ .Values.namespace }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ .Values.operator.name }}-{{ .Values.namespace }}-certs +subjects: +- kind: ServiceAccount + name: {{ .Values.operator.name }} + namespace: {{ .Values.namespace }} + +{{ end }} diff --git a/helm_chart/values.yaml b/helm_chart/values.yaml index afb91fb..2dbdb71 100644 --- a/helm_chart/values.yaml +++ b/helm_chart/values.yaml @@ -16,10 +16,17 @@ operator: name: mongodb-enterprise-operator # Version of mongodb-enterprise-operator and mongodb-enterprise-database images - version: '0.10' + version: '0.11' + +database: + name: mongodb-enterprise-database registry: # Specify if images are pulled from private repository imagePullSecrets: pullPolicy: Always repository: quay.io/mongodb + +# Set this to true if the operator will require Kubernetes CA +# infrastructure to generate TLS certificates. +needsCAInfrastructure: true diff --git a/mongodb-enterprise.yaml b/mongodb-enterprise.yaml index adbd230..a350e8b 100644 --- a/mongodb-enterprise.yaml +++ b/mongodb-enterprise.yaml @@ -26,13 +26,24 @@ rules: - apps resources: - statefulsets - verbs: ["*"] + verbs: + - create + - get + - list + - watch + - delete + - update - apiGroups: - mongodb.com resources: - - "*" + - mongodb + - mongodb/finalizers verbs: - - "*" + - get + - list + - watch + - delete + - update --- kind: RoleBinding @@ -52,6 +63,41 @@ subjects: namespace: mongodb + +# This ClusterRole is needed if the user wants to use the Kubernetes CA +# infrastructure to generate certificates. + +--- +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-enterprise-operator-mongodb-certs +rules: +- apiGroups: + - certificates.k8s.io + resources: + - certificatesigningrequests + verbs: + - get + - create + - list + +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-enterprise-operator-mongodb-certs-binding + namespace: mongodb +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: mongodb-enterprise-operator-mongodb-certs +subjects: +- kind: ServiceAccount + name: mongodb-enterprise-operator + namespace: mongodb + + --- # Source: mongodb-enterprise-operator/templates/serviceaccount.yaml --- @@ -85,7 +131,7 @@ spec: serviceAccountName: mongodb-enterprise-operator containers: - name: mongodb-enterprise-operator - image: quay.io/mongodb/mongodb-enterprise-operator:0.10 + image: quay.io/mongodb/mongodb-enterprise-operator:0.11 imagePullPolicy: Always env: @@ -99,7 +145,7 @@ spec: - name: MONGODB_ENTERPRISE_DATABASE_IMAGE - value: quay.io/mongodb/mongodb-enterprise-database:0.10 + value: quay.io/mongodb/mongodb-enterprise-database:0.11 - name: IMAGE_PULL_POLICY value: Always diff --git a/samples/extended/replica-set.yaml b/samples/extended/replica-set-persistent-volumes.yaml similarity index 98% rename from samples/extended/replica-set.yaml rename to samples/extended/replica-set-persistent-volumes.yaml index 34c6d37..2c1fd8b 100644 --- a/samples/extended/replica-set.yaml +++ b/samples/extended/replica-set-persistent-volumes.yaml @@ -3,7 +3,6 @@ apiVersion: mongodb.com/v1 kind: MongoDB metadata: name: my-replica-set - namespace: mongodb spec: members: 3 version: 4.0.0 diff --git a/samples/extended/replica-set-tls.yaml b/samples/extended/replica-set-tls.yaml new file mode 100644 index 0000000..1e4c4f1 --- /dev/null +++ b/samples/extended/replica-set-tls.yaml @@ -0,0 +1,37 @@ +--- +apiVersion: mongodb.com/v1 +kind: MongoDB +metadata: + name: my-tls-enabled-rs +spec: + type: ReplicaSet + + members: 3 + version: 4.0.4 + + project: my-project + credentials: my-credentials + + # look into `replica-set-persistent-volumes.yaml` for an example on how to use + # Kubernetes Persistent Volumes in your MDB deployment. + persistent: false + + # This will create a TLS enabled Replica Set, which means that all the traffic + # between members of the Replica Set and clients, will be encrypted using TLS + # certificates. These certificates will be generated on the fly by the operator + # using the Kubernetes CA. + # Please refer to Kubernetes TLS Documentation on how to approve these certs: + # + # https://kubernetes.io/docs/tasks/tls/managing-tls-in-a-cluster/ + # + security: + tls: + enabled: true + + # The default TLS mode is 'requireTLS' but it can be customized using the + # the `additionalMongodConfig` structure. Please find more information here: + # https://docs.mongodb.com/manual/reference/configuration-options/#net.ssl.mode + additionalMongodConfig: + net: + ssl: + mode: "preferSSL" diff --git a/samples/extended/sharded-cluster.yaml b/samples/extended/sharded-cluster-persistent-volumes.yaml similarity index 98% rename from samples/extended/sharded-cluster.yaml rename to samples/extended/sharded-cluster-persistent-volumes.yaml index d93f13f..6e4352f 100644 --- a/samples/extended/sharded-cluster.yaml +++ b/samples/extended/sharded-cluster-persistent-volumes.yaml @@ -3,7 +3,6 @@ apiVersion: mongodb.com/v1 kind: MongoDB metadata: name: my-sharded-cluster - namespace: mongodb spec: shardCount: 2 mongodsPerShardCount: 3 diff --git a/samples/extended/sharded-cluster-tls.yaml b/samples/extended/sharded-cluster-tls.yaml new file mode 100644 index 0000000..5547426 --- /dev/null +++ b/samples/extended/sharded-cluster-tls.yaml @@ -0,0 +1,31 @@ +--- +apiVersion: mongodb.com/v1 +kind: MongoDB +metadata: + name: my-sharded-cluster +spec: + type: ShardedCluster + + shardCount: 2 + mongodsPerShardCount: 3 + mongosCount: 2 + configServerCount: 3 + + version: 4.0.6 + + project: my-project + credentials: my-credentials + + persistent: false + + # This will create a TLS enabled Sharded Cluster, which means that + # all the traffic between Shards and clients will be encrypted using + # TLS certificates. These certificates will be generated on the fly + # by the operator using the Kubernetes CA. Please refer to + # Kubernetes TLS Documentation on how to approve these certs: + # + # https://kubernetes.io/docs/tasks/tls/managing-tls-in-a-cluster/ + # + security: + tls: + enabled: true diff --git a/samples/extended/standalone.yaml b/samples/extended/standalone-persistent-volumes.yaml similarity index 98% rename from samples/extended/standalone.yaml rename to samples/extended/standalone-persistent-volumes.yaml index 78854b1..ff064b5 100644 --- a/samples/extended/standalone.yaml +++ b/samples/extended/standalone-persistent-volumes.yaml @@ -2,7 +2,6 @@ apiVersion: mongodb.com/v1 kind: MongoDB metadata: name: my-standalone - namespace: mongodb spec: version: 4.0.0 service: my-service diff --git a/samples/extended/standalone-tls.yaml b/samples/extended/standalone-tls.yaml new file mode 100644 index 0000000..7a6fdfa --- /dev/null +++ b/samples/extended/standalone-tls.yaml @@ -0,0 +1,24 @@ +apiVersion: mongodb.com/v1 +kind: MongoDB +metadata: + name: my-tls-standalone +spec: + version: 4.0.0 + + project: my-project + credentials: my-credentials + type: Standalone + + persistent: true + + # This will create a TLS enabled Standalone which means that the + # traffic will be encrypted using TLS certificates. These + # certificates will be generated on the fly by the operatror using + # the Kubernetes CA. + # Please refer to Kubernetes TLS Documentation on how to approve these certs: + # + # https://kubernetes.io/docs/tasks/tls/managing-tls-in-a-cluster/ + # + security: + tls: + enabled: true diff --git a/samples/kubernetes-clients/python/mongodb_kube_client.py b/samples/kubernetes-clients/python/mongodb_kube_client.py index 837c0f0..3d3e9b9 100644 --- a/samples/kubernetes-clients/python/mongodb_kube_client.py +++ b/samples/kubernetes-clients/python/mongodb_kube_client.py @@ -101,12 +101,12 @@ def deploy_standalone(self, mongo_version, name): group = 'mongodb.com' version = 'v1' - plural = 'mongodbstandalones' + plural = 'mongodb' body = {"spec": {"persistent": False, "version": str(mongo_version), "credentials": "my-credentials", "project": "my-project"}, - "kind": "MongoDbStandalone", "apiVersion": "mongodb.com/v1", + "kind": "MongoDB", "apiVersion": "mongodb.com/v1", "metadata": {"name": name, "namespace": self.namespace}} try: @@ -122,12 +122,12 @@ def deploy_replica_set(self, mongo_version, name, members=3): group = 'mongodb.com' version = 'v1' - plural = 'mongodbreplicasets' + plural = 'mongodb' body = {"spec": {"members": members, "persistent": False, "version": str(mongo_version), "credentials": "my-credentials", "project": "my-project"}, - "kind": "MongoDbReplicaSet", "apiVersion": "mongodb.com/v1", + "kind": "MongoDB", "apiVersion": "mongodb.com/v1", "metadata": {"name": name, "namespace": self.namespace}} try: @@ -145,14 +145,14 @@ def deploy_sharded_cluster(self, mongo_version, name, num_shards, num_mongos, nu group = 'mongodb.com' version = 'v1' - plural = 'mongodbshardedclusters' + plural = 'mongodb' body = {"spec": {"shardCount": num_shards, "mongodsPerShardCount": num_mongod_per_shard, "mongosCount": num_mongos, "persistent": False, "version": mongo_version, "configServerCount": num_cfg_rs_members, "credentials": "my-credentials", "project": "my-project"}, - "kind": "MongoDbShardedCluster", "apiVersion": "mongodb.com/v1", + "kind": "MongoDB", "apiVersion": "mongodb.com/v1", "metadata": {"name": name, "namespace": self.namespace}} try: @@ -164,8 +164,6 @@ def deploy_sharded_cluster(self, mongo_version, name, num_shards, num_mongos, nu def delete_mongo_process(self, name, type_plural): ''' Delete MongoDB deployments by name and type - - type_plural can be: "mongodbstandalones", "mongodbreplicasets" or "mongodbshardedclusters" ''' group = 'mongodb.com' diff --git a/samples/kubernetes-clients/python/test_mongodb_kube_client.py b/samples/kubernetes-clients/python/test_mongodb_kube_client.py index f73c872..61dcf01 100644 --- a/samples/kubernetes-clients/python/test_mongodb_kube_client.py +++ b/samples/kubernetes-clients/python/test_mongodb_kube_client.py @@ -45,11 +45,11 @@ def main(): ''' # Delete the created deployments - kube_client.delete_mongo_process(name="my-standalone", type_plural="mongodbstandalones") + kube_client.delete_mongo_process(name="my-standalone", type_plural="mongodb") - kube_client.delete_mongo_process(name="my-replica-set", type_plural="mongodbreplicasets") + kube_client.delete_mongo_process(name="my-replica-set", type_plural="mongodb") - kube_client.delete_mongo_process(name="my-sharded-cluster", type_plural="mongodbshardedclusters") + kube_client.delete_mongo_process(name="my-sharded-cluster", type_plural="mongodb") ''' diff --git a/samples/minimal/replica-set.yaml b/samples/minimal/replica-set.yaml index 38d0ee8..3df122d 100644 --- a/samples/minimal/replica-set.yaml +++ b/samples/minimal/replica-set.yaml @@ -1,24 +1,14 @@ -# -# This is a minimal config. To see all the options available, refer to the -# "extended" directory -# --- apiVersion: mongodb.com/v1 kind: MongoDB metadata: name: my-replica-set spec: - members: 1 + members: 3 version: 4.0.0 type: ReplicaSet - # Before you create this object, you'll need to create a project ConfigMap and a - # credentials Secret. For instructions on how to do this, please refer to our - # documentation, here: - # https://docs.opsmanager.mongodb.com/current/tutorial/install-k8s-operator + project: my-project credentials: my-credentials - # This flag allows the creation of pods without persistent volumes. This is for - # testing only, and must not be used in production. 'false' will disable - # Persistent Volume Claims. The default is 'true' persistent: false diff --git a/samples/minimal/sharded-cluster.yaml b/samples/minimal/sharded-cluster.yaml index d866db5..ee98c27 100644 --- a/samples/minimal/sharded-cluster.yaml +++ b/samples/minimal/sharded-cluster.yaml @@ -4,17 +4,16 @@ # --- apiVersion: mongodb.com/v1 -kind: MongoDbShardedCluster +kind: MongoDB metadata: name: my-sharded-cluster - namespace: mongodb spec: shardCount: 2 mongodsPerShardCount: 3 mongosCount: 2 configServerCount: 3 version: 4.0.0 - + type: ShardedCluster # Before you create this object, you'll need to create a project ConfigMap and a # credentials Secret. For instructions on how to do this, please refer to our # documentation, here: