Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
GKE Cluster - adding more fields
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
rambleraptor authored and Stuart Paterson committed Aug 23, 2019
1 parent 3f60c66 commit 6126097
Show file tree
Hide file tree
Showing 15 changed files with 443 additions and 1 deletion.
48 changes: 47 additions & 1 deletion docs/resources/google_container_regional_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Properties that can be accessed from the `google_container_regional_cluster` res

* `description`: An optional description of this cluster.

* `initial_node_count`: The number of nodes to create in this cluster. You must ensure that your Compute Engine resource quota is sufficient for this number of instances. You must also have available firewall and routes quota. For requests, this field should only be used in lieu of a "nodePool" object, since this configuration (along with the "nodeConfig") will be used to create a "NodePool" object with an auto-generated name. Do not use this and a nodePool at the same time.
* `initial_node_count`: The number of nodes to create in this cluster. You must ensure that your Compute Engine resource quota is sufficient for this number of instances. You must also have available firewall and routes quota. For requests, this field should only be used in lieu of a "nodePool" object, since this configuration (along with the "nodeConfig") will be used to create a "NodePool" object with an auto-generated name. Do not use this and a nodePool at the same time. This field has been deprecated. Please use nodePool.initial_node_count instead.

* `node_config`: Parameters used in creating the cluster's nodes. For requests, this field should only be used in lieu of a "nodePool" object, since this configuration (along with the "initialNodeCount") will be used to create a "NodePool" object with an auto-generated name. Do not use this and a nodePool at the same time. For responses, this field will be populated with the node configuration of the first node pool. If unspecified, the defaults are used.

Expand All @@ -50,12 +50,22 @@ Properties that can be accessed from the `google_container_regional_cluster` res

* `preemptible`: Whether the nodes are created as preemptible VM instances. See: https://cloud.google.com/compute/docs/instances/preemptible for more information about preemptible VM instances.

* `accelerators`: A list of hardware accelerators to be attached to each node. See https://cloud.google.com/compute/docs/gpus for more information about support for GPUs.

* `disk_type`: Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') If unspecified, the default disk type is 'pd-standard'

* `min_cpu_platform`: Minimum CPU platform to be used by this instance. The instance may be scheduled on the specified or newer CPU platform.

* `taints`: List of kubernetes taints to be applied to each node. For more information, including usage and the valid values, see: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/

* `master_auth`: The authentication information for accessing the master endpoint.

* `username`: The username to use for HTTP basic authentication to the master endpoint.

* `password`: The password to use for HTTP basic authentication to the master endpoint. Because the master endpoint is open to the Internet, you should create a strong password.

* `client_certificate_config`: Configuration for client certificate authentication on the cluster. For clusters before v1.12, if no configuration is specified, a client certificate is issued.

* `cluster_ca_certificate`: Base64-encoded public certificate that is the root of trust for the cluster.

* `client_certificate`: Base64-encoded public certificate used by clients to authenticate to the cluster endpoint.
Expand Down Expand Up @@ -88,8 +98,30 @@ Properties that can be accessed from the `google_container_regional_cluster` res

* `horizontal_pod_autoscaling`: Configuration for the horizontal pod autoscaling feature, which increases or decreases the number of replica pods a replication controller has based on the resource usage of the existing pods.

* `network_policy_config`: Configuration for NetworkPolicy. This only tracks whether the addon is enabled or not on the Master, it does not track whether network policy is enabled for the nodes.

* `subnetwork`: The name of the Google Compute Engine subnetwork to which the cluster is connected.

* `locations`: The list of Google Compute Engine zones in which the cluster's nodes should be located.

* `resource_labels`: The resource labels for the cluster to use to annotate any related Google Compute Engine resources.

* `label_fingerprint`: The fingerprint of the set of labels for this cluster.

* `legacy_abac`: Configuration for the legacy ABAC authorization mode.

* `enabled`: Whether the ABAC authorizer is enabled for this cluster. When enabled, identities in the system, including service accounts, nodes, and controllers, will have statically granted permissions beyond those provided by the RBAC configuration or IAM.

* `network_policy`: Configuration options for the NetworkPolicy feature.

* `provider`: The selected network policy provider.

* `enabled`: Whether network policy is enabled on the cluster.

* `default_max_pods_constraint`: The default constraint on the maximum number of pods that can be run simultaneously on a node in the node pool of this cluster. Only honored if cluster created with IP Alias support.

* `max_pods_per_node`: Constraint enforced on the max num of pods per node.

* `endpoint`: The IP address of this cluster's master endpoint. The endpoint can be accessed from the internet at https://username:password@endpoint/ See the masterAuth property of this resource for username and password information.

* `initial_cluster_version`: The software version of the master endpoint and kubelets used in the cluster when it was first created. The version can be upgraded over time.
Expand All @@ -100,6 +132,10 @@ Properties that can be accessed from the `google_container_regional_cluster` res

* `create_time`: The time the cluster was created, in RFC3339 text format.

* `status`: The current status of this cluster.

* `status_message`: Additional information about the current status of this cluster, if available.

* `node_ipv4_cidr_size`: The size of the address space on each node for hosting containers. This is provisioned from within the container_ipv4_cidr range.

* `services_ipv4_cidr`: The IP address range of the Kubernetes services in this cluster, in CIDR notation (e.g. 1.2.3.4/29). Service addresses are typically put in the last /16 from the container CIDR.
Expand All @@ -108,6 +144,16 @@ Properties that can be accessed from the `google_container_regional_cluster` res

* `expire_time`: The time the cluster will be automatically deleted in RFC3339 text format.

* `enable_tpu`: Enable the ability to use Cloud TPUs in this cluster.

* `tpu_ipv4_cidr_block`: The IP address range of the Cloud TPUs in this cluster, in CIDR notation

* `conditions`: Which conditions caused the current cluster state.

* `code`: Machine-friendly representation of the condition

* `message`: Human-friendly representation of the condition

* `location`: The location where the cluster is deployed


Expand Down
11 changes: 11 additions & 0 deletions docs/resources/google_container_regional_clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,26 @@ See [google_container_regional_cluster.md](google_container_regional_cluster.md)
* `cluster_ipv4_cidrs`: an array of `google_container_regional_cluster` cluster_ipv4_cidr
* `addons_configs`: an array of `google_container_regional_cluster` addons_config
* `subnetworks`: an array of `google_container_regional_cluster` subnetwork
* `locations`: an array of `google_container_regional_cluster` locations
* `resource_labels`: an array of `google_container_regional_cluster` resource_labels
* `label_fingerprints`: an array of `google_container_regional_cluster` label_fingerprint
* `legacy_abacs`: an array of `google_container_regional_cluster` legacy_abac
* `network_policies`: an array of `google_container_regional_cluster` network_policy
* `default_max_pods_constraints`: an array of `google_container_regional_cluster` default_max_pods_constraint
* `endpoints`: an array of `google_container_regional_cluster` endpoint
* `initial_cluster_versions`: an array of `google_container_regional_cluster` initial_cluster_version
* `current_master_versions`: an array of `google_container_regional_cluster` current_master_version
* `current_node_versions`: an array of `google_container_regional_cluster` current_node_version
* `create_times`: an array of `google_container_regional_cluster` create_time
* `statuses`: an array of `google_container_regional_cluster` status
* `status_messages`: an array of `google_container_regional_cluster` status_message
* `node_ipv4_cidr_sizes`: an array of `google_container_regional_cluster` node_ipv4_cidr_size
* `services_ipv4_cidrs`: an array of `google_container_regional_cluster` services_ipv4_cidr
* `current_node_counts`: an array of `google_container_regional_cluster` current_node_count
* `expire_times`: an array of `google_container_regional_cluster` expire_time
* `enable_tpus`: an array of `google_container_regional_cluster` enable_tpu
* `tpu_ipv4_cidr_blocks`: an array of `google_container_regional_cluster` tpu_ipv4_cidr_block
* `conditions`: an array of `google_container_regional_cluster` conditions
* `locations`: an array of `google_container_regional_cluster` location

## Filter Criteria
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# ----------------------------------------------------------------------------
require 'google/container/property/regionalcluster_addons_config_horizontal_pod_autoscaling'
require 'google/container/property/regionalcluster_addons_config_http_load_balancing'
require 'google/container/property/regionalcluster_addons_config_network_policy_config'
module GoogleInSpec
module Container
module Property
Expand All @@ -23,11 +24,14 @@ class RegionalClusterAddonsConfig

attr_reader :horizontal_pod_autoscaling

attr_reader :network_policy_config

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@http_load_balancing = GoogleInSpec::Container::Property::RegionalClusterAddonsConfigHttpLoadBalancing.new(args['httpLoadBalancing'], to_s)
@horizontal_pod_autoscaling = GoogleInSpec::Container::Property::RegionalClusterAddonsConfigHorizontalPodAutoscaling.new(args['horizontalPodAutoscaling'], to_s)
@network_policy_config = GoogleInSpec::Container::Property::RegionalClusterAddonsConfigNetworkPolicyConfig.new(args['networkPolicyConfig'], to_s)
end

def to_s
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module Container
module Property
class RegionalClusterAddonsConfigNetworkPolicyConfig
attr_reader :disabled

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@disabled = args['disabled']
end

def to_s
"#{@parent_identifier} RegionalClusterAddonsConfigNetworkPolicyConfig"
end
end
end
end
end
45 changes: 45 additions & 0 deletions libraries/google/container/property/regionalcluster_conditions.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module Container
module Property
class RegionalClusterConditions
attr_reader :code

attr_reader :message

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@code = args['code']
@message = args['message']
end

def to_s
"#{@parent_identifier} RegionalClusterConditions"
end
end

class RegionalClusterConditionsArray
def self.parse(value, parent_identifier)
return if value.nil?
return RegionalClusterConditions.new(value, parent_identifier) unless value.is_a?(::Array)
value.map { |v| RegionalClusterConditions.new(v, parent_identifier) }
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module Container
module Property
class RegionalClusterDefaultMaxPodsConstraint
attr_reader :max_pods_per_node

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@max_pods_per_node = args['maxPodsPerNode']
end

def to_s
"#{@parent_identifier} RegionalClusterDefaultMaxPodsConstraint"
end
end
end
end
end
34 changes: 34 additions & 0 deletions libraries/google/container/property/regionalcluster_legacy_abac.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module Container
module Property
class RegionalClusterLegacyAbac
attr_reader :enabled

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@enabled = args['enabled']
end

def to_s
"#{@parent_identifier} RegionalClusterLegacyAbac"
end
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
require 'google/container/property/regionalcluster_master_auth_client_certificate_config'
module GoogleInSpec
module Container
module Property
Expand All @@ -21,6 +22,8 @@ class RegionalClusterMasterAuth

attr_reader :password

attr_reader :client_certificate_config

attr_reader :cluster_ca_certificate

attr_reader :client_certificate
Expand All @@ -32,6 +35,7 @@ def initialize(args = nil, parent_identifier = nil)
@parent_identifier = parent_identifier
@username = args['username']
@password = args['password']
@client_certificate_config = GoogleInSpec::Container::Property::RegionalClusterMasterAuthClientCertificateConfig.new(args['clientCertificateConfig'], to_s)
@cluster_ca_certificate = args['clusterCaCertificate']
@client_certificate = args['clientCertificate']
@client_key = args['clientKey']
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module Container
module Property
class RegionalClusterMasterAuthClientCertificateConfig
attr_reader :issue_client_certificate

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@issue_client_certificate = args['issueClientCertificate']
end

def to_s
"#{@parent_identifier} RegionalClusterMasterAuthClientCertificateConfig"
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module Container
module Property
class RegionalClusterNetworkPolicy
attr_reader :provider

attr_reader :enabled

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@provider = args['provider']
@enabled = args['enabled']
end

def to_s
"#{@parent_identifier} RegionalClusterNetworkPolicy"
end
end
end
end
end
Loading

0 comments on commit 6126097

Please sign in to comment.