@@ -251,9 +251,10 @@ func (s *Service) createCluster(ctx context.Context, log *logr.Logger) error {
251
251
252
252
isRegional := shared .IsRegional (s .scope .Region ())
253
253
cluster := & containerpb.Cluster {
254
- Name : s .scope .ClusterName (),
255
- Network : * s .scope .GCPManagedCluster .Spec .Network .Name ,
256
- Subnetwork : s .getSubnetNameInClusterRegion (),
254
+ Name : s .scope .ClusterName (),
255
+ Description : s .scope .GCPManagedControlPlane .Spec .Description ,
256
+ Network : * s .scope .GCPManagedCluster .Spec .Network .Name ,
257
+ Subnetwork : s .getSubnetNameInClusterRegion (),
257
258
Autopilot : & containerpb.Autopilot {
258
259
Enabled : s .scope .GCPManagedControlPlane .Spec .EnableAutopilot ,
259
260
},
@@ -265,6 +266,25 @@ func (s *Service) createCluster(ctx context.Context, log *logr.Logger) error {
265
266
if s .scope .GCPManagedControlPlane .Spec .ControlPlaneVersion != nil {
266
267
cluster .InitialClusterVersion = convertToSdkMasterVersion (* s .scope .GCPManagedControlPlane .Spec .ControlPlaneVersion )
267
268
}
269
+ if s .scope .GCPManagedControlPlane .Spec .ClusterNetwork != nil {
270
+ cn := s .scope .GCPManagedControlPlane .Spec .ClusterNetwork
271
+ if cn .UseIPAliases {
272
+ cluster .IpAllocationPolicy = & containerpb.IPAllocationPolicy {}
273
+ cluster .IpAllocationPolicy .UseIpAliases = cn .UseIPAliases
274
+ }
275
+ if cn .PrivateCluster != nil {
276
+ cluster .PrivateClusterConfig = & containerpb.PrivateClusterConfig {}
277
+ cluster .PrivateClusterConfig .EnablePrivateEndpoint = cn .PrivateCluster .EnablePrivateEndpoint
278
+ cluster .PrivateClusterConfig .EnablePrivateNodes = cn .PrivateCluster .EnablePrivateNodes
279
+
280
+ cluster .PrivateClusterConfig .MasterIpv4CidrBlock = cn .PrivateCluster .ControlPlaneCidrBlock
281
+ cluster .PrivateClusterConfig .MasterGlobalAccessConfig = & containerpb.PrivateClusterMasterGlobalAccessConfig {
282
+ Enabled : cn .PrivateCluster .ControlPlaneGlobalAccess ,
283
+ }
284
+
285
+ // TODO(Akshay): Set Default SNAT
286
+ }
287
+ }
268
288
if ! s .scope .IsAutopilotCluster () {
269
289
cluster .NodePools = scope .ConvertToSdkNodePools (nodePools , machinePools , isRegional , cluster .GetName ())
270
290
}
0 commit comments