Skip to content

Commit a45779f

Browse files
corryrootjwilliams-mongo
authored andcommitted
(DOCSP-14706): Drafted MEKO Kind Quick Start. (#552)
* (DOCSP-14706): Drafted MEKO Kind Quick Start. * (DOCSP-14706): Incorporated Andrey's feedback. * (DOCSP-14706): Updated secret title per Andrey's feedback. * (DOCSP-14706): Incorporated Andrew's feedback.
1 parent b2f4f44 commit a45779f

File tree

6 files changed

+314
-20
lines changed

6 files changed

+314
-20
lines changed

conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@
171171
'.. |k8s-webhook| replace:: `Webhook <https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#what-are-admission-webhooks>`__',
172172
'.. |k8s| replace:: Kubernetes',
173173
'.. |kdc| replace:: :abbr:`KDC (Key Distribution Center)`',
174+
'.. |kind| replace:: :abbr:`Kind (Kubernetes in Docker)`',
174175
'.. |kmip| replace:: :abbr:`KMIP (Key Management Interoperability)`',
175176
'.. |kms| replace:: :abbr:`KMS (Key Management Service)`',
176177
'.. |kubectl| replace:: :xml:`<mono><link target="https://kubernetes.io/docs/reference/kubectl/kubectl/">kubectl</link></mono>`',
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.. note::
2+
3+
Setting ``featureCompatibilityVersion`` to ``"4.0"`` disables
4+
:manual:`4.2 features incompatible with MongoDB 4.0
5+
</release-notes/4.2-compatibility/#4.2-feature-compatibility>`.
Lines changed: 262 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,262 @@
1+
---
2+
stepnum: 1
3+
level: 4
4+
ref: clone-k8s-repo-kind
5+
title: "Clone the :gh:`MongoDB Enterprise Kubernetes Operator repository </mongodb/mongodb-enterprise-kubernetes>`."
6+
content: |
7+
8+
.. code-block:: sh
9+
10+
git clone https://github.com/mongodb/mongodb-enterprise-kubernetes.git
11+
12+
---
13+
stepnum: 2
14+
level: 4
15+
ref: create-k8s-ns-kind
16+
title: "Create a |k8s-ns| for your |k8s| deployment."
17+
content: |
18+
19+
By default, The |k8s-op-short| uses the ``mongodb`` namespace. To
20+
simplify your installation, consider creating a namespace labeled
21+
``mongodb`` using the following |kubectl| command:
22+
23+
.. code-block:: sh
24+
25+
kubectl create namespace mongodb
26+
27+
---
28+
stepnum: 3
29+
level: 4
30+
ref: configure-kubectl-configmap-kind
31+
title: "Configure ``kubectl`` to default to your namespace."
32+
content: |
33+
34+
If you have not already, run the following command to execute all
35+
``kubectl`` commands in the namespace you created:
36+
37+
.. code-block:: sh
38+
39+
kubectl config set-context $(kubectl config current-context) --namespace=mongodb
40+
41+
---
42+
stepnum: 4
43+
level: 4
44+
title: "Install the |k8s-op-full|"
45+
ref: install-kubectl-kind
46+
content: |
47+
48+
1. Change to the directory in which you cloned the repository.
49+
50+
#. Install the |k8s-crds| for MongoDB deployments using the
51+
following |kubectl| command:
52+
53+
.. code-block:: sh
54+
55+
kubectl apply -f crds.yaml
56+
57+
#. Install the |k8s-op-short| using the following |kubectl| command:
58+
59+
.. code-block:: sh
60+
61+
kubectl apply -f mongodb-enterprise.yaml
62+
63+
---
64+
stepnum: 5
65+
title: "Create credentials and store them as a secret."
66+
ref: create-k8s-credentials-kind
67+
content: |
68+
69+
Run the following command:
70+
71+
.. note::
72+
73+
Provide your Public and Private Key values for the following
74+
parameters. To learn more, see :ref:`create-k8s-credentials`.
75+
76+
.. code-block:: sh
77+
78+
kubectl -n mongodb \
79+
create secret generic ops-manager-admin-key \
80+
--from-literal="user=<publicKey>" \
81+
--from-literal="publicApiKey=<privateKey>"
82+
83+
---
84+
stepnum: 6
85+
level: 4
86+
title: "Invoke the following command to create a ConfigMap."
87+
ref: copy-k8s-configmap-kind
88+
content: |
89+
90+
.. note::
91+
92+
Provide your values for the following parameters. To learn more,
93+
see the :doc:`parameter descriptions
94+
</tutorial/create-project-using-configmap>`.
95+
96+
.. code-block:: sh
97+
98+
kubectl create configmap myconfigmap \
99+
--from-literal="baseUrl=<myOpsManagerURL>" \
100+
--from-literal="projectName=<myOpsManagerProjectName>" \ #Optional
101+
--from-literal="orgId=<orgID>" #Required for Global API Keys
102+
103+
---
104+
stepnum: 7
105+
level: 4
106+
title: "Deploy the :term:`replica set` resource."
107+
ref: deploy-replica-set-kind
108+
content: |
109+
110+
Run the following command:
111+
112+
.. code-block:: sh
113+
114+
cat <<EOF | kubectl apply -f -
115+
apiVersion: mongodb.com/v1
116+
kind: MongoDB
117+
metadata:
118+
name: demo-mongodb-cluster-1
119+
namespace: mongodb
120+
spec:
121+
members: 3
122+
version: 4.4.5-ent
123+
type: ReplicaSet
124+
authentication:
125+
enabled: true
126+
modes: ["SHA"]
127+
opsManager:
128+
configMapRef:
129+
name: myconfigmap
130+
credentials: ops-manager-admin-key
131+
persistent: true
132+
podSpec:
133+
podTemplate:
134+
spec:
135+
containers:
136+
- name: mongodb-enterprise-database
137+
resources:
138+
limits:
139+
cpu: 2
140+
memory: 1.5G
141+
requests:
142+
cpu: 1
143+
memory: 1G
144+
persistence:
145+
single:
146+
storage: 10Gi
147+
EOF
148+
149+
---
150+
stepnum: 8
151+
level: 4
152+
title: "Create a secret with your database user password"
153+
ref: create-k8s-user-secret-kind
154+
content: |
155+
156+
You can choose to use a cleartext password or a Base64-encoded
157+
password. Plaintext passwords use ``stringData.password`` and
158+
Base64-encoded passwords use ``data.password``.
159+
160+
.. note::
161+
162+
Provide your values for the following parameters. To learn more,
163+
see the :doc:`parameter descriptions
164+
</tutorial/manage-database-users-scram>`.
165+
166+
For a cleartext password, create and save the following YAML file:
167+
168+
.. code-block:: sh
169+
170+
apiVersion: v1
171+
kind: Secret
172+
metadata:
173+
name: mms-user-1-password
174+
# corresponds to user.spec.passwordSecretKeyRef.name
175+
type: Opaque
176+
stringData:
177+
password: <my-plain-text-password>
178+
# corresponds to user.spec.passwordSecretKeyRef.key
179+
180+
For a Base64-encoded password, create and save the following YAML
181+
file:
182+
183+
.. code-block:: sh
184+
185+
apiVersion: v1
186+
kind: Secret
187+
metadata:
188+
name: mms-user-1-password
189+
# corresponds to user.spec.passwordSecretKeyRef.name
190+
type: Opaque
191+
data:
192+
password: <base-64-encoded-password>
193+
# corresponds to user.spec.passwordSecretKeyRef.key
194+
195+
---
196+
stepnum: 9
197+
level: 4
198+
title: "Create a database user."
199+
ref: add-k8s-user-configmap-kind
200+
content: |
201+
202+
Run the following command:
203+
204+
.. code-block:: sh
205+
206+
cat <<EOF | kubectl apply -f -
207+
apiVersion: mongodb.com/v1
208+
kind: MongoDBUser
209+
metadata:
210+
name: mms-scram-user-1
211+
spec:
212+
passwordSecretKeyRef:
213+
name: mms-user-1-password
214+
# Match to metadata.name of the User Secret
215+
key: password
216+
username: "mms-scram-user-1"
217+
db: "admin" #
218+
mongodbResourceRef:
219+
name: "demo-mongodb-cluster-1"
220+
# Match to MongoDB resource using authenticaiton
221+
roles:
222+
- db: "admin"
223+
name: "clusterAdmin"
224+
- db: "admin"
225+
name: "userAdminAnyDatabase"
226+
- db: "admin"
227+
name: "readWrite"
228+
- db: "admin"
229+
name: "userAdminAnyDatabase"
230+
EOF
231+
232+
---
233+
stepnum: 10
234+
level: 4
235+
ref: view-k8s-user-kind
236+
optional: true
237+
source:
238+
file: steps-add-database-user-scram.yaml
239+
ref: view-k8s-user
240+
241+
---
242+
stepnum: 11
243+
level: 4
244+
title: "Connect to the :term:`replica set`."
245+
ref: connect-k8s-rs-kind
246+
content: |
247+
248+
Perform the following steps in the |mms| or
249+
`Cloud Manager <docs.cloudmanager.com/current/>`__
250+
application, depending on where your clusters are hosted:
251+
252+
1. Click :guilabel:`Deployment` in the left navigation.
253+
254+
#. Click :icon-mms:`ellipsis` for the deployment to which you want
255+
to connect.
256+
257+
#. Click :guilabel:`Connect to this instance`.
258+
259+
#. Run the connection command in a terminal to connect to the
260+
deployment.
261+
262+
...

source/index.txt

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,17 @@ You can then deploy MongoDB databases as you deploy them now after the
4444
cluster is created. You can use the |com| console to run MongoDB at
4545
optimal performance.
4646

47-
.. class:: hidden
48-
49-
.. toctree::
50-
:titlesonly:
51-
52-
Install the Operator </installation>
53-
Deploy Ops Manager Resources </om-resources>
54-
Deploy MongoDB Database Resources </mdb-resources>
55-
/tutorial/modify-resource-image
56-
/reference
57-
/specification
58-
Release Notes </release-notes>
59-
Production Notes </reference/production-notes>
60-
/reference/troubleshooting
61-
Known Issues </reference/known-issues>
62-
MongoDB Community Kubernetes Operator <https://github.com/mongodb/mongodb-kubernetes-operator>
47+
.. toctree::
48+
:titlesonly:
49+
50+
Kind Quick Start </kind-quick-start>
51+
Install the Operator </installation>
52+
Deploy Ops Manager Resources </om-resources>
53+
Deploy MongoDB Database Resources </mdb-resources>
54+
/tutorial/modify-resource-image
55+
/reference
56+
Release Notes </release-notes>
57+
Production Notes </reference/production-notes>
58+
/reference/troubleshooting
59+
Known Issues </reference/known-issues>
60+
MongoDB Community Kubernetes Operator <https://github.com/mongodb/mongodb-kubernetes-operator>

source/kind-quick-start.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
.. _kind-quick-start-ref:
2+
3+
================
4+
Kind Quick Start
5+
================
6+
7+
.. default-domain:: mongodb
8+
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 2
13+
:class: singlecol
14+
15+
|k8s-op-full| uses the |k8s| API and tools to manage MongoDB
16+
clusters. |k8s-op-full| works together with MongoDB |com|. This
17+
tutorial demonstrates how to deploy and connect to your first replica
18+
set in |com| from |kind| with |k8s-op-full|.
19+
20+
21+
Prerequisites
22+
-------------
23+
24+
This tutorial requires:
25+
26+
- A running |com| cluster.
27+
28+
Procedure
29+
---------
30+
31+
.. include:: /includes/steps/kind-quick-start.rst

source/tutorial/upgrade-mdb-version.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,7 @@ following steps upgrade the deployment's MongoDB version to
7575
persistent: false
7676
...
7777

78-
.. note::
79-
80-
Setting ``featureCompatibilityVersion`` to ``"4.0"`` disables
81-
:manual:`4.2 features incompatible with MongoDB 4.0 </release-notes/4.2-compatibility/#compatibility-enabled>`.
78+
.. include:: /includes/admonitions/fact-featureCompatibilityVersion.rst
8279

8380
2. Reapply the configuration to |k8s|:
8481

0 commit comments

Comments
 (0)