-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #207 from marko7460/upstream_nameservers
Add support for upstreamNameservers
- Loading branch information
Showing
50 changed files
with
1,290 additions
and
11 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
*/ | ||
|
||
provider "google-beta" { | ||
version = "~> 2.2" | ||
version = "~> 2.9.0" | ||
region = "${var.region}" | ||
} | ||
|
||
|
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,50 @@ | ||
# Stub Domains and Upstream Nameservers Cluster | ||
|
||
This example illustrates how to create a cluster that adds custom stub domains and custom upstream nameservers to kube-dns. | ||
|
||
It will: | ||
- Create a cluster | ||
- Remove the default kube-dns configmap | ||
- Add a new kube-dns configmap with custom stub domains and upstream nameservers | ||
|
||
[^]: (autogen_docs_start) | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|:----:|:-----:|:-----:| | ||
| cluster\_name\_suffix | A suffix to append to the default cluster name | string | `""` | no | | ||
| compute\_engine\_service\_account | Service account to associate to the nodes in the cluster | string | n/a | yes | | ||
| ip\_range\_pods | The secondary ip range to use for pods | string | n/a | yes | | ||
| ip\_range\_services | The secondary ip range to use for pods | string | n/a | yes | | ||
| network | The VPC network to host the cluster in | string | n/a | yes | | ||
| project\_id | The project ID to host the cluster in | string | n/a | yes | | ||
| region | The region to host the cluster in | string | n/a | yes | | ||
| subnetwork | The subnetwork to host the cluster in | string | n/a | yes | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| ca\_certificate | | | ||
| client\_token | | | ||
| cluster\_name | Cluster name | | ||
| ip\_range\_pods | The secondary IP range used for pods | | ||
| ip\_range\_services | The secondary IP range used for services | | ||
| kubernetes\_endpoint | | | ||
| location | | | ||
| master\_kubernetes\_version | The master Kubernetes version | | ||
| network | | | ||
| project\_id | | | ||
| region | | | ||
| service\_account | The service account to default running nodes as if not overridden in `node_pools`. | | ||
| subnetwork | | | ||
| zones | List of zones in which the cluster resides | | ||
|
||
[^]: (autogen_docs_end) | ||
|
||
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 |
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,60 @@ | ||
/** | ||
* 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. | ||
*/ | ||
|
||
locals { | ||
cluster_type = "domains-nameservers" | ||
} | ||
|
||
provider "google" { | ||
version = "~> 2.9.0" | ||
region = "${var.region}" | ||
} | ||
|
||
provider "google-beta" { | ||
version = "~> 2.9.0" | ||
region = "${var.region}" | ||
} | ||
|
||
module "gke" { | ||
source = "../../" | ||
project_id = "${var.project_id}" | ||
name = "${local.cluster_type}-cluster${var.cluster_name_suffix}" | ||
region = "${var.region}" | ||
network = "${var.network}" | ||
subnetwork = "${var.subnetwork}" | ||
ip_range_pods = "${var.ip_range_pods}" | ||
ip_range_services = "${var.ip_range_services}" | ||
network_policy = true | ||
service_account = "${var.compute_engine_service_account}" | ||
|
||
configure_ip_masq = true | ||
|
||
stub_domains { | ||
"example.com" = [ | ||
"10.254.154.11", | ||
"10.254.154.12", | ||
] | ||
|
||
"example.net" = [ | ||
"10.254.154.11", | ||
"10.254.154.12", | ||
] | ||
} | ||
|
||
upstream_nameservers = ["8.8.8.8", "8.8.4.4"] | ||
} | ||
|
||
data "google_client_config" "default" {} |
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,34 @@ | ||
/** | ||
* 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. | ||
*/ | ||
|
||
output "kubernetes_endpoint" { | ||
sensitive = true | ||
value = "${module.gke.endpoint}" | ||
} | ||
|
||
output "client_token" { | ||
sensitive = true | ||
value = "${base64encode(data.google_client_config.default.access_token)}" | ||
} | ||
|
||
output "ca_certificate" { | ||
value = "${module.gke.ca_certificate}" | ||
} | ||
|
||
output "service_account" { | ||
description = "The service account to default running nodes as if not overridden in `node_pools`." | ||
value = "${module.gke.service_account}" | ||
} |
Oops, something went wrong.