Skip to content

Commit e413225

Browse files
author
Rodrigo Valin
authored
Merge branch 'master' into patch-1
2 parents b1898e6 + a605aa1 commit e413225

File tree

81 files changed

+3236
-2020
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+3236
-2020
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
### All Submissions:
2+
3+
* [ ] Have you opened an Issue before filing this PR?
4+
* [ ] Have you signed our [CLA](https://www.mongodb.com/legal/contributor-agreement)?
5+
* [ ] Have you checked to ensure there aren't other open [Pull Requests](../../../pulls) for the same update/change?
6+
* [ ] Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if such).
7+

README.md

Lines changed: 60 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,41 @@
11
# MongoDB Enterprise Kubernetes Operator #
22

3-
Welcome to the MongoDB Enterprise Kubernetes Operator. The Operator enables easy deploys of MongoDB into Kubernetes clusters, using our management, monitoring and backup platforms, Ops Manager and Cloud Manager. By installing this integration, you will be able to deploy MongoDB instances with a single simple command.
3+
Welcome to the MongoDB Enterprise Kubernetes Operator. The Operator enables easy deploy of the following applications into Kubernetes clusters:
4+
* MongoDB - Replica Sets, Sharded Clusters and Standalones, with authentication, TLS and many more options.
5+
* Ops Manager - our enterprise management, monitoring and backup platform for MongoDB. The Operator can install and manage Ops Manager in Kubernetes for you.
46

5-
Also the Operator allows to deploy Ops Manager into Kubernetes. Note, that currently this feature is **beta**. See more information below.
7+
The Operator requires access to one of our database management tools - Ops Manager or Cloud Manager - to deploy MongoDB instances.
8+
You may run Ops Manager either inside or outside Kubernetes, or may use Cloud Manager (cloud.mongodb.com) instead.
69

7-
You can discuss this integration in our [Slack](https://community-slack.mongodb.com) - join the [#enterprise-kubernetes](https://mongo-db.slack.com/messages/CB323LCG5/) channel.
10+
The Operator is currently Generally Available, supported by the [MongoDB Support Team](https://support.mongodb.com/). If you need urgent help, please file a support ticket.
11+
For non-urgent requests, you may file a Github Issue here in the repo.
12+
13+
You can discuss this integration in our new [Community Forum](https://community.mongodb.com/) - please use the tag [enterprise-kubernetes-operator](https://community.mongodb.com/tags/enterprise-kubernetes-operator).
814

915
## Documentation ##
1016

1117
[Install Kubernetes Operator](https://docs.opsmanager.mongodb.com/current/tutorial/install-k8s-operator)
1218

13-
[Deploy Standalone](https://docs.opsmanager.mongodb.com/current/tutorial/deploy-standalone)
14-
15-
[Deploy Replica Set](https://docs.opsmanager.mongodb.com/current/tutorial/deploy-replica-set)
19+
[Deploy MongoDB](https://docs.mongodb.com/kubernetes-operator/stable/mdb-resources/)
1620

17-
[Deploy Sharded Cluster](https://docs.opsmanager.mongodb.com/current/tutorial/deploy-sharded-cluster)
21+
[Deploy Ops Manager](https://docs.mongodb.com/kubernetes-operator/stable/om-resources/)
1822

19-
[Edit Deployment](https://docs.opsmanager.mongodb.com/current/tutorial/edit-deployment)
23+
[MongoDB Resource Specification](https://docs.opsmanager.mongodb.com/current/reference/k8s-operator-specification)
2024

21-
[Kubernetes Resource Specification](https://docs.opsmanager.mongodb.com/current/reference/k8s-operator-specification)
25+
[Ops Manager Resource Specification](https://docs.mongodb.com/kubernetes-operator/stable/reference/k8s-operator-om-specification/)
2226

2327
[Troubleshooting Kubernetes Operator](https://docs.opsmanager.mongodb.com/current/reference/troubleshooting/k8s/)
2428

25-
[Known Issues for Kubernetes Operator](https://docs.opsmanager.mongodb.com/current/reference/known-issues-k8s-beta)
29+
[Known Issues for Kubernetes Operator](https://docs.mongodb.com/kubernetes-operator/stable/reference/known-issues/)
2630

2731
## Requirements ##
2832

29-
The MongoDB Enterprise Operator is compatible with Kubernetes v1.13 and above. It has been tested against Openshift 3.11.
33+
Please refer to the [Installation Instructions](https://docs.mongodb.com/kubernetes-operator/stable/tutorial/plan-k8s-operator-install/)
34+
to see which Kubernetes and Openshift versions the Operator is compatible with
3035

31-
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.
36+
To work with MongoDB resource this Operator requires [Ops Manager](https://docs.opsmanager.mongodb.com/current/) (Ops Manager can
37+
be installed into the same Kubernetes cluster by the Operator or installed outside of the cluster manually)
38+
or [Cloud Manager](https://cloud.mongodb.com/user#/cloud/login).
3239
> If this is your first time trying the Operator, Cloud Manager is easier to get started
3340
3441

@@ -56,7 +63,7 @@ This will create a new `crd` in your cluster, `MongoDB`. This new object will be
5663

5764
#### Operator Installation
5865

59-
* In order to install the Operator in OpenShift, please follow [these](openshift-install.md) instructions instead.
66+
> In order to install the Operator in OpenShift, please follow [these](openshift-install.md) instructions instead.
6067
6168
This operator can also be installed using yaml files, in case you are not using Helm. You may apply the config directly from github clone this repo, and apply the file
6269

@@ -82,7 +89,7 @@ You need to specify the image pull secret name using `--set registry.imagePullSe
8289

8390
Check the end of the page for instructions on how to remove the Operator.
8491

85-
## MongoDB object ##
92+
## MongoDB Resource ##
8693

8794
*This section describes how to create the MongoDB resource. Follow the next section on how to work with Ops Manager resource.*
8895

@@ -91,19 +98,19 @@ Check the end of the page for instructions on how to remove the Operator.
9198
For the Operator to work, you will need the following information:
9299

93100
* Base URL - the URL of an Ops Manager instance (for Cloud Manager use `https://cloud.mongodb.com`)
94-
* (optionally) Project Name - the name of an Ops Manager Project where MongoDBs will be deployed into. It will be
95-
created by the Operator if it doesn't exist (and this is the recommended way instead of reusing the project created
101+
* (optionally) Project Name - the name of an Ops Manager Project where MongoDBs will be deployed into. It will be
102+
created by the Operator if it doesn't exist (and this is the recommended way instead of reusing the project created
96103
in OpsManager directly). If omitted the name of the MongoDB resource will be used as a project name.
97104
* (optionally) Organization ID - the ID of the organization which the Project belongs to. The Operator will create
98105
an Organization with the same name as the Project if Organization ID is omitted.
99106
* API Credentials. This can be any pair of:
100-
** Public and Private Programmatic API keys. They correspond to `user` and `publicApiKey` fields in the Secret storing
101-
credentials. More information about the way to create them using Ops Manager UI can be found
107+
* Public and Private Programmatic API keys. They correspond to `user` and `publicApiKey` fields in the Secret storing
108+
credentials. More information about the way to create them using Ops Manager UI can be found
102109
[here](https://docs.opsmanager.mongodb.com/current/tutorial/configure-public-api-access/#programmatic-api-keys)
103-
** Username and Public API key. More information about the way to create them using Ops Manager UI can be found
110+
* Username and Public API key. More information about the way to create them using Ops Manager UI can be found
104111
[here](https://docs.opsmanager.mongodb.com/current/tutorial/configure-public-api-access/#personal-api-keys-deprecated)
105112

106-
Note that you must whitelist the IP
113+
Note that you must whitelist the IP
107114
range of your Kubernetes cluster so that the Operator could make API requests to Ops Manager
108115

109116
This is documented in greater detail in our [installation guide](https://docs.opsmanager.mongodb.com/current/tutorial/install-k8s-operator)
@@ -122,53 +129,53 @@ metadata:
122129
name: my-project
123130
namespace: mongodb
124131
data:
125-
projectName: myProjectName
132+
projectName: myProjectName # this is an optional parameter
126133
orgId: 5b890e0feacf0b76ff3e7183 # this is an optional parameter
127134
baseUrl: https://my-ops-manager-or-cloud-manager-url
128135
```
129136
> Note, that if `orgId` is skipped then the new organization named `projectName` will be automatically created and new
130137
project will be added there.
138+
> If `projectName` is skipped the project created in Ops Manager will get the same name as the MongoDB object
131139
132140
Apply this file to create the new `Project`:
133141

134142
kubectl apply -f my-project.yaml
135143

136144
### Credentials ###
137145

138-
For a user to be able to create or update objects in this Ops Manager Project they need a Public API Key. These will be held by Kubernetes as a `Secret` object. You can create this Secret with the following command:
146+
For a user to be able to create or update objects in this Ops Manager Project they need either a Public API Key or a
147+
Programmatic API Key. These will be held by Kubernetes as a `Secret` object. You can create this Secret with the following command:
139148

140149
``` bash
141150
$ kubectl -n mongodb create secret generic my-credentials --from-literal="[email protected]" --from-literal="publicApiKey=my-public-api-key"
142151
```
143152

144-
### Creating a MongoDB Object ###
153+
### Creating a MongoDB Resource ###
145154

146-
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/mongodb/minimal/replicaset.yaml`.
155+
A MongoDB resource 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/mongodb/minimal/replica-set.yaml`.
147156

148157
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.
149158

150-
kubectl apply -f samples/mongodb/minimal/replicaset.yaml
159+
kubectl apply -f samples/mongodb/minimal/replica-set.yaml
151160

152-
## Ops Manager object (Beta) ##
161+
## MongoDBOpsManager Resource ##
153162

154-
This section describes how to create the Ops Manager object in Kubernetes. Note, that this requires all
163+
This section describes how to create the Ops Manager Custom Resource in Kubernetes. Note, that this requires all
155164
the CRDs and the Operator application to be installed as described above.
156165

157-
*Disclaimer: this is an early release of Ops Manager - so it's not recommended to use it in production*
158-
159166
### Create Admin Credentials Secret ###
160167

161-
Before creating the Ops Manager object you need to prepare the information about the admin user which will be
168+
Before creating the Ops Manager resource you need to prepare the information about the admin user which will be
162169
created automatically in Ops Manager. You can use the following command to do it:
163170

164171
```bash
165172
$ kubectl create secret generic ops-manager-admin-secret --from-literal=Username="[email protected]" --from-literal=Password="Passw0rd." --from-literal=FirstName="Jane" --from-literal=LastName="Doe" -n <namespace>
166173
```
167174

168175
Note, that the secret is needed only during the initialization of the Ops Manager object - you can remove it or
169-
clean the password field after the Ops Manager object was created
176+
change the password using Ops Manager UI after the Ops Manager object was created
170177

171-
### Create Ops Manager Object ###
178+
### Create MongoDBOpsManager Resource ###
172179

173180
Use the file `samples/ops-manager/ops-manager.yaml`. Edit the fields and create the object in Kubernetes:
174181

@@ -178,30 +185,44 @@ $ kubectl apply -f samples/ops-manager/ops-manager.yaml
178185

179186
Note, that it takes up to 8 minutes to initialize the Application Database and start Ops Manager.
180187

181-
### (Optionally) Create a MongoDB Object Referencing the New Ops Manager
188+
### (Optionally) Create a MongoDB Resource Referencing the MongoDBOpsManager
182189

183190
Now you can use the Ops Manager application to create MongoDB objects. You need to follow the
184-
[instructions](https://docs.mongodb.com/kubernetes-operator/stable/tutorial/install-k8s-operator/#onprem-prerequisites)
185-
to prepare keys and enable network access to Ops Manager.
191+
[instructions](https://docs.mongodb.com/kubernetes-operator/stable/tutorial/create-operator-credentials/#prerequisites)
192+
to prepare keys and enable network access to Ops Manager.
193+
Then you need to perform the standard steps necessary to create MongoDB resource:
194+
* Create a [credentials Secret](https://docs.mongodb.com/kubernetes-operator/stable/tutorial/create-operator-credentials/#create-k8s-credentials)
195+
* Create a [connection ConfigMap](https://docs.mongodb.com/kubernetes-operator/stable/tutorial/create-project-using-configmap/)
196+
* Note, that you should use the value from `status.opsManager.url` in MongoDBOpsManager Resource as a value for `baseUrl` field in the ConfigMap
197+
198+
## Accessing Ops Manager UI (from a browser)
186199

187-
In order to access Ops Manager UI, from outside the Kubernetes cluster (from browser), make sure you enable
188-
`spec.externalConnectivity` in the Ops Manager resource definition.
200+
In order to access Ops Manager UI, from outside the Kubernetes cluster (from a browser), make sure you enable
201+
`spec.externalConnectivity` in the Ops Manager resource definition. The easiest way is by configuring the LoadBalancer service type.
189202

190203
You will be able to fetch the URL to connect to Ops Manager UI from the `Service` created by the Operator.
191204

192205
## Deleting the Operator ##
193206

194-
It's important to keep correct order or removal operations. The simple rule is: **never remove Operator before mongodb resources**!
207+
It's important to keep correct order or removal operations. The simple rule is: **never remove Operator before MongoDB resources**!
195208
The reason is that the Operator cleans state in Ops Manager on deletion of the MongoDB resource in Kubernetes.
196209

197210
These are the correct steps to remove any MongoDB Operator resources:
198211

199212
```bash
200-
# these three operations must be called first!
213+
# this operation must be called first!
201214
kubectl delete mdb --all -n <namespace>
202215

203216
# any of the following commands must be called after removing all existing mongodb resources
204217
kubectl delete namespace <namespace>
205218
kubectl delete deployment mongodb-enterprise-operator -n <namespace>
206219
kubectl delete crd/mongodb.mongodb.com
220+
kubectl delete crd/opsmanagers.mongodb.com
221+
kubectl delete crd/mongodbusers.mongodb.com
207222
```
223+
224+
## Contributing
225+
226+
Please file issues before filing PRs. For PRs to be accepted, contributors must sign our [CLA](https://www.mongodb.com/legal/contributor-agreement).
227+
228+
Reviewers, please ensure that the CLA has been signed by referring to [the contributors tool](https://contributors.corp.mongodb.com/) (internal link).

0 commit comments

Comments
 (0)