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

private clustering for container clusters #124

Merged
merged 1 commit into from
Mar 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/resources/google_container_regional_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ Properties that can be accessed from the `google_container_regional_cluster` res

* `network`: The name of the Google Compute Engine network to which the cluster is connected. If left unspecified, the default network will be used.

* `private_cluster_config`: Configuration for a private cluster.

* `enablePrivateNodes`: Whether nodes have internal IP addresses only. If enabled, all nodes are given only RFC 1918 private addresses and communicate with the master via private networking.

* `enablePrivateEndpoint`: Whether the master's internal IP address is used as the cluster endpoint.

* `masterIpv4CidrBlock`: The IP range in CIDR notation to use for the hosted master network. This range will be used for assigning internal IP addresses to the master or set of masters, as well as the ILB VIP. This range must not overlap with any other ranges in use within the cluster's network.

* `privateEndpoint`: The internal IP address of this cluster's master endpoint.

* `publicEndpoint`: The external IP address of this cluster's master endpoint.

* `cluster_ipv4_cidr`: The IP address range of the container pods in this cluster, in CIDR notation (e.g. 10.96.0.0/14). Leave blank to have one automatically chosen or specify a /14 block in 10.0.0.0/8.

* `addons_config`: Configurations for the various addons available to run in the cluster.
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 @@ -27,6 +27,7 @@ See [google_container_regional_cluster.md](google_container_regional_cluster.md)
* `logging_services`: an array of `google_container_regional_cluster` logging_service
* `monitoring_services`: an array of `google_container_regional_cluster` monitoring_service
* `networks`: an array of `google_container_regional_cluster` network
* `private_cluster_configs`: an array of `google_container_regional_cluster` private_cluster_config
* `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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 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 RegionalClusterPrivateClusterConfig
attr_reader :enable_private_nodes

attr_reader :enable_private_endpoint

attr_reader :master_ipv4_cidr_block

attr_reader :private_endpoint

attr_reader :public_endpoint

def initialize(args = nil)
return if args.nil?
@enable_private_nodes = args['enablePrivateNodes']
@enable_private_endpoint = args['enablePrivateEndpoint']
@master_ipv4_cidr_block = args['masterIpv4CidrBlock']
@private_endpoint = args['privateEndpoint']
@public_endpoint = args['publicEndpoint']
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 @@ -19,6 +19,7 @@
require 'google/container/property/regionalcluster_addons_config_http_load_balancing'
require 'google/container/property/regionalcluster_master_auth'
require 'google/container/property/regionalcluster_node_config'
require 'google/container/property/regionalcluster_private_cluster_config'

# A provider to manage Google Kubernetes Engine resources.
class RegionalCluster < GcpResourceBase
Expand All @@ -34,6 +35,7 @@ class RegionalCluster < GcpResourceBase
attr_reader :logging_service
attr_reader :monitoring_service
attr_reader :network
attr_reader :private_cluster_config
attr_reader :cluster_ipv4_cidr
attr_reader :addons_config
attr_reader :subnetwork
Expand Down Expand Up @@ -63,6 +65,7 @@ def parse
@logging_service = @fetched['loggingService']
@monitoring_service = @fetched['monitoringService']
@network = @fetched['network']
@private_cluster_config = GoogleInSpec::Container::Property::RegionalClusterPrivateClusterConfig.new(@fetched['privateClusterConfig'])
@cluster_ipv4_cidr = @fetched['clusterIpv4Cidr']
@addons_config = GoogleInSpec::Container::Property::RegionalClusterAddonsConfig.new(@fetched['addonsConfig'])
@subnetwork = @fetched['subnetwork']
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 @@ -31,6 +31,7 @@ class RegionalClusters < GcpResourceBase
filter_table_config.add(:logging_services, field: :logging_service)
filter_table_config.add(:monitoring_services, field: :monitoring_service)
filter_table_config.add(:networks, field: :network)
filter_table_config.add(:private_cluster_configs, field: :private_cluster_config)
filter_table_config.add(:cluster_ipv4_cidrs, field: :cluster_ipv4_cidr)
filter_table_config.add(:addons_configs, field: :addons_config)
filter_table_config.add(:subnetworks, field: :subnetwork)
Expand Down Expand Up @@ -91,6 +92,7 @@ def transformers
'loggingService' => ->(obj) { return :logging_service, obj['loggingService'] },
'monitoringService' => ->(obj) { return :monitoring_service, obj['monitoringService'] },
'network' => ->(obj) { return :network, obj['network'] },
'privateClusterConfig' => ->(obj) { return :private_cluster_config, GoogleInSpec::Container::Property::RegionalClusterPrivateClusterConfig.new(obj['privateClusterConfig']) },
'clusterIpv4Cidr' => ->(obj) { return :cluster_ipv4_cidr, obj['clusterIpv4Cidr'] },
'addonsConfig' => ->(obj) { return :addons_config, GoogleInSpec::Container::Property::RegionalClusterAddonsConfig.new(obj['addonsConfig']) },
'subnetwork' => ->(obj) { return :subnetwork, obj['subnetwork'] },
Expand Down