google_container_node_pools resource
Syntax
A google_container_node_pools is used to test a Google NodePool resource
Beta Resource
This resource has beta fields available. To retrieve these fields, include beta: true in the constructor for the resource.
Examples
describe google_container_node_pools(project: 'chef-gcp-inspec', location: 'europe-west2-a', cluster_name: 'gcp-inspec-kube-cluster') do
its('initial_node_counts') { should include '1'}
end
Test that there are no more than a specified number of node pools available for the project
describe google_container_node_pools(project: 'chef-inspec-gcp') do
its('count') { should be <= 10}
end
Test that an expected node pool is available for the project
describe google_container_node_pools(project: 'chef-inspec-gcp') do
its('node_pool_names') { should include "us-east1-b" }
end
Test that a subset of all node pools matching “mypool*” are “UP”
google_container_node_pools(project: 'chef-inspec-gcp', location: 'europe-west2-a', cluster_name: 'inspec-gcp-cluster').where(node_pool_name: /^mypool/).node_pool_names.each do |node_pool_name|
describe google_container_node_pool(project: 'chef-inspec-gcp', location: 'europe-west2-a', cluster_name: 'inspec-gcp-cluster', nodepool_name: node_pool_name) do
it { should exist }
its('status') { should eq 'RUNNING' }
end
end
Properties
Properties that can be accessed from the google_container_node_pools resource:
See google_container_node_pool for more detailed information.
node_pool_names: an array ofgoogle_container_node_poolnameconfigs: an array ofgoogle_container_node_poolconfiginitial_node_counts: an array ofgoogle_container_node_poolinitial_node_countnode_pool_statuses: an array ofgoogle_container_node_poolstatusstatus_messages: an array ofgoogle_container_node_poolstatus_messageversions: an array ofgoogle_container_node_poolversionautoscalings: an array ofgoogle_container_node_poolautoscalingmanagements: an array ofgoogle_container_node_poolmanagementmax_pods_constraints: an array ofgoogle_container_node_poolmax_pods_constraintconditions: an array ofgoogle_container_node_poolconditionspod_ipv4_cidr_sizes: an array ofgoogle_container_node_poolpod_ipv4_cidr_sizeclusters: an array ofgoogle_container_node_poolclusterlocations: an array ofgoogle_container_node_poollocation
Filter criteria
This resource supports all of the above properties as filter criteria, which can be used
with where as a block or a method.
GCP permissions
Ensure the Kubernetes Engine API is enabled for the current project.