Open ecksun opened 11 months ago
I believe this is inherited by the cluster type you create. You bind it to specific network and that's immutable once created.
See this doc: https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters#gcloud
These are the properties you need to set: --enable-ip-alias \ --enable-private-nodes \ --master-ipv4-cidr 172.16.0.0/28
- name: create cluster
gcp_container_cluster:
ip_allocation_policy:
stack_type: "{{ gke_ip_stack | default(omit) }}" ## V4 vs V6 or both
use_ip_aliases: "{{ use_ip_aliases | default(omit) }}"
private_cluster_config:
enable_private_nodes: "{{ enablePrivateNodes |default(omit) }}"
master_ipv4_cidr_block: "{{ masterIpv4CidrBlock |default(omit) }}"
I believe this is inherited by the cluster type you create. You bind it to specific network and that's immutable once created.
Alright, thats good if you want your cluster to be uniform, i.e. all node-pools to be either public or private. In my particular case I would like to create one nodepool with public IPs and one with only private IPs, which is why I think it would make sense to be able to configure that per nodepool. IIRC that is possible in the gcp web UI
You may want to double check your assertion. At least the last time I've done this, this was set at the cluster level, you couldn't create a node pool and change the networking configuration. They have a beta feature called "Multi-networking" but I don't think that's what you're looking either.
You may want to double check your assertion. At least the last time I've done this, this was set at the cluster level, you couldn't create a node pool and change the networking configuration. They have a beta feature called "Multi-networking" but I don't think that's what you're looking either.
I'm not so sure, the dialog for creating a new node pool have a checkbox called Enable private nodes
:
Which seems to correspond to this field (the docs from projects.locations.clusters.nodePools from projects.locations.clusters.nodePools.create):
"networkConfig": {
"enablePrivateNodes": true
}
SUMMARY
It should be possible to create node pools with private nodes
ISSUE TYPE
COMPONENT NAME
google.cloud.gcp_container_node_pool
should have a boolean field called
config.private_nodes
ADDITIONAL INFORMATION
Public IPs are a limited resource, being able to create private nodes would help ensure the nodes don't count towards the quota unnecessarily