Allow selection of network/subnetworks when creating GKE Cluster in GitLab
### Problem to solve
Currently, the creation of a Kubernetes cluster on GKE requires the cluster name/id, GCP project, zone, node count and machine type. There is no provision to specify a network / subnetwork name, leading to usage of the default VPC network of the specified project according to:
> By default, the cluster is created in the project's default network. See [here](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters/create)
In use-cases where the default network is unavailable, all IPs within the network's subnet has been exhausted or some company policies prevent a user from using the default network; they will have no choice but to create the cluster on GCP and add it manually.
### Further details
Take for example the internal `gitlab-demos` project of GitLab on GCP, the creation of Clusters automatically is currently not possible because the IPs in the default network has been exhausted. The user has to specify a different network.
### Proposal
The [list](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.aggregated.usableSubnetworks/list) method of the [usableSubnetworks](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.aggregated.usableSubnetworks) resource of the GCP API provides the list of networks and subnetworks when a project is specified. Once the GCP project is selected, the method can be called to list available networks in the project for the user to select.
When creating the cluster, the `network` and `subnetwork` can then be specified in the GCP API Request based on the user's selection. So, in [/lib/google_api/cloud_platform/client.rb](https://gitlab.com/gitlab-org/gitlab-ce/blob/c10c553e1db344f0cd65454373c63af0a5cb58f0/lib/google_api/cloud_platform/client.rb#L59), we can have:
```ruby
request_body = Google::Apis::ContainerV1::CreateClusterRequest.new(
{
"cluster": {
"name": cluster_name,
"initial_node_count": cluster_size,
"network": user_selected_network,
"subnetwork": user_select_subnetwork,
"node_config": {
"machine_type": machine_type
},
"legacy_abac": {
"enabled": legacy_abac
}
}
}
)
```
### What does success look like, and how can we measure that?
Users are able to select a network and subnetwork when creating a GKE Cluster automatically from within GitLab.
### Links / references
/cc @northrup @tatkins
<!-- triage-serverless v3 PLEASE DO NOT REMOVE THIS SECTION -->
*This page may contain information related to upcoming products, features and functionality.
It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes.
Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.*
<!-- triage-serverless v3 PLEASE DO NOT REMOVE THIS SECTION -->
issue