| title | About the google_container_node_pool Resource |
|---|---|
| platform | gcp |
Use the google_container_node_pool InSpec audit resource to test properties of a single GCP container node pool.
A google_container_node_pool resource block declares the tests for a single GCP container node pool by project, zone, cluster name and nodepool name.
describe google_container_node_pool(project: 'chef-inspec-gcp', zone: 'europe-west2-a', cluster_name: 'inspec-gcp-kube-cluster', nodepool_name: 'inspec-gcp-kube-node-pool') do
it { should exist }
its('name') { should eq 'inspec-gcp-kube-node-pool' }
its('zone') { should match 'europe-west2-a' }
end
The following examples show how to use this InSpec audit resource.
describe google_container_node_pool(project: 'chef-inspec-gcp', zone: 'europe-west2-a', cluster_name: 'inspec-gcp-kube-cluster', nodepool_name: 'inspec-gcp-kube-node-pool') do
its('status') { should eq 'RUNNING' }
end
describe google_container_node_pool(project: 'chef-inspec-gcp', zone: 'europe-west2-a', cluster_name: 'inspec-gcp-kube-cluster', nodepool_name: 'inspec-gcp-kube-node-pool') do
its('node_config.disk_size_gb'){should eq 100}
end
describe google_container_node_pool(project: 'chef-inspec-gcp', zone: 'europe-west2-a', cluster_name: 'inspec-gcp-kube-cluster', nodepool_name: 'inspec-gcp-kube-node-pool') do
its('node_config.machine_type'){should eq "n1-standard-1"}
end
describe google_container_node_pool(project: 'chef-inspec-gcp', zone: 'europe-west2-a', cluster_name: 'inspec-gcp-kube-cluster', nodepool_name: 'inspec-gcp-kube-node-pool') do
its('node_config.image_type'){should eq "COS"}
end
describe google_container_node_pool(project: 'chef-inspec-gcp', zone: 'europe-west2-a', cluster_name: 'inspec-gcp-kube-cluster', nodepool_name: 'inspec-gcp-kube-node-pool') do
its('initial_node_count'){should eq 3}
end
config,initial_node_count,instance_group_urls,management,name,status,version
Ensure the Kubernetes Engine API is enabled for the project where the resource is located.