Skip to content

Commit d2534a7

Browse files
committed
RosaNetwork
1 parent a5c3e0a commit d2534a7

13 files changed

+852
-1
lines changed

PROJECT

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,6 @@ resources:
5858
- group: infrastructure
5959
version: v1beta2
6060
kind: AWSManagedCluster
61+
- group: infrastructure
62+
kind: RosaNetwork
63+
version: v1beta2
Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
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: rosanetworks.infrastructure.cluster.x-k8s.io
8+
spec:
9+
group: infrastructure.cluster.x-k8s.io
10+
names:
11+
categories:
12+
- cluster-api
13+
kind: RosaNetwork
14+
listKind: RosaNetworkList
15+
plural: rosanetworks
16+
shortNames:
17+
- rosanet
18+
singular: rosanetwork
19+
scope: Namespaced
20+
versions:
21+
- name: v1beta2
22+
schema:
23+
openAPIV3Schema:
24+
description: RosaNetwork is the Schema for the rosanetworks API
25+
properties:
26+
apiVersion:
27+
description: |-
28+
APIVersion defines the versioned schema of this representation of an object.
29+
Servers should convert recognized schemas to the latest internal value, and
30+
may reject unrecognized values.
31+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
32+
type: string
33+
kind:
34+
description: |-
35+
Kind is a string value representing the REST resource this object represents.
36+
Servers may infer this from the endpoint the client submits requests to.
37+
Cannot be updated.
38+
In CamelCase.
39+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
40+
type: string
41+
metadata:
42+
type: object
43+
spec:
44+
description: RosaNetworkSpec defines the desired state of RosaNetwork
45+
properties:
46+
availabilityZoneCount:
47+
default: 1
48+
description: |-
49+
The number of availability zones to be used for creation of the network infrastructure.
50+
You can specify anything between one and four, depending on the chosen AWS region.
51+
type: integer
52+
availabilityZones:
53+
description: |-
54+
The list of availability zones to be used for creation of the network infrastructure.
55+
You can specify anything between one and four valid availability zones from a given region.
56+
Should you specify both the availabilityZoneCount and availabilityZones, the list of availability zones takes preference.
57+
items:
58+
type: string
59+
type: array
60+
cidrBlock:
61+
description: CIDR block to be used for the VPC
62+
format: cidr
63+
type: string
64+
identityRef:
65+
description: |-
66+
IdentityRef is a reference to an identity to be used when reconciling rosa network.
67+
If no identity is specified, the default identity for this controller will be used.
68+
properties:
69+
kind:
70+
description: Kind of the identity.
71+
enum:
72+
- AWSClusterControllerIdentity
73+
- AWSClusterRoleIdentity
74+
- AWSClusterStaticIdentity
75+
type: string
76+
name:
77+
description: Name of the identity.
78+
minLength: 1
79+
type: string
80+
required:
81+
- kind
82+
- name
83+
type: object
84+
name:
85+
description: The name of the cloudformation stack under which the
86+
network infrastructure would be created
87+
type: string
88+
region:
89+
description: The AWS region in which the components of ROSA network
90+
infrastruture are to be crated
91+
type: string
92+
required:
93+
- cidrBlock
94+
- name
95+
- region
96+
type: object
97+
status:
98+
description: RosaNetworkStatus defines the observed state of RosaNetwork
99+
properties:
100+
conditions:
101+
description: Conditions specifies the conditions for RosaNetwork
102+
items:
103+
description: Condition defines an observation of a Cluster API resource
104+
operational state.
105+
properties:
106+
lastTransitionTime:
107+
description: |-
108+
Last time the condition transitioned from one status to another.
109+
This should be when the underlying condition changed. If that is not known, then using the time when
110+
the API field changed is acceptable.
111+
format: date-time
112+
type: string
113+
message:
114+
description: |-
115+
A human readable message indicating details about the transition.
116+
This field may be empty.
117+
type: string
118+
reason:
119+
description: |-
120+
The reason for the condition's last transition in CamelCase.
121+
The specific API may choose whether or not this field is considered a guaranteed API.
122+
This field may be empty.
123+
type: string
124+
severity:
125+
description: |-
126+
severity provides an explicit classification of Reason code, so the users or machines can immediately
127+
understand the current situation and act accordingly.
128+
The Severity field MUST be set only when Status=False.
129+
type: string
130+
status:
131+
description: status of the condition, one of True, False, Unknown.
132+
type: string
133+
type:
134+
description: |-
135+
type of condition in CamelCase or in foo.example.com/CamelCase.
136+
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions
137+
can be useful (see .node.status.conditions), the ability to deconflict is important.
138+
type: string
139+
required:
140+
- lastTransitionTime
141+
- status
142+
- type
143+
type: object
144+
type: array
145+
resources:
146+
description: Resources created in the cloudformation stack
147+
items:
148+
description: CFResource groups information pertaining to a resource
149+
created as a part of a cloudformation stack
150+
properties:
151+
ID:
152+
description: Identified of the created resource. Will be filled
153+
in once the resource is created & ready
154+
type: string
155+
reason:
156+
description: Message pertaining to the status of the resource
157+
type: string
158+
resource:
159+
description: 'Name of the created resource: NATGateway1, VPC,
160+
SecurityGroup, ...'
161+
type: string
162+
status:
163+
description: 'Status of the resource: CREATE_IN_PROGRESS, CREATE_COMPLETE,
164+
...'
165+
type: string
166+
required:
167+
- ID
168+
- reason
169+
- resource
170+
- status
171+
type: object
172+
type: array
173+
subnets:
174+
description: Array of created private, public subnets and availability
175+
zones, grouped by availability zones
176+
items:
177+
description: RosaNetworkSubnet groups public and private subnet
178+
and the availability zone in which the two subnets got created
179+
properties:
180+
availabilityZone:
181+
description: Availability zone of the subnet pair
182+
type: string
183+
privateSubnet:
184+
description: ID of the private subnet
185+
type: string
186+
publicSubnet:
187+
description: ID of the public subnet
188+
type: string
189+
required:
190+
- availabilityZone
191+
- privateSubnet
192+
- publicSubnet
193+
type: object
194+
type: array
195+
required:
196+
- resources
197+
- subnets
198+
type: object
199+
type: object
200+
served: true
201+
storage: true
202+
subresources:
203+
status: {}

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_rosanetworks.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_rosanetworks.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_rosanetworks.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: rosanetworks.infrastructure.cluster.x-k8s.io
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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: rosanetworks.infrastructure.cluster.x-k8s.io
7+
spec:
8+
conversion:
9+
strategy: Webhook
10+
webhookClientConfig:
11+
# this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank,
12+
# but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager)
13+
caBundle: Cg==
14+
service:
15+
namespace: system
16+
name: webhook-service
17+
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+
- rosanetworks/status
179180
verbs:
180181
- get
181182
- patch
@@ -197,6 +198,7 @@ rules:
197198
- infrastructure.cluster.x-k8s.io
198199
resources:
199200
- awsmachines
201+
- rosanetworks
200202
verbs:
201203
- create
202204
- delete

0 commit comments

Comments
 (0)