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

Commit

Permalink
Add new fields to container cluster api.yaml
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
slevenick authored and modular-magician committed Aug 28, 2019
1 parent f40d22c commit 19dc528
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/resources/google_container_regional_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ 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.

* `kubernetes_dashboard`: Configuration for the Kubernetes Dashboard. This addon is deprecated, and will be disabled in 1.15. It is recommended to use the Cloud Console to manage and monitor your Kubernetes clusters, workloads and applications.

* `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.
Expand Down Expand Up @@ -174,6 +176,12 @@ Properties that can be accessed from the `google_container_regional_cluster` res

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

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

* `enabled`: Whether or not master authorized networks is enabled.

* `cidr_blocks`: Define up to 50 external networks that could access Kubernetes master through HTTPS.

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


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 @@ -52,6 +52,7 @@ See [google_container_regional_cluster.md](google_container_regional_cluster.md)
* `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
* `master_authorized_networks_configs`: an array of `google_container_regional_cluster` master_authorized_networks_config
* `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_kubernetes_dashboard'
require 'google/container/property/regionalcluster_addons_config_network_policy_config'
module GoogleInSpec
module Container
Expand All @@ -24,13 +25,16 @@ class RegionalClusterAddonsConfig

attr_reader :horizontal_pod_autoscaling

attr_reader :kubernetes_dashboard

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)
@kubernetes_dashboard = GoogleInSpec::Container::Property::RegionalClusterAddonsConfigKubernetesDashboard.new(args['kubernetesDashboard'], to_s)
@network_policy_config = GoogleInSpec::Container::Property::RegionalClusterAddonsConfigNetworkPolicyConfig.new(args['networkPolicyConfig'], to_s)
end

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 RegionalClusterAddonsConfigKubernetesDashboard
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} RegionalClusterAddonsConfigKubernetesDashboard"
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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.
#
# ----------------------------------------------------------------------------
require 'google/container/property/regionalcluster_master_authorized_networks_config_cidr_blocks'
module GoogleInSpec
module Container
module Property
class RegionalClusterMasterAuthorizedNetworksConfig
attr_reader :enabled

attr_reader :cidr_blocks

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@enabled = args['enabled']
@cidr_blocks = GoogleInSpec::Container::Property::RegionalClusterMasterAuthorizedNetworksConfigCidrBlocksArray.parse(args['cidrBlocks'], to_s)
end

def to_s
"#{@parent_identifier} RegionalClusterMasterAuthorizedNetworksConfig"
end
end
end
end
end
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 RegionalClusterMasterAuthorizedNetworksConfigCidrBlocks
attr_reader :display_name

attr_reader :cidr_block

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@display_name = args['displayName']
@cidr_block = args['cidrBlock']
end

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

class RegionalClusterMasterAuthorizedNetworksConfigCidrBlocksArray
def self.parse(value, parent_identifier)
return if value.nil?
return RegionalClusterMasterAuthorizedNetworksConfigCidrBlocks.new(value, parent_identifier) unless value.is_a?(::Array)
value.map { |v| RegionalClusterMasterAuthorizedNetworksConfigCidrBlocks.new(v, parent_identifier) }
end
end
end
end
end
5 changes: 5 additions & 0 deletions libraries/google_container_regional_cluster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@
require 'google/container/property/regionalcluster_addons_config'
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_kubernetes_dashboard'
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'
require 'google/container/property/regionalcluster_master_authorized_networks_config'
require 'google/container/property/regionalcluster_master_authorized_networks_config_cidr_blocks'
require 'google/container/property/regionalcluster_network_policy'
require 'google/container/property/regionalcluster_node_config'
require 'google/container/property/regionalcluster_node_config_accelerators'
Expand Down Expand Up @@ -70,6 +73,7 @@ class RegionalCluster < GcpResourceBase
attr_reader :enable_tpu
attr_reader :tpu_ipv4_cidr_block
attr_reader :conditions
attr_reader :master_authorized_networks_config
attr_reader :location

def initialize(params)
Expand Down Expand Up @@ -113,6 +117,7 @@ def parse
@enable_tpu = @fetched['enableTpu']
@tpu_ipv4_cidr_block = @fetched['tpuIpv4CidrBlock']
@conditions = GoogleInSpec::Container::Property::RegionalClusterConditionsArray.parse(@fetched['conditions'], to_s)
@master_authorized_networks_config = GoogleInSpec::Container::Property::RegionalClusterMasterAuthorizedNetworksConfig.new(@fetched['masterAuthorizedNetworksConfig'], to_s)
@location = @fetched['location']
end

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 @@ -56,6 +56,7 @@ class RegionalClusters < GcpResourceBase
filter_table_config.add(:enable_tpus, field: :enable_tpu)
filter_table_config.add(:tpu_ipv4_cidr_blocks, field: :tpu_ipv4_cidr_block)
filter_table_config.add(:conditions, field: :conditions)
filter_table_config.add(:master_authorized_networks_configs, field: :master_authorized_networks_config)
filter_table_config.add(:locations, field: :location)

filter_table_config.connect(self, :table)
Expand Down Expand Up @@ -129,6 +130,7 @@ def transformers
'enableTpu' => ->(obj) { return :enable_tpu, obj['enableTpu'] },
'tpuIpv4CidrBlock' => ->(obj) { return :tpu_ipv4_cidr_block, obj['tpuIpv4CidrBlock'] },
'conditions' => ->(obj) { return :conditions, GoogleInSpec::Container::Property::RegionalClusterConditionsArray.parse(obj['conditions'], to_s) },
'masterAuthorizedNetworksConfig' => ->(obj) { return :master_authorized_networks_config, GoogleInSpec::Container::Property::RegionalClusterMasterAuthorizedNetworksConfig.new(obj['masterAuthorizedNetworksConfig'], to_s) },
'location' => ->(obj) { return :location, obj['location'] },
}
end
Expand Down

0 comments on commit 19dc528

Please sign in to comment.