Spec-Zone.ru › Chef 17

Ресурс google_container_clusters

[править на GitHub]

Синтаксис

Для проверки ресурса кластера Google используется google_container_clusters.

Ресурс Beta

В этом ресурсе доступны поля beta. Для получения этих полей включите beta: true в конструктор ресурса.

Примеры

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

Проверка, есть ли кластеры в статусе «STOPPING»

describe google_container_clusters(project: 'chef-inspec-gcp', location: 'europe-west2-a') do
  its('cluster_statuses') { should_not include "STOPPING" }
end

Проверка, что подмножество всех кластеров, соответствующих «kube*», находятся в состоянии «RUNNING»

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

Свойства

Свойства, к которым можно получить доступ из ресурса google_container_clusters:

Для получения дополнительной информации см. ресурс google_container_cluster.

cluster_names
массив google_container_cluster имён
descriptions
массив google_container_cluster описаний
initial_node_counts
массив google_container_cluster initial_node_count
node_configs
массив google_container_cluster node_config
master_auths
массив google_container_cluster master_auth
logging_services
массив google_container_cluster logging_service
monitoring_services
массив google_container_cluster monitoring_service
cluster_networks
массив google_container_cluster network
private_cluster_configs
массив google_container_cluster private_cluster_config
cluster_ipv4_cidrs
массив google_container_cluster cluster_ipv4_cidr
enable_tpus
массив google_container_cluster enable_tpu
tpu_ipv4_cidr_blocks
массив google_container_cluster tpu_ipv4_cidr_block
addons_configs
массив google_container_cluster addons_config
subnetworks
массив google_container_cluster subnetwork
locations
массив google_container_cluster locations
resource_labels
массив google_container_cluster resource_labels
label_fingerprints
массив google_container_cluster label_fingerprint
legacy_abacs
массив google_container_cluster legacy_abac
network_policies
массив google_container_cluster network_policy
default_max_pods_constraints
массив google_container_cluster default_max_pods_constraint
ip_allocation_policies
массив google_container_cluster ip_allocation_policy
endpoints
массив google_container_cluster endpoint
initial_cluster_versions
массив google_container_cluster initial_cluster_version
current_master_versions
массив google_container_cluster current_master_version
current_node_versions
массив google_container_cluster current_node_version
create_times
массив google_container_cluster create_time
cluster_statuses
массив google_container_cluster status
status_messages
массив google_container_cluster status_message
node_ipv4_cidr_sizes
массив google_container_cluster node_ipv4_cidr_size
services_ipv4_cidrs
массив google_container_cluster services_ipv4_cidr
current_node_counts
массив google_container_cluster current_node_count
expire_times
массив google_container_cluster expire_time
conditions
массив google_container_cluster conditions
master_authorized_networks_configs
массив google_container_cluster master_authorized_networks_config
node_pools
массив google_container_cluster node_pools
pod_security_policy_configs
(Только beta) массив google_container_cluster pod_security_policy_config
binary_authorizations
массив google_container_cluster binary_authorization
locations
массив google_container_cluster location

Критерии фильтрации

Этот ресурс поддерживает все вышеперечисленные свойства в качестве критериев фильтрации, которые могут быть использованы с where как блоком, так и методом.

Разрешения GCP

Убедитесь, что для текущего проекта включен API Kubernetes Engine по адресу Kubernetes Engine API.

© 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/

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API