Skip to content

Commit

Permalink
adding new fields to container clusters
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
rambleraptor authored and Stuart Paterson committed Aug 23, 2019
1 parent f2233f3 commit a59937f
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/resources/google_container_regional_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,26 @@ Properties that can be accessed from the `google_container_regional_cluster` res

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

* `ip_allocation_policy`: Configuration for controlling how IPs are allocated in the cluster

* `use_ip_aliases`: Whether alias IPs will be used for pod IPs in the cluster

* `create_subnetwork`: Whether a new subnetwork will be created automatically for the cluster

* `subnetwork_name`: A custom subnetwork name to be used if createSubnetwork is true. If this field is empty, then an automatic name will be chosen for the new subnetwork.

* `cluster_secondary_range_name`: The name of the secondary range to be used for the cluster CIDR block. The secondary range will be used for pod IP addresses. This must be an existing secondary range associated with the cluster subnetwork

* `services_secondary_range_name`: The name of the secondary range to be used as for the services CIDR block. The secondary range will be used for service ClusterIPs. This must be an existing secondary range associated with the cluster subnetwork.

* `cluster_ipv4_cidr_block`: The IP address range for the cluster pod IPs. If this field is set, then cluster.cluster_ipv4_cidr must be left blank. This field is only applicable when useIpAliases is true. Set to blank to have a range chosen with the default size. Set to /netmask (e.g. /14) to have a range chosen with a specific netmask.

* `node_ipv4_cidr_block`: The IP address range of the instance IPs in this cluster. This is applicable only if createSubnetwork is true. Set to blank to have a range chosen with the default size. Set to /netmask (e.g. /14) to have a range chosen with a specific netmask.

* `services_ipv4_cidr_block`: The IP address range of the services IPs in this cluster. If blank, a range will be automatically chosen with the default size. This field is only applicable when useIpAliases is true. Set to blank to have a range chosen with the default size. Set to /netmask (e.g. /14) to have a range chosen with a specific netmask.

* `tpu_ipv4_cidr_block`: The IP address range of the Cloud TPUs in this cluster. If unspecified, a range will be automatically chosen with the default size. This field is only applicable when useIpAliases is true. If unspecified, the range will use the default size. Set to /netmask (e.g. /14) to have a range chosen with a specific netmask.

* `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 Down
1 change: 1 addition & 0 deletions docs/resources/google_container_regional_clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ See [google_container_regional_cluster.md](google_container_regional_cluster.md)
* `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
* `ip_allocation_policies`: an array of `google_container_regional_cluster` ip_allocation_policy
* `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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# 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 RegionalClusterIpAllocationPolicy
attr_reader :use_ip_aliases

attr_reader :create_subnetwork

attr_reader :subnetwork_name

attr_reader :cluster_secondary_range_name

attr_reader :services_secondary_range_name

attr_reader :cluster_ipv4_cidr_block

attr_reader :node_ipv4_cidr_block

attr_reader :services_ipv4_cidr_block

attr_reader :tpu_ipv4_cidr_block

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@use_ip_aliases = args['useIpAliases']
@create_subnetwork = args['createSubnetwork']
@subnetwork_name = args['subnetworkName']
@cluster_secondary_range_name = args['clusterSecondaryRangeName']
@services_secondary_range_name = args['servicesSecondaryRangeName']
@cluster_ipv4_cidr_block = args['clusterIpv4CidrBlock']
@node_ipv4_cidr_block = args['nodeIpv4CidrBlock']
@services_ipv4_cidr_block = args['servicesIpv4CidrBlock']
@tpu_ipv4_cidr_block = args['tpuIpv4CidrBlock']
end

def to_s
"#{@parent_identifier} RegionalClusterIpAllocationPolicy"
end
end
end
end
end
3 changes: 3 additions & 0 deletions libraries/google_container_regional_cluster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
require 'google/container/property/regionalcluster_addons_config_network_policy_config'
require 'google/container/property/regionalcluster_conditions'
require 'google/container/property/regionalcluster_default_max_pods_constraint'
require 'google/container/property/regionalcluster_ip_allocation_policy'
require 'google/container/property/regionalcluster_legacy_abac'
require 'google/container/property/regionalcluster_master_auth'
require 'google/container/property/regionalcluster_master_auth_client_certificate_config'
Expand Down Expand Up @@ -54,6 +55,7 @@ class RegionalCluster < GcpResourceBase
attr_reader :legacy_abac
attr_reader :network_policy
attr_reader :default_max_pods_constraint
attr_reader :ip_allocation_policy
attr_reader :endpoint
attr_reader :initial_cluster_version
attr_reader :current_master_version
Expand Down Expand Up @@ -96,6 +98,7 @@ def parse
@legacy_abac = GoogleInSpec::Container::Property::RegionalClusterLegacyAbac.new(@fetched['legacyAbac'], to_s)
@network_policy = GoogleInSpec::Container::Property::RegionalClusterNetworkPolicy.new(@fetched['networkPolicy'], to_s)
@default_max_pods_constraint = GoogleInSpec::Container::Property::RegionalClusterDefaultMaxPodsConstraint.new(@fetched['defaultMaxPodsConstraint'], to_s)
@ip_allocation_policy = GoogleInSpec::Container::Property::RegionalClusterIpAllocationPolicy.new(@fetched['ipAllocationPolicy'], to_s)
@endpoint = @fetched['endpoint']
@initial_cluster_version = @fetched['initialClusterVersion']
@current_master_version = @fetched['currentMasterVersion']
Expand Down
2 changes: 2 additions & 0 deletions libraries/google_container_regional_clusters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class RegionalClusters < GcpResourceBase
filter_table_config.add(:legacy_abacs, field: :legacy_abac)
filter_table_config.add(:network_policies, field: :network_policy)
filter_table_config.add(:default_max_pods_constraints, field: :default_max_pods_constraint)
filter_table_config.add(:ip_allocation_policies, field: :ip_allocation_policy)
filter_table_config.add(:endpoints, field: :endpoint)
filter_table_config.add(:initial_cluster_versions, field: :initial_cluster_version)
filter_table_config.add(:current_master_versions, field: :current_master_version)
Expand Down Expand Up @@ -113,6 +114,7 @@ def transformers
'legacyAbac' => ->(obj) { return :legacy_abac, GoogleInSpec::Container::Property::RegionalClusterLegacyAbac.new(obj['legacyAbac'], to_s) },
'networkPolicy' => ->(obj) { return :network_policy, GoogleInSpec::Container::Property::RegionalClusterNetworkPolicy.new(obj['networkPolicy'], to_s) },
'defaultMaxPodsConstraint' => ->(obj) { return :default_max_pods_constraint, GoogleInSpec::Container::Property::RegionalClusterDefaultMaxPodsConstraint.new(obj['defaultMaxPodsConstraint'], to_s) },
'ipAllocationPolicy' => ->(obj) { return :ip_allocation_policy, GoogleInSpec::Container::Property::RegionalClusterIpAllocationPolicy.new(obj['ipAllocationPolicy'], to_s) },
'endpoint' => ->(obj) { return :endpoint, obj['endpoint'] },
'initialClusterVersion' => ->(obj) { return :initial_cluster_version, obj['initialClusterVersion'] },
'currentMasterVersion' => ->(obj) { return :current_master_version, obj['currentMasterVersion'] },
Expand Down

0 comments on commit a59937f

Please sign in to comment.