A google_container_clusters is used to test a Google Cluster resource.
This resource has beta fields available. To retrieve these fields, include beta: true in the constructor for the resource.
describe google_container_clusters(project: 'chef-gcp-inspec', location: 'europe-west2-a') do
its('cluster_names') { should include 'gcp-inspec-kube-cluster' }
end
describe google_container_clusters(project: 'chef-inspec-gcp', location: 'europe-west2-a') do
its('count') { should be <= 5}
end
describe google_container_clusters(project: 'chef-inspec-gcp', location: 'europe-west2-a') do
its('cluster_names') { should include "my-cluster" }
end
describe google_container_clusters(project: 'chef-inspec-gcp', location: 'europe-west2-a') do
its('cluster_statuses') { should_not include "STOPPING" }
end
google_container_clusters(project: gcp_project_id).where(cluster_name: /^kube/).cluster_names.each do |cluster_name|
describe google_container_cluster(project: 'chef-inspec-gcp', location: 'europe-west2-a', name: cluster_name) do
it { should exist }
its('status') { should eq 'RUNNING' }
end
end
Properties that can be accessed from the google_container_clusters resource:
See the google_container_cluster resource for more information.
cluster_namesgoogle_container_cluster namedescriptionsgoogle_container_cluster descriptioninitial_node_countsgoogle_container_cluster initial_node_countnode_configsgoogle_container_cluster node_configmaster_authsgoogle_container_cluster master_authlogging_servicesgoogle_container_cluster logging_servicemonitoring_servicesgoogle_container_cluster monitoring_servicecluster_networksgoogle_container_cluster networkprivate_cluster_configsgoogle_container_cluster private_cluster_configcluster_ipv4_cidrsgoogle_container_cluster cluster_ipv4_cidrenable_tpusgoogle_container_cluster enable_tputpu_ipv4_cidr_blocksgoogle_container_cluster tpu_ipv4_cidr_blockaddons_configsgoogle_container_cluster addons_configsubnetworksgoogle_container_cluster subnetworklocationsgoogle_container_cluster locationsresource_labelsgoogle_container_cluster resource_labelslabel_fingerprintsgoogle_container_cluster label_fingerprintlegacy_abacsgoogle_container_cluster legacy_abacnetwork_policiesgoogle_container_cluster network_policydefault_max_pods_constraintsgoogle_container_cluster default_max_pods_constraintip_allocation_policiesgoogle_container_cluster ip_allocation_policyendpointsgoogle_container_cluster endpointinitial_cluster_versionsgoogle_container_cluster initial_cluster_versioncurrent_master_versionsgoogle_container_cluster current_master_versioncurrent_node_versionsgoogle_container_cluster current_node_versioncreate_timesgoogle_container_cluster create_timecluster_statusesgoogle_container_cluster statusstatus_messagesgoogle_container_cluster status_messagenode_ipv4_cidr_sizesgoogle_container_cluster node_ipv4_cidr_sizeservices_ipv4_cidrsgoogle_container_cluster services_ipv4_cidrcurrent_node_countsgoogle_container_cluster current_node_countexpire_timesgoogle_container_cluster expire_timeconditionsgoogle_container_cluster conditionsmaster_authorized_networks_configsgoogle_container_cluster master_authorized_networks_confignode_poolsgoogle_container_cluster node_poolspod_security_policy_configsgoogle_container_cluster pod_security_policy_configbinary_authorizationsgoogle_container_cluster binary_authorizationlocationsgoogle_container_cluster locationThis resource supports all of the above properties as filter criteria, which can be used with where as a block or a method.
Ensure the Kubernetes Engine API is enabled for the current project.
© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/inspec/resources/google_container_clusters/