Skip to content

Commit 01f18e5

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

18 files changed

+1731
-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_rosaroleconfigs.yaml

Lines changed: 440 additions & 0 deletions
Large diffs are not rendered by default.

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

config/rbac/role.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ rules:
176176
- awsfargateprofiles/status
177177
- rosaclusters/status
178178
- rosamachinepools/status
179+
- rosaroleconfigs/status
179180
verbs:
180181
- get
181182
- patch
@@ -197,6 +198,7 @@ rules:
197198
- infrastructure.cluster.x-k8s.io
198199
resources:
199200
- awsmachines
201+
- rosaroleconfigs
200202
verbs:
201203
- create
202204
- delete

controllers/suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ import (
2525
"k8s.io/client-go/kubernetes/scheme"
2626
ctrl "sigs.k8s.io/controller-runtime"
2727

28-
// +kubebuilder:scaffold:imports
2928
infrav1 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2"
3029
"sigs.k8s.io/cluster-api-provider-aws/v2/test/helpers"
30+
// +kubebuilder:scaffold:imports
3131
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
3232
kubeadmv1beta1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1"
3333
)

0 commit comments

Comments
 (0)