-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into add_var_to_pass_ssh-key_in_acm
- Loading branch information
Showing
80 changed files
with
2,012 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
examples/regional_private_node_pool_oauth_scopes/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Regional Private Cluster with node pool and oauth scopes | ||
|
||
This example illustrates how to create a private cluster with node pool specifications, oauth scopes along with required network and subnet creation. | ||
|
||
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|:----:|:-----:|:-----:| | ||
| project\_id | The project ID to host the cluster in | string | n/a | yes | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| ca\_certificate | Cluster ca certificate (base64 encoded) | | ||
| cluster\_name | Cluster name | | ||
| endpoint | Cluster endpoint | | ||
| horizontal\_pod\_autoscaling\_enabled | Whether horizontal pod autoscaling enabled | | ||
| http\_load\_balancing\_enabled | Whether http load balancing enabled | | ||
| location | Cluster location (region if regional cluster, zone if zonal cluster) | | ||
| logging\_service | Logging service used | | ||
| master\_authorized\_networks\_config | Networks from which access to master is permitted | | ||
| master\_version | Current master kubernetes version | | ||
| min\_master\_version | Minimum master kubernetes version | | ||
| monitoring\_service | Monitoring service used | | ||
| network\_module | network module output | | ||
| network\_policy\_enabled | Whether network policy enabled | | ||
| node\_pools\_names | List of node pools names | | ||
| node\_pools\_versions | List of node pools versions | | ||
| region | Cluster region | | ||
| service\_account | The service account to default running nodes as if not overridden in `node_pools`. | | ||
| subnets\_ips | The IP and cidrs of the subnets being created | | ||
| subnets\_secondary\_ranges | The secondary ranges associated with these subnets | | ||
| type | Cluster type (regional / zonal) | | ||
| zones | List of zones in which the cluster resides | | ||
|
||
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
|
||
To provision this example, run the following from within this directory: | ||
- `terraform init` to get the plugins | ||
- `terraform plan` to see the infrastructure plan | ||
- `terraform apply` to apply the infrastructure build | ||
- `terraform destroy` to destroy the built infrastructure |
104 changes: 104 additions & 0 deletions
104
examples/regional_private_node_pool_oauth_scopes/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
/** | ||
* Copyright 2018 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
module "gke" { | ||
source = "../../modules/private-cluster" | ||
project_id = var.project_id | ||
name = "random-test-cluster" | ||
region = "us-west1" | ||
regional = true | ||
network = module.gke-network.network_name | ||
subnetwork = module.gke-network.subnets_names[0] | ||
ip_range_pods = module.gke-network.subnets_secondary_ranges[0].*.range_name[0] | ||
ip_range_services = module.gke-network.subnets_secondary_ranges[0].*.range_name[1] | ||
enable_private_endpoint = true | ||
enable_private_nodes = true | ||
master_ipv4_cidr_block = "172.16.0.16/28" | ||
network_policy = true | ||
horizontal_pod_autoscaling = true | ||
service_account = "create" | ||
remove_default_node_pool = true | ||
disable_legacy_metadata_endpoints = true | ||
|
||
master_authorized_networks_config = [ | ||
{ | ||
cidr_blocks = [ | ||
{ | ||
cidr_block = module.gke-network.subnets_ips[0] | ||
display_name = "VPC" | ||
}, | ||
] | ||
}, | ||
] | ||
|
||
node_pools = [ | ||
{ | ||
name = "my-node-pool" | ||
machine_type = "n1-standard-1" | ||
min_count = 1 | ||
max_count = 1 | ||
disk_size_gb = 100 | ||
disk_type = "pd-ssd" | ||
image_type = "COS" | ||
auto_repair = true | ||
auto_upgrade = false | ||
preemptible = false | ||
initial_node_count = 1 | ||
}, | ||
] | ||
|
||
node_pools_oauth_scopes = { | ||
all = [ | ||
"https://www.googleapis.com/auth/trace.append", | ||
"https://www.googleapis.com/auth/service.management.readonly", | ||
"https://www.googleapis.com/auth/monitoring", | ||
"https://www.googleapis.com/auth/devstorage.read_only", | ||
"https://www.googleapis.com/auth/servicecontrol", | ||
] | ||
|
||
my-node-pool = [ | ||
"https://www.googleapis.com/auth/trace.append", | ||
"https://www.googleapis.com/auth/service.management.readonly", | ||
"https://www.googleapis.com/auth/monitoring", | ||
"https://www.googleapis.com/auth/devstorage.read_only", | ||
"https://www.googleapis.com/auth/servicecontrol", | ||
] | ||
} | ||
|
||
node_pools_labels = { | ||
|
||
all = { | ||
|
||
} | ||
my-node-pool = { | ||
|
||
} | ||
} | ||
|
||
node_pools_metadata = { | ||
all = {} | ||
|
||
my-node-pool = {} | ||
|
||
} | ||
|
||
node_pools_tags = { | ||
all = [] | ||
|
||
my-node-pool = [] | ||
|
||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
examples/regional_private_node_pool_oauth_scopes/network.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* Copyright 2018 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
module "gke-network" { | ||
source = "terraform-google-modules/network/google" | ||
version = "~> 1.5" | ||
project_id = var.project_id | ||
network_name = "random-gke-network" | ||
|
||
subnets = [ | ||
{ | ||
subnet_name = "random-gke-subnet" | ||
subnet_ip = "10.0.0.0/24" | ||
subnet_region = "us-west1" | ||
}, | ||
] | ||
|
||
secondary_ranges = { | ||
"random-gke-subnet" = [ | ||
{ | ||
range_name = "random-ip-range-pods" | ||
ip_cidr_range = "10.1.0.0/16" | ||
}, | ||
{ | ||
range_name = "random-ip-range-services" | ||
ip_cidr_range = "10.2.0.0/20" | ||
}, | ||
] } | ||
} |
Oops, something went wrong.