How to deploy GKE specific version using ansible

4/5/2021

I was trying to use ansible to deploy the GKE cluster. But when I use initialClusterVersion with ansible gcp_container_cluster, the error output like this.

fatal: localhost: FAILED! => {"changed": false, "msg": "Unsupported parameters for (gcp_container_cluster) module: initialClusterVersion Supported parameters include: addons_config, auth_kind, cluster_ipv4_cidr, default_max_pods_constraint, description, enable_tpu, env_type, initial_node_count, ip_allocation_policy, kubectl_context, kubectl_path, legacy_abac, location, locations, logging_service, master_auth, monitoring_service, name, network, network_policy, node_config, private_cluster_config, project, resource_labels, scopes, service_account_contents, service_account_email, service_account_file, state, subnetwork, tpu_ipv4_cidr_block"}

-- Sanka Sathyaji
ansible
google-cloud-platform
google-kubernetes-engine
kubernetes

2 Answers

4/5/2021

initialClusterVersion is a return value, not a parameter.

You can use the initial_cluster_version parameter if using Ansible versions 2.10 or 3.

Looking at your error message listing the supported parameters, I assume you are using an older version, and therefore will need to upgrade if you need to use the initial_cluster_version parameter.

-- Omar Asensio
Source: StackOverflow

4/8/2021

Thanks for the answer. I am using Ansible 2.9. Anyway, I managed to get the correct version with gcp_container_node_pool. As a workaround, I use the node pool GKE version.

- gcp_container_node_pool 
    version: 1.18.16-gke.302 
-- Sanka Sathyaji
Source: StackOverflow