Skip to content

Commit df656fe

Browse files
committed
Add RosaRoleConfig API and CRD.
1 parent e9f2823 commit df656fe

19 files changed

+1988
-26
lines changed

PROJECT

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,59 +2,60 @@ version: "2"
22
domain: cluster.x-k8s.io
33
repo: sigs.k8s.io/cluster-api-provider-aws
44
resources:
5-
# v1beta1 types
65
- group: infrastructure
7-
version: v1beta1
86
kind: AWSMachine
9-
- group: infrastructure
107
version: v1beta1
11-
kind: AWSCluster
128
- group: infrastructure
9+
kind: AWSCluster
1310
version: v1beta1
14-
kind: AWSMachineTemplate
1511
- group: infrastructure
12+
kind: AWSMachineTemplate
1613
version: v1beta1
17-
kind: AWSClusterStaticIdentity
1814
- group: infrastructure
15+
kind: AWSClusterStaticIdentity
1916
version: v1beta1
20-
kind: AWSClusterRoleIdentity
2117
- group: infrastructure
18+
kind: AWSClusterRoleIdentity
2219
version: v1beta1
23-
kind: AWSClusterControllerIdentity
2420
- group: infrastructure
21+
kind: AWSClusterControllerIdentity
2522
version: v1beta1
26-
kind: AWSClusterTemplate
2723
- group: infrastructure
24+
kind: AWSClusterTemplate
2825
version: v1beta1
29-
kind: AWSManagedControlPlanes
3026
- group: infrastructure
27+
kind: AWSManagedControlPlanes
3128
version: v1beta1
29+
- group: infrastructure
3230
kind: AWSManagedCluster
33-
# v1beta2 types
31+
version: v1beta1
3432
- group: infrastructure
35-
version: v1beta2
3633
kind: AWSMachine
37-
- group: infrastructure
3834
version: v1beta2
39-
kind: AWSCluster
4035
- group: infrastructure
36+
kind: AWSCluster
4137
version: v1beta2
42-
kind: AWSMachineTemplate
4338
- group: infrastructure
39+
kind: AWSMachineTemplate
4440
version: v1beta2
45-
kind: AWSClusterStaticIdentity
4641
- group: infrastructure
42+
kind: AWSClusterStaticIdentity
4743
version: v1beta2
48-
kind: AWSClusterRoleIdentity
4944
- group: infrastructure
45+
kind: AWSClusterRoleIdentity
5046
version: v1beta2
51-
kind: AWSClusterControllerIdentity
5247
- group: infrastructure
48+
kind: AWSClusterControllerIdentity
5349
version: v1beta2
54-
kind: AWSClusterTemplate
5550
- group: infrastructure
51+
kind: AWSClusterTemplate
5652
version: v1beta2
57-
kind: AWSManagedControlPlanes
5853
- group: infrastructure
54+
kind: AWSManagedControlPlanes
5955
version: v1beta2
56+
- group: infrastructure
6057
kind: AWSManagedCluster
58+
version: v1beta2
59+
- group: infrastructure
60+
kind: ROSARoleConfig
61+
version: v1beta2

config/crd/bases/infrastructure.cluster.x-k8s.io_rosaroleconfig.yaml

Lines changed: 440 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 257 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.16.5
7+
name: rosaroleconfigs.infrastructure.cluster.x-k8s.io
8+
spec:
9+
group: infrastructure.cluster.x-k8s.io
10+
names:
11+
kind: ROSARoleConfig
12+
listKind: ROSARoleConfigList
13+
plural: rosaroleconfigs
14+
singular: rosaroleconfig
15+
scope: Namespaced
16+
versions:
17+
- name: v1beta2
18+
schema:
19+
openAPIV3Schema:
20+
description: ROSARoleConfig is the Schema for the rosaroleconfigs API
21+
properties:
22+
apiVersion:
23+
description: |-
24+
APIVersion defines the versioned schema of this representation of an object.
25+
Servers should convert recognized schemas to the latest internal value, and
26+
may reject unrecognized values.
27+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
28+
type: string
29+
kind:
30+
description: |-
31+
Kind is a string value representing the REST resource this object represents.
32+
Servers may infer this from the endpoint the client submits requests to.
33+
Cannot be updated.
34+
In CamelCase.
35+
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+
properties:
41+
accountRoleConfig:
42+
properties:
43+
path:
44+
type: string
45+
permissionsBoundaryARN:
46+
type: string
47+
prefix:
48+
maxLength: 4
49+
type: string
50+
sharedVPCConfig:
51+
properties:
52+
routeRoleARN:
53+
type: string
54+
vpcEndpointRoleArn:
55+
type: string
56+
type: object
57+
version:
58+
type: string
59+
required:
60+
- prefix
61+
- version
62+
type: object
63+
oidcConfig:
64+
properties:
65+
createManagedOIDC:
66+
type: string
67+
externalAuthProviders:
68+
items:
69+
properties:
70+
claimMappings:
71+
properties:
72+
groups:
73+
properties:
74+
claim:
75+
type: string
76+
prefixPolicy:
77+
type: string
78+
required:
79+
- claim
80+
type: object
81+
username:
82+
properties:
83+
claim:
84+
type: string
85+
prefixPolicy:
86+
type: string
87+
required:
88+
- claim
89+
type: object
90+
required:
91+
- username
92+
type: object
93+
issuer:
94+
properties:
95+
audiences:
96+
items:
97+
type: string
98+
type: array
99+
issuerURL:
100+
type: string
101+
required:
102+
- issuerURL
103+
type: object
104+
name:
105+
type: string
106+
oidcClients:
107+
items:
108+
properties:
109+
clientID:
110+
type: string
111+
clientSecret:
112+
properties:
113+
name:
114+
type: string
115+
required:
116+
- name
117+
type: object
118+
componentName:
119+
type: string
120+
componentNamespace:
121+
type: string
122+
required:
123+
- clientID
124+
- clientSecret
125+
- componentName
126+
- componentNamespace
127+
type: object
128+
type: array
129+
required:
130+
- claimMappings
131+
- issuer
132+
- name
133+
type: object
134+
type: array
135+
required:
136+
- createManagedOIDC
137+
type: object
138+
operatorRoleConfig:
139+
properties:
140+
oidcConfigId:
141+
type: string
142+
permissionsBoundaryARN:
143+
type: string
144+
prefix:
145+
maxLength: 4
146+
type: string
147+
sharedVPCConfig:
148+
properties:
149+
routeRoleARN:
150+
type: string
151+
vpcEndpointRoleArn:
152+
type: string
153+
type: object
154+
required:
155+
- oidcConfigId
156+
- prefix
157+
type: object
158+
required:
159+
- accountRoleConfig
160+
- oidcConfig
161+
- operatorRoleConfig
162+
type: object
163+
status:
164+
description: ROSARoleConfigStatus defines the observed state of ROSARoleConfig
165+
properties:
166+
accountRolesRef:
167+
properties:
168+
installerRoleARN:
169+
type: string
170+
supportRoleARN:
171+
type: string
172+
workerRoleARN:
173+
type: string
174+
type: object
175+
conditions:
176+
items:
177+
description: Condition contains details for one aspect of the current
178+
state of this API Resource.
179+
properties:
180+
lastTransitionTime:
181+
description: |-
182+
lastTransitionTime is the last time the condition transitioned from one status to another.
183+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
184+
format: date-time
185+
type: string
186+
message:
187+
description: |-
188+
message is a human readable message indicating details about the transition.
189+
This may be an empty string.
190+
maxLength: 32768
191+
type: string
192+
observedGeneration:
193+
description: |-
194+
observedGeneration represents the .metadata.generation that the condition was set based upon.
195+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
196+
with respect to the current state of the instance.
197+
format: int64
198+
minimum: 0
199+
type: integer
200+
reason:
201+
description: |-
202+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
203+
Producers of specific condition types may define expected values and meanings for this field,
204+
and whether the values are considered a guaranteed API.
205+
The value should be a CamelCase string.
206+
This field may not be empty.
207+
maxLength: 1024
208+
minLength: 1
209+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
210+
type: string
211+
status:
212+
description: status of the condition, one of True, False, Unknown.
213+
enum:
214+
- "True"
215+
- "False"
216+
- Unknown
217+
type: string
218+
type:
219+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
220+
maxLength: 316
221+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
222+
type: string
223+
required:
224+
- lastTransitionTime
225+
- message
226+
- reason
227+
- status
228+
- type
229+
type: object
230+
type: array
231+
oidcID:
232+
type: string
233+
oidcProviderARN:
234+
type: string
235+
operatorRolesRef:
236+
properties:
237+
controlPlaneOperatorARN:
238+
type: string
239+
imageRegistryARN:
240+
type: string
241+
ingressARN:
242+
type: string
243+
kmsProviderARN:
244+
type: string
245+
kubeCloudControllerARN:
246+
type: string
247+
networkARN:
248+
type: string
249+
nodePoolManagementARN:
250+
type: string
251+
storageARN:
252+
type: string
253+
type: object
254+
type: object
255+
type: object
256+
served: true
257+
storage: true

config/crd/kustomization.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ resources:
2424
- bases/controlplane.cluster.x-k8s.io_rosacontrolplanes.yaml
2525
- bases/infrastructure.cluster.x-k8s.io_rosaclusters.yaml
2626
- bases/infrastructure.cluster.x-k8s.io_rosamachinepools.yaml
27+
- bases/infrastructure.cluster.x-k8s.io_rosaroleconfigs.yaml
2728
# +kubebuilder:scaffold:crdkustomizeresource
2829

2930
patchesStrategicMerge:
@@ -38,6 +39,7 @@ patchesStrategicMerge:
3839
- patches/webhook_in_awsmanagedcontrolplanes.yaml
3940
- patches/webhook_in_eksconfigs.yaml
4041
- patches/webhook_in_eksconfigtemplates.yaml
42+
#- patches/webhook_in_rosaroleconfigs.yaml
4143
# +kubebuilder:scaffold:crdkustomizewebhookpatch
4244

4345
# [CERTMANAGER] To enable webhook, uncomment all the sections with [CERTMANAGER] prefix.
@@ -52,6 +54,7 @@ patchesStrategicMerge:
5254
- patches/cainjection_in_awsmanagedclusters.yaml
5355
- patches/cainjection_in_eksconfigs.yaml
5456
- patches/cainjection_in_eksconfigtemplates.yaml
57+
#- patches/cainjection_in_rosaroleconfigs.yaml
5558
# +kubebuilder:scaffold:crdkustomizecainjectionpatch
5659

5760
# [LABEL] To enable label, uncomment all the sections with [LABEL] prefix.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# The following patch adds a directive for certmanager to inject CA into the CRD
2+
# CRD conversion requires k8s 1.13 or later.
3+
apiVersion: apiextensions.k8s.io/v1beta1
4+
kind: CustomResourceDefinition
5+
metadata:
6+
annotations:
7+
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
8+
name: rosaroleconfigs.infrastructure.cluster.x-k8s.io
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# The following patch enables conversion webhook for CRD
2+
# CRD conversion requires k8s 1.13 or later.
3+
apiVersion: apiextensions.k8s.io/v1beta1
4+
kind: CustomResourceDefinition
5+
metadata:
6+
name: rosaroleconfigs.infrastructure.cluster.x-k8s.io
7+
spec:
8+
conversion:
9+
strategy: Webhook
10+
webhookClientConfig:
11+
service:
12+
namespace: system
13+
name: webhook-service
14+
path: /convert

0 commit comments

Comments
 (0)