I am trying to use Ansible (with the google.cloud.gcp_container_cluster
module) to create a GKE cluster, and I am encountering several issues. Mostly related to the very…. limited documentation available.
-
Even though the module forces me to set
initial_nodes
to a non-zero value (otherwise I get an error:Cluster.initial_node_count must be greater than zero
), the cluster is always created with zero nodes. Because it appears that the module always deletes thedefault
node pool that is automatically created. -
According to the documentation, we should be able to create a node pool by providing
initial_node_count
andnode_config
:
The number of nodes to create in this cluster. You must ensure that
your Compute Engine resource quota is sufficient for this number of
instances. You must also have available firewall and routes quota. For
requests, this field should only be used in lieu of a “nodePool”
object, since this configuration (along with the “nodeConfig”) will be
used to create a “NodePool” object with an auto-generated name. Do not
use this and a nodePool at the same time.
However, the same documentation states:
This field has been deprecated. Please use
nodePool.initial_node_count
instead.
And, as you can see above, any config I try to provide here is basically ignored (since the default
pool always gets deleted after being created). And there is no option called nodePool
(or node_pool
, or similar).
My question is: is there any (documented) way of creating an initial node pool on cluster creation? What parameters do I need to specify for that?
Yes, there is a workaround (create cluster, wait for the default node pool to be deleted, manually create another node pool). But this seems to defeat the entire purpose of having something like initial_node_count
in the first place. And since it is there, and documented, I have to ask – how do I use it?
Thank you,