Skip to content

Commit 53b6876

Browse files
CLOUDP-121493: AtlasCluster renamed to AtlasDeployment (#520)
AtlasCluster CRD renamed to AltasDeployment
1 parent 2e05700 commit 53b6876

File tree

81 files changed

+889
-2272
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+889
-2272
lines changed

.github/workflows/test-forked.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
strategy:
5151
fail-fast: false
5252
matrix:
53-
test: ["AtlasProject", "AtlasCluster", "AtlasDatabaseUser"]
53+
test: ["AtlasProject", "AtlasDeployment", "AtlasDatabaseUser"]
5454
steps:
5555
- uses: actions/[email protected]
5656
with:

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
strategy:
5858
fail-fast: false
5959
matrix:
60-
test: ["AtlasProject", "AtlasCluster", "AtlasDatabaseUser"]
60+
test: ["AtlasProject", "AtlasDeployment", "AtlasDatabaseUser"]
6161
steps:
6262
- uses: actions/[email protected]
6363

.golangci.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,15 @@ issues:
9494
- path: test/e2e/helm_chart_test.go
9595
linters:
9696
- dupl
97-
- path: pkg/controller/atlascluster/advanced_cluster.go
97+
- path: pkg/controller
9898
linters:
9999
- prealloc
100+
- dupl
100101
- path: pkg/controller/atlasdatabaseuser/connectionsecrets
101102
linters:
102103
- prealloc
103104
- path: pkg/util/testutil/
104105
linters:
105106
- stylecheck
106-
- path: pkg/controller/atlascluster
107-
linters:
108-
- dupl
109107
max-issues-per-linter: 0
110108
max-same-issues: 0

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ int-test: export ATLAS_PRIVATE_KEY=$(shell grep "ATLAS_PRIVATE_KEY" .actrc | cut
7979
# magical env that if specified makes the test output 0 on successful runs
8080
# https://github.com/onsi/ginkgo/blob/master/ginkgo/run_command.go#L130
8181
int-test: export GINKGO_EDITOR_INTEGRATION="true"
82-
int-test: generate manifests ## Run integration tests. Sample with labels: `make int-test label=AtlasProject` or `make int-test label='AtlasCluster && !slow'`
82+
int-test: generate manifests ## Run integration tests. Sample with labels: `make int-test label=AtlasProject` or `make int-test label='AtlasDeployment && !slow'`
8383
mkdir -p $(ENVTEST_ASSETS_DIR)
8484
test -f $(ENVTEST_ASSETS_DIR)/setup-envtest.sh || curl -sSLo $(ENVTEST_ASSETS_DIR)/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.8.0/hack/setup-envtest.sh
8585
source $(ENVTEST_ASSETS_DIR)/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); ginkgo --label-filter='$(label)' --timeout 80m -v -nodes=8 ./test/int -coverprofile cover.out

PROJECT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ resources:
1313
controller: true
1414
domain: mongodb.com
1515
group: atlas
16-
kind: AtlasCluster
16+
kind: AtlasDeployment
1717
path: github.com/mongodb/mongodb-atlas-kubernetes/api/v1
1818
version: v1
1919
- api:

README.md

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# MongoDB Atlas Operator (Beta)
2+
23
[![MongoDB Atlas Operator](https://github.com/mongodb/mongodb-atlas-kubernetes/workflows/Test/badge.svg)](https://github.com/mongodb/mongodb-atlas-kubernetes/actions/workflows/test.yml?query=branch%3Amain)
34
[![MongoDB Atlas Go Client](https://img.shields.io/badge/Powered%20by%20-go--client--mongodb--atlas-%2313AA52)](https://github.com/mongodb/go-client-mongodb-atlas)
45

5-
The MongoDB Atlas Operator provides a native integration between the Kubernetes orchestration platform and MongoDB Atlas — the only multi-cloud document database service that gives you the versatility you need to build sophisticated and resilient applications that can adapt to changing customer demands and market trends.
6+
The MongoDB Atlas Operator provides a native integration between the Kubernetes orchestration platform and MongoDB Atlas
7+
— the only multi-cloud document database service that gives you the versatility you need to build sophisticated and
8+
resilient applications that can adapt to changing customer demands and market trends.
69

710
> Current Status: *Beta*.
811
> The Operator gives users the ability to provision
@@ -13,16 +16,22 @@ The MongoDB Atlas Operator provides a native integration between the Kubernetes
1316
The full documentation for the Operator can be found [here](https://docs.atlas.mongodb.com/atlas-operator/)
1417

1518
## Quick Start guide
19+
1620
### Step 1. Deploy Kubernetes operator using all in one config file
21+
1722
```
1823
kubectl apply -f https://raw.githubusercontent.com/mongodb/mongodb-atlas-kubernetes/main/deploy/all-in-one.yaml
1924
```
25+
2026
### Step 2. Create Atlas Cluster
2127

2228
**1.** Create an Atlas API Key Secret
2329

24-
In order to work with the Atlas Operator you need to provide [authentication information](https://docs.atlas.mongodb.com/configure-api-access)
25-
to allow the Atlas Operator to communicate with Atlas API. Once you have generated a Public and Private key in Atlas, you can create a Kuberentes Secret with:
30+
In order to work with the Atlas Operator you need to
31+
provide [authentication information](https://docs.atlas.mongodb.com/configure-api-access)
32+
to allow the Atlas Operator to communicate with Atlas API. Once you have generated a Public and Private key in Atlas,
33+
you can create a Kuberentes Secret with:
34+
2635
```
2736
kubectl create secret generic mongodb-atlas-operator-api-key \
2837
--from-literal="orgId=<the_atlas_organization_id>" \
@@ -37,6 +46,7 @@ kubectl label secret mongodb-atlas-operator-api-key atlas.mongodb.com/type=crede
3746

3847
The `AtlasProject` CustomResource represents Atlas Projects in our Kubernetes cluster. You need to specify
3948
`projectIpAccessList` with the IP addresses or CIDR blocks of any hosts that will connect to the Atlas Cluster.
49+
4050
```
4151
cat <<EOF | kubectl apply -f -
4252
apiVersion: atlas.mongodb.com/v1
@@ -52,14 +62,17 @@ spec:
5262
comment: "CIDR block for Application Server B - D"
5363
EOF
5464
```
55-
**3.** Create an `AtlasCluster` Custom Resource.
5665

57-
The example below is a minimal configuration to create an M10 Atlas cluster in the AWS US East region. For a full list of properties, check
58-
`atlasclusters.atlas.mongodb.com` [CRD specification](config/crd/bases/atlas.mongodb.com_atlasclusters.yaml)):
66+
**3.** Create an `AtlasDeployment` Custom Resource.
67+
68+
The example below is a minimal configuration to create an M10 Atlas cluster in the AWS US East region. For a full list
69+
of properties, check
70+
`atlasclusters.atlas.mongodb.com` [CRD specification](config/crd/bases/atlas.mongodb.com_atlasdeployments.yaml)):
71+
5972
```
6073
cat <<EOF | kubectl apply -f -
6174
apiVersion: atlas.mongodb.com/v1
62-
kind: AtlasCluster
75+
kind: AtlasDeployment
6376
metadata:
6477
name: my-atlas-cluster
6578
spec:
@@ -75,6 +88,7 @@ EOF
7588
```
7689

7790
**4.** Create a database user password Kubernetes Secret
91+
7892
```
7993
kubectl create secret generic the-user-password --from-literal="password=P@@sword%"
8094
@@ -85,8 +99,9 @@ kubectl label secret the-user-password atlas.mongodb.com/type=credentials
8599

86100
**5.** Create an `AtlasDatabaseUser` Custom Resource
87101

88-
In order to connect to an Atlas Cluster the database user needs to be created. `AtlasDatabaseUser` resource should reference
89-
the password Kubernetes Secret created in the previous step.
102+
In order to connect to an Atlas Cluster the database user needs to be created. `AtlasDatabaseUser` resource should
103+
reference the password Kubernetes Secret created in the previous step.
104+
90105
```
91106
cat <<EOF | kubectl apply -f -
92107
apiVersion: atlas.mongodb.com/v1
@@ -104,17 +119,21 @@ spec:
104119
name: the-user-password
105120
EOF
106121
```
122+
107123
**6.** Wait for the `AtlasDatabaseUser` Custom Resource to be ready
108124

109-
Wait until the AtlasDatabaseUser resource gets to "ready" status (it will wait until the cluster is created that may take around 10 minutes):
125+
Wait until the AtlasDatabaseUser resource gets to "ready" status (it will wait until the cluster is created that may
126+
take around 10 minutes):
127+
110128
```
111129
kubectl get atlasdatabaseusers my-database-user -o=jsonpath='{.status.conditions[?(@.type=="Ready")].status}'
112130
True
113131
```
132+
114133
### Step 3. Connect your application to the Atlas Cluster
115134

116-
The Atlas Operator will create a Kubernetes Secret with the information necessary to connect to the Atlas Cluster created
117-
in the previous step. An application in the same Kubernetes Cluster can mount and use the Secret:
135+
The Atlas Operator will create a Kubernetes Secret with the information necessary to connect to the Atlas Cluster
136+
created in the previous step. An application in the same Kubernetes Cluster can mount and use the Secret:
118137

119138
```
120139
...
@@ -130,12 +149,16 @@ containers:
130149
```
131150

132151
## Additional information or features
152+
133153
Operator support Third Party Integration.
154+
134155
- [Mongodb Atlas Operator sample](docs/project-integration.md)
135156
- [Atlas documentation Atlas](https://docs.atlas.mongodb.com/reference/api/third-party-integration-settings/)
136157

137158
## How to Contribute
138159

139-
Please file issues before filing PRs. For PRs to be accepted, contributors must sign our [CLA](https://www.mongodb.com/legal/contributor-agreement).
160+
Please file issues before filing PRs. For PRs to be accepted, contributors must sign
161+
our [CLA](https://www.mongodb.com/legal/contributor-agreement).
140162

141-
Reviewers, please ensure that the CLA has been signed by referring to [the contributors tool](https://contributors.corp.mongodb.com/) (internal link).
163+
Reviewers, please ensure that the CLA has been signed by referring
164+
to [the contributors tool](https://contributors.corp.mongodb.com/) (internal link).
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
annotations:
5+
controller-gen.kubebuilder.io/version: v0.4.1
6+
creationTimestamp: null
7+
labels:
8+
app.kubernetes.io/component: controller
9+
app.kubernetes.io/instance: mongodb-atlas-kubernetes-operator
10+
app.kubernetes.io/name: mongodb-atlas-kubernetes-operator
11+
name: atlasbackupschedules.atlas.mongodb.com
12+
spec:
13+
group: atlas.mongodb.com
14+
names:
15+
kind: AtlasBackupSchedule
16+
listKind: AtlasBackupScheduleList
17+
plural: atlasbackupschedules
18+
singular: atlasbackupschedule
19+
scope: Namespaced
20+
versions:
21+
- name: v1
22+
schema:
23+
openAPIV3Schema:
24+
description: AtlasBackupSchedule is the Schema for the atlasbackupschedules
25+
API
26+
properties:
27+
apiVersion:
28+
description: 'APIVersion defines the versioned schema of this representation
29+
of an object. Servers should convert recognized schemas to the latest
30+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
31+
type: string
32+
kind:
33+
description: 'Kind is a string value representing the REST resource this
34+
object represents. Servers may infer this from the endpoint the client
35+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
36+
type: string
37+
metadata:
38+
type: object
39+
spec:
40+
description: AtlasBackupScheduleSpec defines the desired state of AtlasBackupSchedule
41+
properties:
42+
autoExportEnabled:
43+
default: true
44+
description: Specify true to enable automatic export of cloud backup
45+
snapshots to the AWS bucket. You must also define the export policy
46+
using export. If omitted, defaults to false.
47+
type: boolean
48+
export:
49+
description: Export policy for automatically exporting cloud backup
50+
snapshots to AWS bucket.
51+
properties:
52+
exportBucketId:
53+
description: Unique identifier of the AWS bucket to export the
54+
cloud backup snapshot to.
55+
type: string
56+
frequencyType:
57+
enum:
58+
- MONTHLY
59+
type: string
60+
required:
61+
- exportBucketId
62+
- frequencyType
63+
type: object
64+
policies:
65+
description: Array containing a references (name & namespace) for
66+
each backup policy item in the desired updated backup policy.
67+
items:
68+
description: ResourceRefNamespaced is a reference to a Kubernetes
69+
Resource that allows to configure the namespace
70+
properties:
71+
name:
72+
description: Name is the name of the Kubernetes Resource
73+
type: string
74+
namespace:
75+
description: Namespace is the namespace of the Kubernetes Resource
76+
type: string
77+
required:
78+
- name
79+
type: object
80+
type: array
81+
referenceHourOfDay:
82+
description: UTC Hour of day between 0 and 23, inclusive, representing
83+
which hour of the day that Atlas takes snapshots for backup policy
84+
items
85+
format: int64
86+
maximum: 23
87+
minimum: 0
88+
type: integer
89+
referenceMinuteOfHour:
90+
description: UTC Minutes after ReferenceHourOfDay that Atlas takes
91+
snapshots for backup policy items. Must be between 0 and 59, inclusive.
92+
format: int64
93+
maximum: 59
94+
minimum: 0
95+
type: integer
96+
restoreWindowDays:
97+
default: 1
98+
description: Number of days back in time you can restore to with Continuous
99+
Cloud Backup accuracy. Must be a positive, non-zero integer. Applies
100+
to continuous cloud backups only.
101+
format: int64
102+
type: integer
103+
updateSnapshots:
104+
description: Specify true to apply the retention changes in the updated
105+
backup policy to snapshots that Atlas took previously.
106+
type: boolean
107+
useOrgAndGroupNamesInExportPrefix:
108+
description: Specify true to use organization and project names instead
109+
of organization and project UUIDs in the path for the metadata files
110+
that Atlas uploads to your S3 bucket after it finishes exporting
111+
the snapshots
112+
type: boolean
113+
required:
114+
- policies
115+
type: object
116+
status:
117+
type: object
118+
type: object
119+
served: true
120+
storage: true
121+
subresources:
122+
status: {}
123+
status:
124+
acceptedNames:
125+
kind: ""
126+
plural: ""
127+
conditions: []
128+
storedVersions: []

0 commit comments

Comments
 (0)