-
Notifications
You must be signed in to change notification settings - Fork 42
/
crownlabs.polito.it_tenants.yaml
263 lines (263 loc) · 10.6 KB
/
crownlabs.polito.it_tenants.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
name: tenants.crownlabs.polito.it
spec:
group: crownlabs.polito.it
names:
kind: Tenant
listKind: TenantList
plural: tenants
singular: tenant
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .spec.firstName
name: First Name
type: string
- jsonPath: .spec.lastName
name: Last Name
type: string
- jsonPath: .spec.email
name: Email
priority: 10
type: string
- jsonPath: .status.personalNamespace.name
name: Namespace
priority: 10
type: string
- jsonPath: .status.ready
name: Ready
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha2
schema:
openAPIV3Schema:
description: Tenant describes a user of CrownLabs.
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: TenantSpec is the specification of the desired state of the
Tenant.
properties:
createSandbox:
default: false
description: |-
Whether a sandbox namespace should be created to allow the Tenant play
with Kubernetes.
type: boolean
email:
description: |-
The email associated with the Tenant, which will be used to log-in
into the system.
pattern: ^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$
type: string
firstName:
description: The first name of the Tenant.
type: string
lastLogin:
description: The last login timestamp.
format: date-time
type: string
lastName:
description: The last name of the Tenant.
type: string
publicKeys:
description: |-
The list of the SSH public keys associated with the Tenant. These will be
used to enable to access the remote environments through the SSH protocol.
items:
type: string
type: array
quota:
description: The amount of resources associated with this Tenant,
if defined it overrides the one computed from the workspaces the
tenant is enrolled in.
properties:
cpu:
anyOf:
- type: integer
- type: string
description: The maximum amount of CPU which can be used by this
Tenant.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
instances:
description: The maximum number of concurrent instances which
can be created by this Tenant.
format: int32
minimum: 0
type: integer
memory:
anyOf:
- type: integer
- type: string
description: The maximum amount of RAM memory which can be used
by this Tenant.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
required:
- cpu
- instances
- memory
type: object
workspaces:
description: |-
The list of the Workspaces the Tenant is subscribed to, along with his/her
role in each of them.
items:
description: |-
TenantWorkspaceEntry contains the information regarding one of the Workspaces
the Tenant is subscribed to, including his/her role.
properties:
name:
description: The Workspace the Tenant is subscribed to.
type: string
role:
description: The role of the Tenant in the context of the Workspace.
enum:
- manager
- user
- candidate
type: string
required:
- name
- role
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
required:
- email
- firstName
- lastName
type: object
status:
description: TenantStatus reflects the most recently observed status of
the Tenant.
properties:
failingWorkspaces:
description: |-
The list of Workspaces that are throwing errors during subscription.
This mainly happens if .spec.Workspaces contains references to Workspaces
which do not exist.
items:
type: string
type: array
personalNamespace:
description: |-
The namespace containing all CrownLabs related objects of the Tenant.
This is the namespace that groups his/her own Instances, together with
all the accessory resources (e.g. RBACs, resource quota, network policies,
...) created by the tenant-operator.
properties:
created:
description: Whether the creation succeeded or not.
type: boolean
name:
description: The name of the considered resource.
type: string
required:
- created
type: object
quota:
description: The amount of resources associated with this Tenant,
either inherited from the Workspaces in which he/she is enrolled,
or manually overridden.
properties:
cpu:
anyOf:
- type: integer
- type: string
description: The maximum amount of CPU which can be used by this
Tenant.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
instances:
description: The maximum number of concurrent instances which
can be created by this Tenant.
format: int32
minimum: 0
type: integer
memory:
anyOf:
- type: integer
- type: string
description: The maximum amount of RAM memory which can be used
by this Tenant.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
required:
- cpu
- instances
- memory
type: object
ready:
description: |-
Whether all subscriptions and resource creations succeeded or an error
occurred. In case of errors, the other status fields provide additional
information about which problem occurred.
Will be set to true even when personal workspace is intentionally deleted.
type: boolean
sandboxNamespace:
description: |-
The namespace that can be freely used by the Tenant to play with Kubernetes.
This namespace is created only if the .spec.CreateSandbox flag is true.
properties:
created:
description: Whether the creation succeeded or not.
type: boolean
name:
description: The name of the considered resource.
type: string
required:
- created
type: object
subscriptions:
additionalProperties:
description: |-
SubscriptionStatus is an enumeration of the different states that can be
assumed by the subscription to a service (e.g. successful or failing).
enum:
- Ok
- Failed
type: string
description: |-
The list of the subscriptions to external services (e.g. Keycloak,
...), indicating for each one whether it succeeded or an error
occurred.
type: object
required:
- failingWorkspaces
- personalNamespace
- ready
- sandboxNamespace
- subscriptions
type: object
type: object
served: true
storage: true
subresources:
status: {}