Skip to content

Commit 530448e

Browse files
authored
CLOUDP-142977: Atlas Teams (#767)
CLOUDP-142977: Add support to Atlas Teams
1 parent 895f2a9 commit 530448e

38 files changed

+1673
-2
lines changed

.github/workflows/test-e2e.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ jobs:
9393
"serverless-pe",
9494
"x509auth",
9595
"custom-roles",
96+
"teams",
9697
]
9798

9899
steps:

PROJECT

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,13 @@ resources:
5252
kind: AtlasBackupSchedule
5353
path: github.com/mongodb/mongodb-atlas-kubernetes/api/v1
5454
version: v1
55+
- api:
56+
crdVersion: v1
57+
namespaced: true
58+
controller: true
59+
domain: mongodb.com
60+
group: atlas
61+
kind: AtlasTeam
62+
path: github.com/mongodb/mongodb-atlas-kubernetes/api/v1
63+
version: v1
5564
version: "3"

bundle/manifests/atlas.mongodb.com_atlasprojects.yaml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,43 @@ spec:
775775
isSchemaAdvisorEnabled:
776776
type: boolean
777777
type: object
778+
teams:
779+
description: Teams enable you to grant project access roles to multiple
780+
users.
781+
items:
782+
properties:
783+
roles:
784+
description: Roles the users of the team has over the project
785+
items:
786+
enum:
787+
- GROUP_OWNER
788+
- GROUP_CLUSTER_MANAGER
789+
- GROUP_DATA_ACCESS_ADMIN
790+
- GROUP_DATA_ACCESS_READ_WRITE
791+
- GROUP_DATA_ACCESS_READ_ONLY
792+
- GROUP_READ_ONLY
793+
type: string
794+
minItems: 1
795+
type: array
796+
teamRef:
797+
description: Reference to the team which will assigned to the
798+
project
799+
properties:
800+
name:
801+
description: Name is the name of the Kubernetes Resource
802+
type: string
803+
namespace:
804+
description: Namespace is the namespace of the Kubernetes
805+
Resource
806+
type: string
807+
required:
808+
- name
809+
type: object
810+
required:
811+
- roles
812+
- teamRef
813+
type: object
814+
type: array
778815
withDefaultAlertsSettings:
779816
default: true
780817
description: Flag that indicates whether to create the new project
@@ -1338,6 +1375,40 @@ spec:
13381375
scheme:
13391376
type: string
13401377
type: object
1378+
teams:
1379+
description: Teams contains a list of teams assignment statuses
1380+
properties:
1381+
error:
1382+
type: string
1383+
status:
1384+
type: boolean
1385+
teams:
1386+
items:
1387+
properties:
1388+
id:
1389+
type: string
1390+
teamRef:
1391+
description: ResourceRefNamespaced is a reference to a Kubernetes
1392+
Resource that allows to configure the namespace
1393+
properties:
1394+
name:
1395+
description: Name is the name of the Kubernetes Resource
1396+
type: string
1397+
namespace:
1398+
description: Namespace is the namespace of the Kubernetes
1399+
Resource
1400+
type: string
1401+
required:
1402+
- name
1403+
type: object
1404+
required:
1405+
- teamRef
1406+
type: object
1407+
type: array
1408+
required:
1409+
- status
1410+
- teams
1411+
type: object
13411412
required:
13421413
- conditions
13431414
type: object
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
annotations:
5+
controller-gen.kubebuilder.io/version: v0.9.2
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: atlasteams.atlas.mongodb.com
12+
spec:
13+
group: atlas.mongodb.com
14+
names:
15+
kind: AtlasTeam
16+
listKind: AtlasTeamList
17+
plural: atlasteams
18+
singular: atlasteam
19+
scope: Namespaced
20+
versions:
21+
- additionalPrinterColumns:
22+
- jsonPath: .spec.name
23+
name: Name
24+
type: string
25+
name: v1
26+
schema:
27+
openAPIV3Schema:
28+
description: AtlasTeam is the Schema for the Atlas Teams API
29+
properties:
30+
apiVersion:
31+
description: 'APIVersion defines the versioned schema of this representation
32+
of an object. Servers should convert recognized schemas to the latest
33+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
34+
type: string
35+
kind:
36+
description: 'Kind is a string value representing the REST resource this
37+
object represents. Servers may infer this from the endpoint the client
38+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
39+
type: string
40+
metadata:
41+
type: object
42+
spec:
43+
description: TeamSpec defines the desired state of a Team in Atlas
44+
properties:
45+
name:
46+
description: The name of the team you want to create.
47+
type: string
48+
usernames:
49+
description: Valid email addresses of users to add to the new team
50+
items:
51+
format: email
52+
type: string
53+
type: array
54+
required:
55+
- name
56+
- usernames
57+
type: object
58+
status:
59+
properties:
60+
conditions:
61+
description: Conditions is the list of statuses showing the current
62+
state of the Atlas Custom Resource
63+
items:
64+
description: Condition describes the state of an Atlas Custom Resource
65+
at a certain point.
66+
properties:
67+
lastTransitionTime:
68+
description: Last time the condition transitioned from one status
69+
to another.
70+
format: date-time
71+
type: string
72+
message:
73+
description: A human readable message indicating details about
74+
the transition.
75+
type: string
76+
reason:
77+
description: The reason for the condition's last transition.
78+
type: string
79+
status:
80+
description: Status of the condition, one of True, False, Unknown.
81+
type: string
82+
type:
83+
description: Type of Atlas Custom Resource condition.
84+
type: string
85+
required:
86+
- status
87+
- type
88+
type: object
89+
type: array
90+
id:
91+
description: ID of the team
92+
type: string
93+
observedGeneration:
94+
description: ObservedGeneration indicates the generation of the resource
95+
specification that the Atlas Operator is aware of. The Atlas Operator
96+
updates this field to the 'metadata.generation' as soon as it starts
97+
reconciliation of the resource.
98+
format: int64
99+
type: integer
100+
projects:
101+
description: List of projects which the team is assigned
102+
items:
103+
properties:
104+
id:
105+
description: Unique identifier of the project inside atlas
106+
type: string
107+
name:
108+
description: Name given to the project
109+
type: string
110+
required:
111+
- id
112+
- name
113+
type: object
114+
type: array
115+
required:
116+
- conditions
117+
type: object
118+
required:
119+
- spec
120+
type: object
121+
served: true
122+
storage: true
123+
subresources:
124+
status: {}
125+
status:
126+
acceptedNames:
127+
kind: ""
128+
plural: ""
129+
conditions: null
130+
storedVersions: null

bundle/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,19 @@ metadata:
104104
}
105105
]
106106
}
107+
},
108+
{
109+
"apiVersion": "atlas.mongodb.com/v1",
110+
"kind": "AtlasTeam",
111+
"metadata": {
112+
"name": "atlasteam-sample"
113+
},
114+
"spec": {
115+
"name": "my-team",
116+
"usernames": [
117+
"username@mongodb.com"
118+
]
119+
}
107120
}
108121
]
109122
capabilities: Full Lifecycle
@@ -143,6 +156,11 @@ spec:
143156
kind: AtlasProject
144157
name: atlasprojects.atlas.mongodb.com
145158
version: v1
159+
- description: AtlasTeam is the Schema for the Atlas Teams API
160+
displayName: Atlas Team
161+
kind: AtlasTeam
162+
name: atlasteams.atlas.mongodb.com
163+
version: v1
146164
description: |
147165
The MongoDB Atlas Operator provides a native integration between the Kubernetes orchestration platform and MongoDB Atlas —
148166
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.
@@ -379,6 +397,26 @@ spec:
379397
- get
380398
- patch
381399
- update
400+
- apiGroups:
401+
- atlas.mongodb.com
402+
resources:
403+
- atlasteam
404+
verbs:
405+
- create
406+
- delete
407+
- get
408+
- list
409+
- patch
410+
- update
411+
- watch
412+
- apiGroups:
413+
- atlas.mongodb.com
414+
resources:
415+
- atlasteam/status
416+
verbs:
417+
- get
418+
- patch
419+
- update
382420
serviceAccountName: mongodb-atlas-operator
383421
deployments:
384422
- name: mongodb-atlas-operator

config/crd/bases/atlas.mongodb.com_atlasprojects.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,43 @@ spec:
772772
isSchemaAdvisorEnabled:
773773
type: boolean
774774
type: object
775+
teams:
776+
description: Teams enable you to grant project access roles to multiple
777+
users.
778+
items:
779+
properties:
780+
roles:
781+
description: Roles the users of the team has over the project
782+
items:
783+
enum:
784+
- GROUP_OWNER
785+
- GROUP_CLUSTER_MANAGER
786+
- GROUP_DATA_ACCESS_ADMIN
787+
- GROUP_DATA_ACCESS_READ_WRITE
788+
- GROUP_DATA_ACCESS_READ_ONLY
789+
- GROUP_READ_ONLY
790+
type: string
791+
minItems: 1
792+
type: array
793+
teamRef:
794+
description: Reference to the team which will assigned to the
795+
project
796+
properties:
797+
name:
798+
description: Name is the name of the Kubernetes Resource
799+
type: string
800+
namespace:
801+
description: Namespace is the namespace of the Kubernetes
802+
Resource
803+
type: string
804+
required:
805+
- name
806+
type: object
807+
required:
808+
- roles
809+
- teamRef
810+
type: object
811+
type: array
775812
withDefaultAlertsSettings:
776813
default: true
777814
description: Flag that indicates whether to create the new project
@@ -1335,6 +1372,30 @@ spec:
13351372
scheme:
13361373
type: string
13371374
type: object
1375+
teams:
1376+
description: Teams contains a list of teams assignment statuses
1377+
items:
1378+
properties:
1379+
id:
1380+
type: string
1381+
teamRef:
1382+
description: ResourceRefNamespaced is a reference to a Kubernetes
1383+
Resource that allows to configure the namespace
1384+
properties:
1385+
name:
1386+
description: Name is the name of the Kubernetes Resource
1387+
type: string
1388+
namespace:
1389+
description: Namespace is the namespace of the Kubernetes
1390+
Resource
1391+
type: string
1392+
required:
1393+
- name
1394+
type: object
1395+
required:
1396+
- teamRef
1397+
type: object
1398+
type: array
13381399
required:
13391400
- conditions
13401401
type: object

0 commit comments

Comments
 (0)