forked from NatzkaLabsOpenSource/managed-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuxp-aks-composition.yaml
317 lines (310 loc) · 8.58 KB
/
uxp-aks-composition.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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
name: official-aks
labels:
crossplane.io/xrd: xmanagedclusters.compositions.io
provider: official
cluster: aks
spec:
compositeTypeRef:
apiVersion: compositions.io/v1alpha1
kind: XManagedCluster
writeConnectionSecretsToNamespace: upbound-system
patchSets:
- name: metadata
patches:
- fromFieldPath: metadata.labels
- name: region
patches:
- fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.location
transforms:
- type: map
map:
use1: eastus
use2: eastus2
usw1: westus
usw2: westus2
cac: canadacentral
sae: brazilsouth
afs: southafricanorth
euc: germanywestcentral
euw1: northeurope
euw2: uksouth
euw3: francecentral
eus: switzerlandnorth
eun: swedencentral
ape: eastasia
aps1: westindia
apne1: japaneast
apne2: koreacentral
apne3: japanwest
apse1: southeastasia
apse2: australiaeast
apse3: australiacentral
resources:
- name: rg
base:
apiVersion: azure.upbound.io/v1beta1
kind: ResourceGroup
spec:
providerConfigRef:
name: azure-uxp-provider
patches:
- type: PatchSet
patchSetName: metadata
- type: PatchSet
patchSetName: region
- fromFieldPath: spec.id
toFieldPath: metadata.name
transforms:
- type: string
string:
fmt: "rg-%s"
- type: FromCompositeFieldPath
fromFieldPath: metadata.name
toFieldPath: metadata.labels.resourcegroup
- name: vnet
base:
apiVersion: network.azure.upbound.io/v1beta1
kind: VirtualNetwork
spec:
forProvider:
resourceGroupNameSelector:
matchControllerRef: true
addressSpace:
- 10.0.0.0/16
providerConfigRef:
name: azure-uxp-provider
patches:
- type: PatchSet
patchSetName: metadata
- type: PatchSet
patchSetName: region
- fromFieldPath: spec.id
toFieldPath: metadata.name
transforms:
- type: string
string:
fmt: "vnet-%s"
- name: subnet
base:
apiVersion: network.azure.upbound.io/v1beta1
kind: Subnet
spec:
forProvider:
resourceGroupNameSelector:
matchControllerRef: true
virtualNetworkNameSelector:
matchControllerRef: true
addressPrefixes:
- 10.0.0.0/19
providerConfigRef:
name: azure-uxp-provider
patches:
- type: PatchSet
patchSetName: metadata
- fromFieldPath: spec.id
toFieldPath: metadata.name
transforms:
- type: string
string:
fmt: "snet-%s"
- name: akscluster
base:
apiVersion: containerservice.azure.upbound.io/v1beta1
kind: KubernetesCluster
spec:
forProvider:
dnsPrefix: uxpjet
roleBasedAccessControlEnabled: true
resourceGroupNameSelector:
matchControllerRef: true
defaultNodePool:
- name: default
nodeCount: 1
vmSize: Standard_D2s_v3
vnetSubnetIDSelector:
matchControllerRef: true
identity:
- type: SystemAssigned
writeConnectionSecretToRef:
namespace: upbound-system
providerConfigRef:
name: azure-uxp-provider
patches:
- type: PatchSet
patchSetName: metadata
- type: PatchSet
patchSetName: region
- fromFieldPath: spec.id
toFieldPath: metadata.name
transforms:
- type: string
string:
fmt: "cluster-%s"
- fromFieldPath: spec.id
toFieldPath: spec.writeConnectionSecretToRef.name
transforms:
- type: string
string:
fmt: "%s-akscluster"
- fromFieldPath: spec.parameters.version
toFieldPath: spec.forProvider.kubernetesVersion
# Values for default node group hardcoded
# - fromFieldPath: spec.id
# toFieldPath: spec.forProvider.defaultNodePool[0].name
# - fromFieldPath: spec.parameters.nodeCount
# toFieldPath: spec.forProvider.defaultNodePool[0].nodeCount
# - fromFieldPath: spec.parameters.nodeSize
# toFieldPath: spec.forProvider.defaultNodePool[0].vmSize
# transforms:
# - type: map
# map:
# small: Standard_D2s_v3
# medium: Standard_D4s_v3
# large: Standard_D8s_v3
- fromFieldPath: spec.writeConnectionSecretToRef.namespace
- type: ToCompositeFieldPath
fromFieldPath: metadata.name
toFieldPath: status.clusterName
- type: ToCompositeFieldPath
fromFieldPath: status.conditions[0].status
toFieldPath: status.controlPlaneStatus
- type: ToCompositeFieldPath
fromFieldPath: metadata.name
toFieldPath: status.fargateProfileStatus
transforms:
- type: string
string:
fmt: "NA4-%s"
connectionDetails:
- fromConnectionSecretKey: kubeconfig
readinessChecks:
- type: MatchString
fieldPath: status.conditions[0].status
matchString: "True"
- name: aksnode
base:
apiVersion: containerservice.azure.upbound.io/v1beta1
kind: KubernetesClusterNodePool
spec:
forProvider:
kubernetesClusterIdSelector:
matchControllerRef: true
vnetSubnetIDSelector:
matchControllerRef: true
providerConfigRef:
name: azure-uxp-provider
patches:
- type: PatchSet
patchSetName: metadata
- fromFieldPath: spec.id
toFieldPath: metadata.name
transforms:
- type: string
string:
fmt: "ng0%s"
- fromFieldPath: spec.parameters.nodeCount
toFieldPath: spec.forProvider.nodeCount
- fromFieldPath: spec.parameters.nodeSize
toFieldPath: spec.forProvider.vmSize
transforms:
- type: map
map:
small: Standard_D2s_v3
medium: Standard_D4s_v3
large: Standard_D8s_v3
- type: ToCompositeFieldPath
fromFieldPath: status.conditions[0].status
toFieldPath: status.nodePoolStatus
readinessChecks:
- type: MatchString
fieldPath: status.conditions[0].status
matchString: "True"
- name: kubernetes
base:
apiVersion: kubernetes.crossplane.io/v1alpha1
kind: ProviderConfig
spec:
credentials:
source: Secret
secretRef:
key: kubeconfig
patches:
- fromFieldPath: spec.id
toFieldPath: metadata.name
- fromFieldPath: spec.writeConnectionSecretToRef.namespace
toFieldPath: spec.credentials.secretRef.namespace
- fromFieldPath: spec.id
toFieldPath: spec.credentials.secretRef.name
transforms:
- type: string
string:
fmt: "%s-akscluster"
readinessChecks:
- type: None
- name: k8s-ns-xp
base:
apiVersion: kubernetes.crossplane.io/v1alpha1
kind: Object
spec:
forProvider:
manifest:
apiVersion: v1
kind: Namespace
metadata:
name: upbound-system
patches:
- fromFieldPath: spec.id
toFieldPath: metadata.name
transforms:
- type: string
string:
fmt: "%s-ns-xp"
- fromFieldPath: spec.id
toFieldPath: spec.providerConfigRef.name
- name: helm
base:
apiVersion: helm.crossplane.io/v1beta1
kind: ProviderConfig
spec:
credentials:
source: Secret
secretRef:
key: kubeconfig
patches:
- fromFieldPath: spec.id
toFieldPath: metadata.name
- fromFieldPath: spec.writeConnectionSecretToRef.namespace
toFieldPath: spec.credentials.secretRef.namespace
- fromFieldPath: spec.id
toFieldPath: spec.credentials.secretRef.name
transforms:
- type: string
string:
fmt: "%s-akscluster"
readinessChecks:
- type: None
- name: helm-uxp
base:
apiVersion: helm.crossplane.io/v1beta1
kind: Release
spec:
rollbackLimit: 3
forProvider:
namespace: upbound-system
chart:
name: universal-crossplane
repository: https://charts.upbound.io/stable
version: "1.9.1-up.2"
patches:
- fromFieldPath: spec.id
toFieldPath: metadata.name
transforms:
- type: string
string:
fmt: "%s-uxp"
- fromFieldPath: spec.id
toFieldPath: spec.providerConfigRef.name