Skip to content

Commit 1ccde1f

Browse files
author
Anton Lisovenko
committed
860c4d6a7b0759784a062cdd59faace755d11ebf: update public repo contents
1 parent cf97231 commit 1ccde1f

13 files changed

+226
-13
lines changed

README.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
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.
44

5+
Also the Operator allows to deploy Ops Manager into Kubernetes. Note, that currently this feature is **alpha**. See more information below.
6+
57
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.
68

79
## Documentation ##
@@ -77,7 +79,11 @@ You can customize installation by simple overriding of helm variables, for examp
7779

7880
Check the end of the page for instructions on how to remove the Operator.
7981

80-
## Adding Ops Manager Credentials ##
82+
## MongoDB object ##
83+
84+
*This section describes how to create the MongoDB resource. Follow the next section on how to work with Ops Manager resource.*
85+
86+
### Adding Ops Manager Credentials ###
8187

8288
For the Operator to work, you will need the following information:
8389

@@ -131,7 +137,34 @@ If you have a correctly created Project with the name `my-project` and Credentia
131137

132138
kubectl apply -f samples/minimal/replicaset.yaml
133139

134-
### Correct order of Operator/Namespace removal
140+
## Ops Manager object (alpha) ##
141+
142+
This section describes how to create the Ops Manager object in Kubernetes.
143+
144+
*Disclaimer: this is an early release of Ops Manager - so it's not recommended to use it in production *
145+
146+
### Create Admin Credentials Secret ###
147+
148+
Before creating the Ops Manager object you need to prepare the information about the admin user which will be created automatically. You can use the following command to do it:
149+
150+
```bash
151+
$ 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>
152+
```
153+
154+
Note, that the secret is needed only during the initialization of the Ops Manager object - you can remove it or clean the password field after the Ops Manager object was created
155+
156+
### Create Ops Manager object ###
157+
158+
Use the file `samples/ops-manager/ops-manager.yaml`. Edit the fields and create the object in Kubernetes:
159+
160+
```bash
161+
$ kubectl apply -f samples/ops-manager/ops-manager.yaml
162+
```
163+
164+
Note, that it takes up to 10 minutes to initialize the Application Database and start Ops Manager.
165+
166+
167+
## Deleting the Operator ##
135168

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

crds.yaml

Lines changed: 72 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ spec:
4545
type: string
4646
version:
4747
type: string
48-
pattern: "^[0-9]+.[0-9]+.[0-9]+(-ent)?$"
48+
pattern: "^[0-9]+.[0-9]+.[0-9]+(-.+)?$"
4949
logLevel:
5050
type: string
5151
enum: ["DEBUG", "INFO", "WARN", "ERROR", "FATAL"]
@@ -91,7 +91,7 @@ spec:
9191
type: string
9292
version:
9393
type: string
94-
pattern: "^[0-9]+.[0-9]+.[0-9]+(-ent)?$"
94+
pattern: "^[0-9]+.[0-9]+.[0-9]+(-.+)?$"
9595
logLevel:
9696
type: string
9797
enum: ["DEBUG", "INFO", "WARN", "ERROR", "FATAL"]
@@ -151,7 +151,7 @@ spec:
151151
type: string
152152
version:
153153
type: string
154-
pattern: "^[0-9]+.[0-9]+.[0-9]+(-ent)?$"
154+
pattern: "^[0-9]+.[0-9]+.[0-9]+(-.+)?$"
155155
logLevel:
156156
type: string
157157
enum: ["DEBUG", "INFO", "WARN", "ERROR", "FATAL"]
@@ -239,4 +239,73 @@ spec:
239239
- username
240240
- db
241241
- project
242+
---
243+
apiVersion: apiextensions.k8s.io/v1beta1
244+
kind: CustomResourceDefinition
245+
metadata:
246+
name: opsmanagers.mongodb.com
247+
spec:
248+
group: mongodb.com
249+
version: v1
250+
scope: Namespaced
251+
names:
252+
kind: MongoDBOpsManager
253+
plural: opsmanagers
254+
shortNames:
255+
- om
256+
singular: opsmanager
257+
additionalPrinterColumns:
258+
- name: Version
259+
type: string
260+
description: The version of MongoDBOpsManager.
261+
JSONPath: .spec.version
262+
- name: Version (DB)
263+
type: string
264+
description: The version of Application Database .
265+
JSONPath: .spec.applicationDatabase.version
266+
- name: State
267+
type: string
268+
description: The current state of the MongoDBOpsManager.
269+
JSONPath: .status.opsManager.phase
270+
- name: State (DB)
271+
type: string
272+
description: The current state of the MongoDBOpsManager Application Database.
273+
JSONPath: .status.applicationDatabase.phase
274+
- name: Age
275+
type: date
276+
description: The time since the MongoDBOpsManager resource was created.
277+
JSONPath: .metadata.creationTimestamp
278+
validation:
279+
openAPIV3Schema:
280+
properties:
281+
spec:
282+
properties:
283+
version:
284+
type: string
285+
applicationDatabase:
286+
type: object
287+
properties:
288+
members:
289+
maximum: 50
290+
minimum: 3
291+
type: integer
292+
version:
293+
type: string
294+
pattern: "^[0-9]+.[0-9]+.[0-9]+(-.+)?$"
295+
logLevel:
296+
type: string
297+
enum: ["DEBUG", "INFO", "WARN", "ERROR", "FATAL"]
298+
type:
299+
type: string
300+
enum: ["ReplicaSet"]
301+
exposedExternally:
302+
type: boolean
303+
required:
304+
- version
305+
- type
306+
- members
307+
required:
308+
- version
309+
- applicationDatabase
310+
242311

helm_chart/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: mongodb-enterprise-operator
22
description: MongoDB Kubernetes Enterprise Operator
3-
version: '1.1'
3+
version: '1.2'
44
kubeVersion: '>=1.11'
55
keywords:
66
- mongodb

helm_chart/templates/crds.yaml

Lines changed: 72 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ spec:
4343
type: string
4444
version:
4545
type: string
46-
pattern: "^[0-9]+.[0-9]+.[0-9]+(-ent)?$"
46+
pattern: "^[0-9]+.[0-9]+.[0-9]+(-.+)?$"
4747
logLevel:
4848
type: string
4949
enum: ["DEBUG", "INFO", "WARN", "ERROR", "FATAL"]
@@ -89,7 +89,7 @@ spec:
8989
type: string
9090
version:
9191
type: string
92-
pattern: "^[0-9]+.[0-9]+.[0-9]+(-ent)?$"
92+
pattern: "^[0-9]+.[0-9]+.[0-9]+(-.+)?$"
9393
logLevel:
9494
type: string
9595
enum: ["DEBUG", "INFO", "WARN", "ERROR", "FATAL"]
@@ -149,7 +149,7 @@ spec:
149149
type: string
150150
version:
151151
type: string
152-
pattern: "^[0-9]+.[0-9]+.[0-9]+(-ent)?$"
152+
pattern: "^[0-9]+.[0-9]+.[0-9]+(-.+)?$"
153153
logLevel:
154154
type: string
155155
enum: ["DEBUG", "INFO", "WARN", "ERROR", "FATAL"]
@@ -237,4 +237,73 @@ spec:
237237
- username
238238
- db
239239
- project
240+
---
241+
apiVersion: apiextensions.k8s.io/v1beta1
242+
kind: CustomResourceDefinition
243+
metadata:
244+
name: opsmanagers.mongodb.com
245+
spec:
246+
group: mongodb.com
247+
version: v1
248+
scope: Namespaced
249+
names:
250+
kind: MongoDBOpsManager
251+
plural: opsmanagers
252+
shortNames:
253+
- om
254+
singular: opsmanager
255+
additionalPrinterColumns:
256+
- name: Version
257+
type: string
258+
description: The version of MongoDBOpsManager.
259+
JSONPath: .spec.version
260+
- name: Version (DB)
261+
type: string
262+
description: The version of Application Database .
263+
JSONPath: .spec.applicationDatabase.version
264+
- name: State
265+
type: string
266+
description: The current state of the MongoDBOpsManager.
267+
JSONPath: .status.opsManager.phase
268+
- name: State (DB)
269+
type: string
270+
description: The current state of the MongoDBOpsManager Application Database.
271+
JSONPath: .status.applicationDatabase.phase
272+
- name: Age
273+
type: date
274+
description: The time since the MongoDBOpsManager resource was created.
275+
JSONPath: .metadata.creationTimestamp
276+
validation:
277+
openAPIV3Schema:
278+
properties:
279+
spec:
280+
properties:
281+
version:
282+
type: string
283+
applicationDatabase:
284+
type: object
285+
properties:
286+
members:
287+
maximum: 50
288+
minimum: 3
289+
type: integer
290+
version:
291+
type: string
292+
pattern: "^[0-9]+.[0-9]+.[0-9]+(-.+)?$"
293+
logLevel:
294+
type: string
295+
enum: ["DEBUG", "INFO", "WARN", "ERROR", "FATAL"]
296+
type:
297+
type: string
298+
enum: ["ReplicaSet"]
299+
exposedExternally:
300+
type: boolean
301+
required:
302+
- version
303+
- type
304+
- members
305+
required:
306+
- version
307+
- applicationDatabase
308+
240309
{{end}}

helm_chart/templates/operator.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ spec:
4242
fieldRef:
4343
fieldPath: metadata.namespace
4444
{{ end }}
45+
- name: CURRENT_NAMESPACE
46+
valueFrom:
47+
fieldRef:
48+
fieldPath: metadata.namespace
4549
{{ if eq .Values.managedSecurityContext true }}
4650
- name: MANAGED_SECURITY_CONTEXT
4751
value: 'true'
@@ -50,6 +54,11 @@ spec:
5054
value: {{ .Values.registry.repository }}/{{ .Values.database.name }}:{{ .Values.operator.version }}
5155
- name: IMAGE_PULL_POLICY
5256
value: {{ .Values.registry.pullPolicy }}
57+
- name: OPS_MANAGER_IMAGE_REPOSITORY
58+
value: {{ .Values.registry.repository }}/{{ .Values.opsManager.name }}
59+
- name: OPS_MANAGER_IMAGE_PULL_POLICY
60+
value: {{ .Values.registry.pullPolicy }}
61+
5362
{{ if .Values.registry.imagePullSecrets }}
5463
- name: IMAGE_PULL_SECRETS
5564
value: {{ .Values.registry.imagePullSecrets }}

helm_chart/templates/roles.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ rules:
3737
- mongodb
3838
- mongodb/finalizers
3939
- mongodbusers
40+
- opsmanagers
41+
- opsmanagers/finalizers
4042
verbs:
4143
- get
4244
- list

helm_chart/values.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@ operator:
1616
name: mongodb-enterprise-operator
1717

1818
# Version of mongodb-enterprise-operator and mongodb-enterprise-database images
19-
version: '1.1'
19+
version: '1.2'
2020

2121
database:
2222
name: mongodb-enterprise-database
2323

24+
opsManager:
25+
name: mongodb-enterprise-ops-manager
26+
2427
registry:
2528
# Specify if images are pulled from private repository
2629
imagePullSecrets:

mongodb-enterprise.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ rules:
3939
- mongodb
4040
- mongodb/finalizers
4141
- mongodbusers
42+
- opsmanagers
43+
- opsmanagers/finalizers
4244
verbs:
4345
- get
4446
- list
@@ -139,7 +141,7 @@ spec:
139141

140142
containers:
141143
- name: mongodb-enterprise-operator
142-
image: quay.io/mongodb/mongodb-enterprise-operator:1.1
144+
image: quay.io/mongodb/mongodb-enterprise-operator:1.2
143145
imagePullPolicy: Always
144146

145147
env:
@@ -151,11 +153,20 @@ spec:
151153
fieldRef:
152154
fieldPath: metadata.namespace
153155

156+
- name: CURRENT_NAMESPACE
157+
valueFrom:
158+
fieldRef:
159+
fieldPath: metadata.namespace
154160

155161
- name: MONGODB_ENTERPRISE_DATABASE_IMAGE
156-
value: quay.io/mongodb/mongodb-enterprise-database:1.1
162+
value: quay.io/mongodb/mongodb-enterprise-database:1.2
157163
- name: IMAGE_PULL_POLICY
158164
value: Always
165+
- name: OPS_MANAGER_IMAGE_REPOSITORY
166+
value: quay.io/mongodb/mongodb-enterprise-ops-manager
167+
- name: OPS_MANAGER_IMAGE_PULL_POLICY
168+
value: Always
169+
159170

160171

161172

Binary file not shown.

samples/minimal/replica-set.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ metadata:
99
name: my-replica-set
1010
spec:
1111
members: 3
12-
version: 4.0.0
12+
version: 4.0.10
1313
type: ReplicaSet
1414

1515
project: my-project

samples/ops-manager/ops-manager.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: mongodb.com/v1
2+
kind: MongoDBOpsManager
3+
metadata:
4+
name: ops-manager
5+
spec:
6+
version: 4.2.0
7+
adminCredentials: ops-manager-admin
8+
configuration:
9+
mms.fromEmailAddr: "[email protected]"
10+
11+
applicationDatabase:
12+
members: 3
13+
version: 4.2.0
14+
persistent: true
15+
type: ReplicaSet
16+
podSpec:
17+
cpu: '0.25'

0 commit comments

Comments
 (0)