Skip to content

Commit f3d8cf3

Browse files
author
Rodrigo Valin
committed
b4bfcc08fe2f0ea36b4e53c6c0adb538f30ef935: update public repo contents
1 parent 2ad6148 commit f3d8cf3

File tree

11 files changed

+265
-47
lines changed

11 files changed

+265
-47
lines changed

LICENSE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Usage of the MongoDB Enterprise Operator for Kubernetes indicates agreement with the MongoDB Development, Test, and Evaluation Agreement
2+
https://www.mongodb.com/legal/evaluation-agreement

README.md

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,39 @@ Please note that this project is currently in beta, and is not yet recommended f
66

77
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.
88

9+
## Documentation ##
10+
11+
[Install Kubernetes Operator](https://docs.opsmanager.mongodb.com/current/tutorial/install-k8s-operator)
12+
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)
16+
17+
[Deploy Sharded Cluster](https://docs.opsmanager.mongodb.com/current/tutorial/deploy-sharded-cluster)
18+
19+
[Edit Deployment](https://docs.opsmanager.mongodb.com/current/tutorial/edit-deployment)
20+
21+
[Kubernetes Resource Specification](https://docs.opsmanager.mongodb.com/current/reference/k8s-operator-specification)
22+
23+
[Known Issues for Kubernetes Operator](https://docs.opsmanager.mongodb.com/current/reference/known-issues-k8s-beta)
24+
925
## Requirements ##
1026

1127
The MongoDB Enterprise Operator is compatible with Kubernetes v1.9 and above. It has been tested against Openshift 3.9.
1228

13-
This Operator requires Ops Manager or Cloud Manager. In this document, when we refer to "Ops Manager", Cloud Manager may also be used.
29+
This Operator requires Ops Manager or Cloud Manager. In this document, when we refer to "Ops Manager", you may substitute "Cloud Manager". The functionality is the same.
30+
31+
32+
33+
## Installation install ##
34+
35+
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
36+
37+
kubectl apply -f https://raw.githubusercontent.com/mongodb/mongodb-enterprise-kubernetes/master/mongodb-enterprise.yaml
38+
39+
or clone this repo, make any edits you need, and apply it from your machine.
40+
41+
kubectl apply -f mongodb-enterprise.yaml
1442

1543

1644
## Helm Installation ##
@@ -20,11 +48,6 @@ If you have an Helm installation in your Kubernetes cluster, you can run:
2048
helm install helm_chart/ --name mongodb-enterprise
2149

2250

23-
## Non-Helm install ##
24-
25-
This operator can also be installed using yaml files, in case you are not using Helm.
26-
27-
kubectl apply -f mongodb-enterprise.yaml
2851

2952

3053
## Adding Ops Manager Credentials ##
@@ -36,13 +59,14 @@ For the Operator to work, you will need the following information:
3659
* User - an Ops Manager username
3760
* Public API Key - an Ops Manager Public API Key. Note that you must whitelist the IP range of your Kubernetes cluster so that the Operator may make requests to Ops Manager using this API Key.
3861

62+
This is documented in greater detail in our [installation guide](https://docs.opsmanager.mongodb.com/current/tutorial/install-k8s-operator)
63+
64+
3965
### Projects ###
4066

4167
A `Project` object is a Kubernetes `ConfigMap` that points to an Ops Manager installation and a `Project`. This `ConfigMap` has the following structure:
4268

43-
4469
```
45-
4670
$ cat my-project.yaml
4771
---
4872
apiVersion: v1
@@ -51,8 +75,8 @@ metadata:
5175
name: my-project
5276
namespace: mongodb
5377
data:
54-
projectId: my-project-id
55-
baseUrl: https://my-ops-cloud-manager-url
78+
projectId: my-project-id # get this from Ops Manager
79+
baseUrl: https://my-ops-manager-or-cloud-manager-url
5680
```
5781

5882
Apply this file to create the new `Project`:
@@ -89,29 +113,10 @@ We can't see the contents of the `Secret`, because it is a secret!
89113
This is good, it will allow us to maintain a separation between our
90114
users.
91115

92-
### Creating MongoDB Object ###
93-
94-
A MongoDB object in Kubernetes can be a Standalone, a Replica Set or a Sharded Cluster. We are going to create a Replica Set to test that everything is working as expected. There is a ReplicaSet creation yaml file in the `samples/` directory. The contents of this file are as follows:
95-
96-
``` yaml
97-
---
98-
apiVersion: mongodb.com/v1
99-
kind: MongoDbReplicaSet
100-
metadata:
101-
name: my-replica-set
102-
namespace: mongodb
103-
spec:
104-
members: 3
105-
version: 3.6.5
106-
107-
persistent: false # For testing, create Pods with NO persistent volumes.
108-
109-
project: my-project
110-
credentials: my-credentials
111-
112-
```
116+
### Creating a MongoDB Object ###
113117

114-
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 now and a new Replica Set with 3 members should soon appear in Ops Manager UI.
118+
A MongoDB object in Kubernetes can be a MongoDBStandalone, a MongoDBReplicaSet or a MongoDBShardedCluster. 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`.
115119

120+
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.
116121

117-
kubectl apply -f samples/replicaset.yaml
122+
kubectl apply -f samples/minimal/replicaset.yaml

helm_chart/templates/roles.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ rules:
1212
- services
1313
verbs:
1414
- get
15+
- list
1516
- create
17+
- update
18+
- delete
1619
- apiGroups:
1720
- apps
1821
resources:

mongodb-enterprise.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ rules:
1818
- services
1919
verbs:
2020
- get
21+
- list
2122
- create
23+
- update
24+
- delete
2225
- apiGroups:
2326
- apps
2427
resources:

samples/extended/replica-set.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
apiVersion: mongodb.com/v1
3+
kind: MongoDbReplicaSet
4+
metadata:
5+
name: my-replica-set
6+
namespace: mongodb
7+
spec:
8+
members: 3
9+
version: 4.0.0
10+
service: my-service
11+
12+
## Please Note: The default Kubernetes cluster name is `cluster.local`.
13+
## If your cluster has been configured with another name, you can specify
14+
## it with the `clusterName` attribute.
15+
# clusterName: mycompany.net
16+
17+
project: my-project
18+
credentials: my-credentials
19+
20+
persistent: true
21+
podSpec:
22+
cpu: '0.25'
23+
memory: 512M
24+
storage: 12G
25+
storageClass: standard
26+
podAntiAffinityTopologyKey: nodeId
27+
podAffinity:
28+
requiredDuringSchedulingIgnoredDuringExecution:
29+
- labelSelector:
30+
matchExpressions:
31+
- key: security
32+
operator: In
33+
values:
34+
- S1
35+
topologyKey: failure-domain.beta.kubernetes.io/zone
36+
nodeAffinity:
37+
requiredDuringSchedulingIgnoredDuringExecution:
38+
nodeSelectorTerms:
39+
- matchExpressions:
40+
- key: kubernetes.io/e2e-az-name
41+
operator: In
42+
values:
43+
- e2e-az1
44+
- e2e-az2

samples/extended/sharded-cluster.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
apiVersion: mongodb.com/v1
3+
kind: MongoDbShardedCluster
4+
metadata:
5+
name: my-sharded-cluster
6+
namespace: mongodb
7+
spec:
8+
shardCount: 2
9+
mongodsPerShardCount: 3
10+
mongosCount: 2
11+
configServerCount: 3
12+
version: 4.0.0
13+
service: my-service
14+
15+
## Please Note: The default Kubernetes cluster name is `cluster.local`.
16+
## If your cluster has been configured with another name, you can specify
17+
## it with the `clusterName` attribute.
18+
# clusterName: mycompany.net
19+
20+
project: my-project
21+
credentials: my-credentials
22+
23+
persistent: true
24+
configSrvPodSpec:
25+
cpu: '0.5'
26+
memory: 512M
27+
storage: 5G
28+
storageClass: fast
29+
podAntiAffinityTopologyKey: kubernetes.io/hostname
30+
podAffinity:
31+
requiredDuringSchedulingIgnoredDuringExecution:
32+
- labelSelector:
33+
matchExpressions:
34+
- key: security
35+
operator: In
36+
values:
37+
- S1
38+
topologyKey: failure-domain.beta.kubernetes.io/zone
39+
mongosPodSpec:
40+
cpu: '0.8'
41+
memory: 1G
42+
podAntiAffinityTopologyKey: rackId
43+
nodeAffinity:
44+
preferredDuringSchedulingIgnoredDuringExecution:
45+
- weight: 1
46+
preference:
47+
matchExpressions:
48+
- key: another-node-label-key
49+
operator: In
50+
values:
51+
- another-node-label-value
52+
shardPodSpec:
53+
cpu: '0.6'
54+
memory: 3G
55+
storage: 25G
56+
storageClass: standard
57+
podAntiAffinityTopologyKey: kubernetes.io/hostname

samples/extended/standalone.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
apiVersion: mongodb.com/v1
2+
kind: MongoDbStandalone
3+
metadata:
4+
name: my-standalone
5+
namespace: mongodb
6+
spec:
7+
version: 4.0.0
8+
service: my-service
9+
10+
## Please Note: The default Kubernetes cluster name is `cluster.local`.
11+
## If your cluster has been configured with another name, you can specify
12+
## it with the `clusterName` attribute.
13+
# clusterName: mycompany.net
14+
15+
project: my-project
16+
credentials: my-credentials
17+
18+
persistent: true
19+
podSpec:
20+
cpu: '0.25'
21+
memory: 512M
22+
storage: 12G
23+
storageClass: standard
24+
podAffinity:
25+
requiredDuringSchedulingIgnoredDuringExecution:
26+
- labelSelector:
27+
matchExpressions:
28+
- key: security
29+
operator: In
30+
values:
31+
- S1
32+
topologyKey: failure-domain.beta.kubernetes.io/zone
33+
nodeAffinity:
34+
requiredDuringSchedulingIgnoredDuringExecution:
35+
nodeSelectorTerms:
36+
- matchExpressions:
37+
- key: kubernetes.io/e2e-az-name
38+
operator: In
39+
values:
40+
- e2e-az1
41+
- e2e-az2

samples/minimal/replica-set.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#
2+
# This is a minimal config. To see all the options available, refer to the
3+
# "extended" directory
4+
#
5+
---
6+
apiVersion: mongodb.com/v1
7+
kind: MongoDbReplicaSet
8+
metadata:
9+
name: my-replica-set
10+
namespace: mongodb
11+
spec:
12+
members: 3
13+
version: 4.0.0
14+
15+
# Before you create this object, you'll need to create a project ConfigMap and a
16+
# credentials Secret. For instructions on how to do this, please refer to our
17+
# documentation, here:
18+
# https://docs.opsmanager.mongodb.com/current/tutorial/install-k8s-operator
19+
project: my-project
20+
credentials: my-credentials
21+
22+
# This flag allows the creation of pods without persistent volumes. This is for
23+
# testing only, and must not be used in production. 'false' will disable
24+
# Persistent Volume Claims. The default is 'true'
25+
persistent: true

samples/minimal/sharded-cluster.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#
2+
# This is a minimal config. To see all the options available, refer to the
3+
# "extended" directory
4+
#
5+
---
6+
apiVersion: mongodb.com/v1
7+
kind: MongoDbShardedCluster
8+
metadata:
9+
name: my-sharded-cluster
10+
namespace: mongodb
11+
spec:
12+
shardCount: 2
13+
mongodsPerShardCount: 3
14+
mongosCount: 2
15+
configServerCount: 3
16+
version: 4.0.0
17+
18+
# Before you create this object, you'll need to create a project ConfigMap and a
19+
# credentials Secret. For instructions on how to do this, please refer to our
20+
# documentation, here:
21+
# https://docs.opsmanager.mongodb.com/current/tutorial/install-k8s-operator
22+
project: my-project
23+
credentials: my-credentials
24+
25+
# This flag allows the creation of pods without persistent volumes. This is for
26+
# testing only, and must not be used in production. 'false' will disable
27+
# Persistent Volume Claims. The default is 'true'
28+
persistent: true

samples/minimal/standalone.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#
2+
# This is a minimal config. To see all the options available, refer to the
3+
# "extended" directory
4+
#
5+
---
6+
apiVersion: mongodb.com/v1
7+
kind: MongoDbStandalone
8+
metadata:
9+
name: my-standalone
10+
namespace: mongodb
11+
spec:
12+
version: 4.0.0
13+
14+
# Before you create this object, you'll need to create a project ConfigMap and a
15+
# credentials Secret. For instructions on how to do this, please refer to our
16+
# documentation, here:
17+
# https://docs.opsmanager.mongodb.com/current/tutorial/install-k8s-operator
18+
project: my-project
19+
credentials: my-credentials
20+
21+
# This flag allows the creation of pods without persistent volumes. This is for
22+
# testing only, and must not be used in production. 'false' will disable
23+
# Persistent Volume Claims. The default is 'true'
24+
persistent: true

0 commit comments

Comments
 (0)