title | platform |
---|---|
About the google_container_clusters resource |
gcp |
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
Test that there are no more than a specified number of clusters available for the project in a particular zone
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 google_container_cluster.md for more detailed information
cluster_names
: an array ofgoogle_container_cluster
namedescriptions
: an array ofgoogle_container_cluster
descriptioninitial_node_counts
: an array ofgoogle_container_cluster
initial_node_countnode_configs
: an array ofgoogle_container_cluster
node_configmaster_auths
: an array ofgoogle_container_cluster
master_authlogging_services
: an array ofgoogle_container_cluster
logging_servicemonitoring_services
: an array ofgoogle_container_cluster
monitoring_servicecluster_networks
: an array ofgoogle_container_cluster
networkprivate_cluster_configs
: an array ofgoogle_container_cluster
private_cluster_configcluster_ipv4_cidrs
: an array ofgoogle_container_cluster
cluster_ipv4_cidrenable_tpus
: an array ofgoogle_container_cluster
enable_tputpu_ipv4_cidr_blocks
: an array ofgoogle_container_cluster
tpu_ipv4_cidr_blockaddons_configs
: an array ofgoogle_container_cluster
addons_configsubnetworks
: an array ofgoogle_container_cluster
subnetworkdatapath_providers
: (Beta only) an array ofgoogle_container_cluster
datapath_providerlocations
: an array ofgoogle_container_cluster
locationsresource_labels
: an array ofgoogle_container_cluster
resource_labelslabel_fingerprints
: an array ofgoogle_container_cluster
label_fingerprintlegacy_abacs
: an array ofgoogle_container_cluster
legacy_abacnetwork_policies
: an array ofgoogle_container_cluster
network_policydefault_max_pods_constraints
: an array ofgoogle_container_cluster
default_max_pods_constraintip_allocation_policies
: an array ofgoogle_container_cluster
ip_allocation_policyendpoints
: an array ofgoogle_container_cluster
endpointinitial_cluster_versions
: an array ofgoogle_container_cluster
initial_cluster_versioncurrent_master_versions
: an array ofgoogle_container_cluster
current_master_versioncurrent_node_versions
: an array ofgoogle_container_cluster
current_node_versioncreate_times
: an array ofgoogle_container_cluster
create_timecluster_statuses
: an array ofgoogle_container_cluster
statusstatus_messages
: an array ofgoogle_container_cluster
status_messagenode_ipv4_cidr_sizes
: an array ofgoogle_container_cluster
node_ipv4_cidr_sizeservices_ipv4_cidrs
: an array ofgoogle_container_cluster
services_ipv4_cidrcurrent_node_counts
: an array ofgoogle_container_cluster
current_node_countexpire_times
: an array ofgoogle_container_cluster
expire_timeconditions
: an array ofgoogle_container_cluster
conditionsmaster_authorized_networks_configs
: an array ofgoogle_container_cluster
master_authorized_networks_confignode_pools
: an array ofgoogle_container_cluster
node_poolspod_security_policy_configs
: (Beta only) an array ofgoogle_container_cluster
pod_security_policy_configbinary_authorizations
: an array ofgoogle_container_cluster
binary_authorizationshielded_nodes
: (Beta only) an array ofgoogle_container_cluster
shielded_nodeslocations
: an array ofgoogle_container_cluster
location
This 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.