Skip to content

Commit 29808fb

Browse files
committed
feat: add support for gke clusterclass
Signed-off-by: Carlos Salas <[email protected]>
1 parent 2f1320c commit 29808fb

24 files changed

+1826
-192
lines changed

cloud/scope/managedmachinepool_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ var _ = Describe("GCPManagedMachinePool Scope", func() {
3131
Namespace: namespace,
3232
},
3333
Spec: v1beta1.GCPManagedMachinePoolSpec{
34-
NodePoolName: nodePoolName,
34+
GCPManagedMachinePoolClassSpec: v1beta1.GCPManagedMachinePoolClassSpec{
35+
NodePoolName: nodePoolName,
36+
},
3537
},
3638
}
3739
TestMP = &clusterv1exp.MachinePool{
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.17.1
7+
name: gcpmanagedclustertemplates.infrastructure.cluster.x-k8s.io
8+
spec:
9+
group: infrastructure.cluster.x-k8s.io
10+
names:
11+
categories:
12+
- cluster-api
13+
kind: GCPManagedClusterTemplate
14+
listKind: GCPManagedClusterTemplateList
15+
plural: gcpmanagedclustertemplates
16+
shortNames:
17+
- amct
18+
singular: gcpmanagedclustertemplate
19+
scope: Namespaced
20+
versions:
21+
- name: v1beta1
22+
schema:
23+
openAPIV3Schema:
24+
description: GCPManagedClusterTemplate is the Schema for the GCPManagedClusterTemplates
25+
API.
26+
properties:
27+
apiVersion:
28+
description: |-
29+
APIVersion defines the versioned schema of this representation of an object.
30+
Servers should convert recognized schemas to the latest internal value, and
31+
may reject unrecognized values.
32+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
33+
type: string
34+
kind:
35+
description: |-
36+
Kind is a string value representing the REST resource this object represents.
37+
Servers may infer this from the endpoint the client submits requests to.
38+
Cannot be updated.
39+
In CamelCase.
40+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
41+
type: string
42+
metadata:
43+
type: object
44+
spec:
45+
description: GCPManagedClusterTemplateSpec defines the desired state of
46+
GCPManagedClusterTemplate.
47+
properties:
48+
template:
49+
description: GCPManagedClusterTemplateResource describes the data
50+
needed to create an GCPManagedCluster from a template.
51+
properties:
52+
spec:
53+
description: GCPManagedClusterTemplateResourceSpec specifies an
54+
GCP managed cluster template resource.
55+
type: object
56+
required:
57+
- spec
58+
type: object
59+
required:
60+
- template
61+
type: object
62+
type: object
63+
served: true
64+
storage: true
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.17.1
7+
name: gcpmanagedcontrolplanetemplates.infrastructure.cluster.x-k8s.io
8+
spec:
9+
group: infrastructure.cluster.x-k8s.io
10+
names:
11+
categories:
12+
- cluster-api
13+
kind: GCPManagedControlPlaneTemplate
14+
listKind: GCPManagedControlPlaneTemplateList
15+
plural: gcpmanagedcontrolplanetemplates
16+
shortNames:
17+
- amcpt
18+
singular: gcpmanagedcontrolplanetemplate
19+
scope: Namespaced
20+
versions:
21+
- name: v1beta1
22+
schema:
23+
openAPIV3Schema:
24+
description: GCPManagedControlPlaneTemplate is the Schema for the GCPManagedControlPlaneTemplates
25+
API.
26+
properties:
27+
apiVersion:
28+
description: |-
29+
APIVersion defines the versioned schema of this representation of an object.
30+
Servers should convert recognized schemas to the latest internal value, and
31+
may reject unrecognized values.
32+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
33+
type: string
34+
kind:
35+
description: |-
36+
Kind is a string value representing the REST resource this object represents.
37+
Servers may infer this from the endpoint the client submits requests to.
38+
Cannot be updated.
39+
In CamelCase.
40+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
41+
type: string
42+
metadata:
43+
type: object
44+
spec:
45+
description: GCPManagedControlPlaneTemplateSpec defines the desired state
46+
of GCPManagedControlPlaneTemplate.
47+
properties:
48+
template:
49+
description: GCPManagedControlPlaneTemplateResource describes the
50+
data needed to create an GCPManagedCluster from a template.
51+
properties:
52+
spec:
53+
description: GCPManagedControlPlaneTemplateResourceSpec specifies
54+
an GCP managed control plane template resource.
55+
properties:
56+
clusterNetwork:
57+
description: ClusterNetwork define the cluster network.
58+
properties:
59+
pod:
60+
description: Pod defines the range of CIDRBlock list from
61+
where it gets the IP address.
62+
properties:
63+
cidrBlock:
64+
description: |-
65+
CidrBlock is where all pods in the cluster are assigned an IP address from this range. Enter a range
66+
(in CIDR notation) within a network range, a mask, or leave this field blank to use a default range.
67+
This setting is permanent.
68+
type: string
69+
type: object
70+
privateCluster:
71+
description: PrivateCluster defines the private cluster
72+
spec.
73+
properties:
74+
controlPlaneCidrBlock:
75+
description: |-
76+
ControlPlaneCidrBlock is the IP range in CIDR notation to use for the hosted master network. This range must not
77+
overlap with any other ranges in use within the cluster's network. Honored when enabled is true.
78+
type: string
79+
controlPlaneGlobalAccess:
80+
description: ControlPlaneGlobalAccess is whenever
81+
master is accessible globally or not. Honored when
82+
enabled is true.
83+
type: boolean
84+
disableDefaultSNAT:
85+
description: DisableDefaultSNAT disables cluster default
86+
sNAT rules. Honored when enabled is true.
87+
type: boolean
88+
enablePrivateEndpoint:
89+
description: |-
90+
EnablePrivateEndpoint: Whether the master's internal IP
91+
address is used as the cluster endpoint.
92+
type: boolean
93+
enablePrivateNodes:
94+
description: |-
95+
EnablePrivateNodes: Whether nodes have internal IP
96+
addresses only. If enabled, all nodes are given only RFC
97+
1918 private addresses and communicate with the master via
98+
private networking.
99+
type: boolean
100+
type: object
101+
service:
102+
description: Service defines the range of CIDRBlock list
103+
from where it gets the IP address.
104+
properties:
105+
cidrBlock:
106+
description: |-
107+
CidrBlock is where cluster services will be assigned an IP address from this IP address range. Enter a range
108+
(in CIDR notation) within a network range, a mask, or leave this field blank to use a default range.
109+
This setting is permanent.
110+
type: string
111+
type: object
112+
useIPAliases:
113+
description: |-
114+
UseIPAliases is whether alias IPs will be used for pod IPs in the cluster. If false, routes will be used for
115+
pod IPs in the cluster.
116+
type: boolean
117+
type: object
118+
enableAutopilot:
119+
description: EnableAutopilot indicates whether to enable autopilot
120+
for this GKE cluster.
121+
type: boolean
122+
enableIdentityService:
123+
description: EnableIdentityService indicates whether to enable
124+
Identity Service component for this GKE cluster.
125+
type: boolean
126+
location:
127+
description: |-
128+
Location represents the location (region or zone) in which the GKE cluster
129+
will be created.
130+
type: string
131+
loggingService:
132+
description: |-
133+
LoggingService represents configuration of logging service feature of the GKE cluster.
134+
Possible values: none, logging.googleapis.com/kubernetes (default).
135+
Value is ignored when enableAutopilot = true.
136+
type: string
137+
master_authorized_networks_config:
138+
description: |-
139+
MasterAuthorizedNetworksConfig represents configuration options for master authorized networks feature of the GKE cluster.
140+
This feature is disabled if this field is not specified.
141+
properties:
142+
cidr_blocks:
143+
description: |-
144+
cidr_blocks define up to 50 external networks that could access
145+
Kubernetes master through HTTPS.
146+
items:
147+
description: MasterAuthorizedNetworksConfigCidrBlock
148+
contains an optional name and one CIDR block.
149+
properties:
150+
cidr_block:
151+
description: cidr_block must be specified in CIDR
152+
notation.
153+
pattern: ^(?:[0-9]{1,3}\.){3}[0-9]{1,3}(?:\/([0-9]|[1-2][0-9]|3[0-2]))?$|^([a-fA-F0-9:]+:+)+[a-fA-F0-9]+\/[0-9]{1,3}$
154+
type: string
155+
display_name:
156+
description: display_name is an field for users
157+
to identify CIDR blocks.
158+
type: string
159+
type: object
160+
type: array
161+
gcp_public_cidrs_access_enabled:
162+
description: Whether master is accessible via Google Compute
163+
Engine Public IP addresses.
164+
type: boolean
165+
type: object
166+
monitoringService:
167+
description: |-
168+
MonitoringService represents configuration of monitoring service feature of the GKE cluster.
169+
Possible values: none, monitoring.googleapis.com/kubernetes (default).
170+
Value is ignored when enableAutopilot = true.
171+
type: string
172+
project:
173+
description: Project is the name of the project to deploy
174+
the cluster to.
175+
type: string
176+
releaseChannel:
177+
description: ReleaseChannel represents the release channel
178+
of the GKE cluster.
179+
enum:
180+
- rapid
181+
- regular
182+
- stable
183+
type: string
184+
required:
185+
- location
186+
- project
187+
type: object
188+
required:
189+
- spec
190+
type: object
191+
required:
192+
- template
193+
type: object
194+
type: object
195+
served: true
196+
storage: true

0 commit comments

Comments
 (0)