Skip to content

Commit 5e7d5ce

Browse files
helderjss-urbaniak
andauthored
CLOUDP-222191: Update quick start guide and provided samples (#1421)
--------- Co-authored-by: Sergiusz Urbaniak <sergiusz.urbaniak@gmail.com>
1 parent 116e2d3 commit 5e7d5ce

File tree

7 files changed

+72
-255
lines changed

7 files changed

+72
-255
lines changed

README.md

Lines changed: 14 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -9,147 +9,25 @@ resilient applications that can adapt to changing customer demands and market tr
99

1010
The full documentation for the Operator can be found [here](https://docs.atlas.mongodb.com/atlas-operator/)
1111

12-
## Quick Start guide
12+
## Getting Started
1313

14-
### Step 1. Deploy Kubernetes operator using all in one config file
14+
### Supported features
1515

16-
```
17-
kubectl apply -f https://raw.githubusercontent.com/mongodb/mongodb-atlas-kubernetes/main/deploy/all-in-one.yaml
18-
```
16+
* Create and configure an Atlas Project, or connect to an existing one.
17+
* Deploy, manage, scale, and tear down Atlas clusters.
18+
* Support for Atlas serverless instances.
19+
* Create and edit database users.
20+
* Manage IP Access Lists, network peering and private endpoints.
21+
* Configure and control Atlas’s fully managed cloud backup.
22+
* Configure federated authentication for your Atlas organization
23+
* Integrate Atlas monitoring with Prometheus.
1924

20-
### Step 2. Create Atlas Deployment
25+
... and more.
2126

22-
**1.** Create an Atlas API Key Secret
27+
To view the list of custom resources and their respective schemas, visit our [reference](https://www.mongodb.com/docs/atlas/operator/stable/custom-resources/)
28+
documentation. See the [Quickstart](https://www.mongodb.com/docs/atlas/operator/stable/ak8so-quick-start/) to get started
29+
with Atlas Kubernetes Operator.
2330

24-
In order to work with the Atlas Operator you need to
25-
provide [authentication information](https://docs.atlas.mongodb.com/configure-api-access)
26-
to allow the Atlas Operator to communicate with Atlas API. Once you have generated a Public and Private key in Atlas,
27-
you can create a Kuberentes Secret with:
28-
29-
```
30-
kubectl create secret generic mongodb-atlas-operator-api-key \
31-
--from-literal='orgId=<the_atlas_organization_id>' \
32-
--from-literal='publicApiKey=<the_atlas_api_public_key>' \
33-
--from-literal='privateApiKey=<the_atlas_api_private_key>' \
34-
-n mongodb-atlas-system
35-
36-
kubectl label secret mongodb-atlas-operator-api-key atlas.mongodb.com/type=credentials -n mongodb-atlas-system
37-
```
38-
39-
**2.** Create an `AtlasProject` Custom Resource
40-
41-
The `AtlasProject` CustomResource represents Atlas Projects in our Kubernetes cluster. You need to specify
42-
`projectIpAccessList` with the IP addresses or CIDR blocks of any hosts that will connect to the Atlas Deployment.
43-
44-
```
45-
cat <<EOF | kubectl apply -f -
46-
apiVersion: atlas.mongodb.com/v1
47-
kind: AtlasProject
48-
metadata:
49-
name: my-project
50-
spec:
51-
name: Test Atlas Operator Project
52-
projectIpAccessList:
53-
- ipAddress: "192.0.2.15"
54-
comment: "IP address for Application Server A"
55-
- cidrBlock: "203.0.113.0/24"
56-
comment: "CIDR block for Application Server B - D"
57-
EOF
58-
```
59-
60-
**3.** Create an `AtlasDeployment` Custom Resource.
61-
62-
The example below is a minimal configuration to create an M10 Atlas deployment in the AWS US East region. For a full list
63-
of properties, check
64-
`atlasdeployments.atlas.mongodb.com` [CRD specification](config/crd/bases/atlas.mongodb.com_atlasdeployments.yaml)):
65-
66-
```
67-
cat <<EOF | kubectl apply -f -
68-
apiVersion: atlas.mongodb.com/v1
69-
kind: AtlasDeployment
70-
metadata:
71-
name: my-atlas-deployment
72-
spec:
73-
projectRef:
74-
name: my-project
75-
deploymentSpec:
76-
name: test-deployment
77-
providerSettings:
78-
instanceSizeName: M10
79-
providerName: AWS
80-
regionName: US_EAST_1
81-
EOF
82-
```
83-
84-
**4.** Create a database user password Kubernetes Secret
85-
86-
```
87-
kubectl create secret generic the-user-password --from-literal='password=P@@sword%'
88-
89-
kubectl label secret the-user-password atlas.mongodb.com/type=credentials
90-
```
91-
92-
(note) To create X.509 user please see [this doc](docs/x509-user.md).
93-
94-
**5.** Create an `AtlasDatabaseUser` Custom Resource
95-
96-
In order to connect to an Atlas Deployment the database user needs to be created. `AtlasDatabaseUser` resource should
97-
reference the password Kubernetes Secret created in the previous step.
98-
99-
```
100-
cat <<EOF | kubectl apply -f -
101-
apiVersion: atlas.mongodb.com/v1
102-
kind: AtlasDatabaseUser
103-
metadata:
104-
name: my-database-user
105-
spec:
106-
roles:
107-
- roleName: "readWriteAnyDatabase"
108-
databaseName: "admin"
109-
projectRef:
110-
name: my-project
111-
username: theuser
112-
passwordSecretRef:
113-
name: the-user-password
114-
EOF
115-
```
116-
117-
**6.** Wait for the `AtlasDatabaseUser` Custom Resource to be ready
118-
119-
Wait until the AtlasDatabaseUser resource gets to "ready" status (it will wait until the deployment is created that may
120-
take around 10 minutes):
121-
122-
```
123-
kubectl get atlasdatabaseusers my-database-user -o=jsonpath='{.status.conditions[?(@.type=="Ready")].status}'
124-
True
125-
```
126-
127-
### Step 3. Connect your application to the Atlas Deployment
128-
129-
The Atlas Operator will create a Kubernetes Secret with the information necessary to connect to the Atlas Deployment
130-
created in the previous step. An application in the same Kubernetes Cluster can mount and use the Secret:
131-
132-
```
133-
...
134-
containers:
135-
- name: test-app
136-
env:
137-
- name: "CONNECTION_STRING"
138-
valueFrom:
139-
secretKeyRef:
140-
name: test-atlas-operator-project-test-cluster-theuser
141-
key: connectionStringStandardSrv
142-
143-
```
144-
145-
## Additional information or features
146-
147-
In certain cases you can modify the default operator behaviour via [annotations](docs/annotations.md).
148-
149-
Operator support Third Party Integration.
150-
151-
- [Mongodb Atlas Operator sample](docs/project-integration.md)
152-
- [Atlas documentation Atlas](https://docs.atlas.mongodb.com/reference/api/third-party-integration-settings/)
15331

15432
## How to Contribute
15533

0 commit comments

Comments
 (0)