Skip to content

Commit 6cf07b2

Browse files
authored
Merge pull request #15 from chatton/master
2 parents 75ca7e4 + 3ca3f5d commit 6cf07b2

File tree

11 files changed

+206
-253
lines changed

11 files changed

+206
-253
lines changed

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ during helm installation
4848

4949
#### Create CustomResourceDefinitions
5050

51-
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:
51+
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:
5252

5353
kubectl apply -f https://raw.githubusercontent.com/mongodb/mongodb-enterprise-kubernetes/master/crds.yaml
5454

55-
This will create three new `crds` in your cluster, `MongoDbStandalone`, `MongoDbReplicaSet` and `MongoDbShardedCluster`. These new objects will be the ones used by the operator to perform the MongoDb operations needed to prepare each one of the different MongoDb types of deployments.
55+
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`
5656

5757
#### Operator Installation
5858

@@ -127,7 +127,7 @@ $ kubectl -n mongodb create secret generic my-credentials --from-literal="user=s
127127

128128
### Creating a MongoDB Object ###
129129

130-
A MongoDB object in Kubernetes can be a MongoDBStandalone, a MongoDBReplicaSet or a MongoDBShardedCluster (short names are `mst`, `mrs`, `msc`). 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`.
130+
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`.
131131

132132
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.
133133

@@ -142,9 +142,7 @@ These are the correct steps to remove any MongoDB Operator resources:
142142

143143
```bash
144144
# these three operations must be called first!
145-
kubectl delete mst --all -n <namespace>
146-
kubectl delete mrs --all -n <namespace>
147-
kubectl delete msc --all -n <namespace>
145+
kubectl delete mdb --all -n <namespace>
148146

149147
# any of the following commands must be called after removing all existing mongodb resources
150148
kubectl delete namespace <namespace>

crds.yaml

Lines changed: 93 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -6,128 +6,103 @@
66
apiVersion: apiextensions.k8s.io/v1beta1
77
kind: CustomResourceDefinition
88
metadata:
9-
name: mongodbstandalones.mongodb.com
9+
name: mongodb.mongodb.com
1010
spec:
1111
group: mongodb.com
1212
version: v1
1313
scope: Namespaced
1414
names:
15-
kind: MongoDbStandalone
16-
plural: mongodbstandalones
15+
kind: MongoDB
16+
plural: mongodb
1717
shortNames:
18-
- mst
19-
singular: mongodbstandalone
20-
validation:
18+
- mdb
19+
singular: mongodb
20+
validation: # there are 3 possible schemas, ReplicaSet, ShardedCluster and Standalone
2121
openAPIV3Schema:
22-
properties:
23-
spec:
24-
properties:
25-
spec:
26-
properties:
27-
credentials:
28-
type: string
29-
project:
30-
type: string
31-
version:
32-
type: string
33-
logLevel:
34-
type: string
35-
required:
36-
- credentials
37-
- project
38-
- version
39-
40-
---
41-
apiVersion: apiextensions.k8s.io/v1beta1
42-
kind: CustomResourceDefinition
43-
metadata:
44-
name: mongodbreplicasets.mongodb.com
45-
spec:
46-
group: mongodb.com
47-
version: v1
48-
scope: Namespaced
49-
names:
50-
kind: MongoDbReplicaSet
51-
singular: mongodbreplicaset
52-
plural: mongodbreplicasets
53-
shortNames:
54-
- mrs
55-
validation:
56-
openAPIV3Schema:
57-
properties:
58-
spec:
59-
properties:
60-
members:
61-
maximum: 50
62-
minimum: 1
63-
type: integer
64-
spec:
65-
properties:
66-
credentials:
67-
type: string
68-
project:
69-
type: string
70-
version:
71-
type: string
72-
logLevel:
73-
type: string
74-
required:
75-
- credentials
76-
- project
77-
- version
78-
- members
79-
80-
---
81-
apiVersion: apiextensions.k8s.io/v1beta1
82-
kind: CustomResourceDefinition
83-
metadata:
84-
name: mongodbshardedclusters.mongodb.com
85-
spec:
86-
group: mongodb.com
87-
version: v1
88-
scope: Namespaced
89-
names:
90-
kind: MongoDbShardedCluster
91-
plural: mongodbshardedclusters
92-
shortNames:
93-
- msc
94-
singular: mongodbshardedcluster
95-
validation:
96-
openAPIV3Schema:
97-
properties:
98-
spec:
99-
properties:
100-
configServerCount:
101-
maximum: 50
102-
minimum: 1
103-
type: integer
104-
mongodsPerShardCount:
105-
maximum: 50
106-
minimum: 1
107-
type: integer
108-
mongosCount:
109-
minimum: 1
110-
type: integer
111-
shardCount:
112-
minimum: 1
113-
type: integer
114-
spec:
115-
properties:
116-
credentials:
117-
type: string
118-
project:
119-
type: string
120-
version:
121-
type: string
122-
logLevel:
123-
type: string
124-
required:
125-
- credentials
126-
- project
127-
- version
128-
- shardCount
129-
- mongodsPerShardCount
130-
- mongosCount
131-
- configServerCount
132-
133-
22+
oneOf:
23+
- properties: # Standalone schema
24+
spec:
25+
properties:
26+
credentials:
27+
type: string
28+
project:
29+
type: string
30+
version:
31+
type: string
32+
pattern: "^[0-9]+.[0-9]+.[0-9]+(-ent)?$"
33+
logLevel:
34+
type: string
35+
enum: ["DEBUG", "INFO", "WARN", "ERROR", "FATAL"]
36+
type:
37+
type: string
38+
pattern: "^Standalone$"
39+
required:
40+
- credentials
41+
- project
42+
- version
43+
- type
44+
- properties: # ReplicaSet schema
45+
spec:
46+
properties:
47+
members:
48+
maximum: 50
49+
minimum: 1
50+
type: integer
51+
credentials:
52+
type: string
53+
project:
54+
type: string
55+
version:
56+
type: string
57+
pattern: "^[0-9]+.[0-9]+.[0-9]+(-ent)?$"
58+
logLevel:
59+
type: string
60+
enum: ["DEBUG", "INFO", "WARN", "ERROR", "FATAL"]
61+
type:
62+
type: string
63+
pattern: "^ReplicaSet$"
64+
required:
65+
- credentials
66+
- project
67+
- version
68+
- type
69+
- members
70+
- properties:
71+
spec:
72+
properties: # ShardedCluster schema
73+
configServerCount:
74+
maximum: 50
75+
minimum: 1
76+
type: integer
77+
mongodsPerShardCount:
78+
maximum: 50
79+
minimum: 1
80+
type: integer
81+
mongosCount:
82+
minimum: 1
83+
type: integer
84+
shardCount:
85+
minimum: 1
86+
type: integer
87+
credentials:
88+
type: string
89+
project:
90+
type: string
91+
version:
92+
type: string
93+
pattern: "^[0-9]+.[0-9]+.[0-9]+(-ent)?$"
94+
logLevel:
95+
type: string
96+
enum: ["DEBUG", "INFO", "WARN", "ERROR", "FATAL"]
97+
type:
98+
type: string
99+
pattern: "^ShardedCluster$"
100+
required:
101+
- credentials
102+
- project
103+
- version
104+
- type
105+
- shardCount
106+
- mongodsPerShardCount
107+
- mongosCount
108+
- configServerCount

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: '0.9'
3+
version: '0.10'
44
kubeVersion: '>=1.11'
55
keywords:
66
- mongodb

0 commit comments

Comments
 (0)