@@ -251,9 +251,10 @@ func (s *Service) createCluster(ctx context.Context, log *logr.Logger) error {
251251
252252 isRegional := shared .IsRegional (s .scope .Region ())
253253 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 (),
257258 Autopilot : & containerpb.Autopilot {
258259 Enabled : s .scope .GCPManagedControlPlane .Spec .EnableAutopilot ,
259260 },
@@ -265,6 +266,25 @@ func (s *Service) createCluster(ctx context.Context, log *logr.Logger) error {
265266 if s .scope .GCPManagedControlPlane .Spec .ControlPlaneVersion != nil {
266267 cluster .InitialClusterVersion = convertToSdkMasterVersion (* s .scope .GCPManagedControlPlane .Spec .ControlPlaneVersion )
267268 }
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+ }
268288 if ! s .scope .IsAutopilotCluster () {
269289 cluster .NodePools = scope .ConvertToSdkNodePools (nodePools , machinePools , isRegional , cluster .GetName ())
270290 }
0 commit comments