-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Refactor private networking -> topology - Define new topology models (no changes yet) - Docs - Create cluster --topology and -t - New functions for topology templating
- Loading branch information
Showing
12 changed files
with
529 additions
and
80 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Network Topologies in Kops | ||
|
||
Kops supports a number of pre defined network topologies. They are separated into commonly used scenarios, or topologies. | ||
|
||
Each of the supported topologies are listed below, with an example on how to deploy them. | ||
|
||
## AWS | ||
|
||
Kops supports the following topologies on AWS | ||
|
||
| Topology | Value | Description | | ||
| ----------------- |----------- | ----------------------------------------------------------------------------------------------------------- | | ||
| Public Cluster | public | All masters/nodes will be launched in a **public subnet** in the VPC | | ||
| Private Cluster | private | All masters/nodes will be launched in a **private subnet** in the VPC | | ||
| Hybrid (1) | hybrid1 | All masters will be launched into a **private subnet**, All nodes will be launched into a **public subnet** | | ||
|
||
|
||
#### Defining a topology on create | ||
|
||
To specify a topology use the `--topology` or `-t` flag as in : | ||
|
||
``` | ||
kops create cluster ... --topology public|private|hybrid1 | ||
``` | ||
|
||
|
||
#### Defining a topology in the cluster configuration | ||
|
||
The topology definition in the kops configuration is as follows | ||
|
||
``` | ||
topology: | ||
type: public|private|hybrid1 | ||
``` | ||
|
||
Where kops will default to a public topology | ||
|
||
``` | ||
topology: | ||
type: public | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
Copyright 2016 The Kubernetes Authors. | ||
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. | ||
*/ | ||
|
||
package kops | ||
|
||
const ( | ||
TopologyPublic = "public" | ||
TopologyPrivate = "private" | ||
TopologyHybrid1 = "hybrid1" | ||
) | ||
|
||
type TopologySpec struct { | ||
Type string `json:"type,omitempty"` | ||
} |
This file was deleted.
Oops, something went wrong.
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,53 @@ | ||
{{ if IsTopologyHybrid1 }} | ||
vpc/{{ ClusterName }}: | ||
id: {{ .NetworkID }} | ||
shared: {{ SharedVPC }} | ||
cidr: {{ .NetworkCIDR }} | ||
enableDnsSupport: true | ||
enableDnsHostnames: true | ||
|
||
|
||
{{ if not SharedVPC }} | ||
# TODO: would be good to create these as shared, to verify them | ||
dhcpOptions/{{ ClusterName }}: | ||
domainNameServers: AmazonProvidedDNS | ||
{{ if eq Region "us-east-1" }} | ||
domainName: ec2.internal | ||
{{ else }} | ||
domainName: {{ Region }}.compute.internal | ||
{{ end }} | ||
|
||
vpcDHDCPOptionsAssociation/{{ ClusterName }}: | ||
vpc: vpc/{{ ClusterName }} | ||
dhcpOptions: dhcpOptions/{{ ClusterName }} | ||
{{ end }} | ||
|
||
internetGateway/{{ ClusterName }}: | ||
shared: {{ SharedVPC }} | ||
vpc: vpc/{{ ClusterName }} | ||
|
||
routeTable/{{ ClusterName }}: | ||
vpc: vpc/{{ ClusterName }} | ||
|
||
route/0.0.0.0/0: | ||
routeTable: routeTable/{{ ClusterName }} | ||
cidr: 0.0.0.0/0 | ||
internetGateway: internetGateway/{{ ClusterName }} | ||
vpc: vpc/{{ ClusterName }} | ||
|
||
{{ range $zone := .Zones }} | ||
|
||
subnet/{{ $zone.Name }}.{{ ClusterName }}: | ||
vpc: vpc/{{ ClusterName }} | ||
availabilityZone: {{ $zone.Name }} | ||
cidr: {{ $zone.CIDR }} | ||
id: {{ $zone.ProviderID }} | ||
shared: {{ SharedZone $zone }} | ||
|
||
{{ if not (SharedZone $zone) }} | ||
routeTableAssociation/{{ $zone.Name }}.{{ ClusterName }}: | ||
routeTable: routeTable/{{ ClusterName }} | ||
subnet: subnet/{{ $zone.Name }}.{{ ClusterName }} | ||
{{ end}} | ||
{{ end }} | ||
{{ end }} |
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,53 @@ | ||
{{ if IsTopologyPrivate }} | ||
vpc/{{ ClusterName }}: | ||
id: {{ .NetworkID }} | ||
shared: {{ SharedVPC }} | ||
cidr: {{ .NetworkCIDR }} | ||
enableDnsSupport: true | ||
enableDnsHostnames: true | ||
|
||
|
||
{{ if not SharedVPC }} | ||
# TODO: would be good to create these as shared, to verify them | ||
dhcpOptions/{{ ClusterName }}: | ||
domainNameServers: AmazonProvidedDNS | ||
{{ if eq Region "us-east-1" }} | ||
domainName: ec2.internal | ||
{{ else }} | ||
domainName: {{ Region }}.compute.internal | ||
{{ end }} | ||
|
||
vpcDHDCPOptionsAssociation/{{ ClusterName }}: | ||
vpc: vpc/{{ ClusterName }} | ||
dhcpOptions: dhcpOptions/{{ ClusterName }} | ||
{{ end }} | ||
|
||
internetGateway/{{ ClusterName }}: | ||
shared: {{ SharedVPC }} | ||
vpc: vpc/{{ ClusterName }} | ||
|
||
routeTable/{{ ClusterName }}: | ||
vpc: vpc/{{ ClusterName }} | ||
|
||
route/0.0.0.0/0: | ||
routeTable: routeTable/{{ ClusterName }} | ||
cidr: 0.0.0.0/0 | ||
internetGateway: internetGateway/{{ ClusterName }} | ||
vpc: vpc/{{ ClusterName }} | ||
|
||
{{ range $zone := .Zones }} | ||
|
||
subnet/{{ $zone.Name }}.{{ ClusterName }}: | ||
vpc: vpc/{{ ClusterName }} | ||
availabilityZone: {{ $zone.Name }} | ||
cidr: {{ $zone.CIDR }} | ||
id: {{ $zone.ProviderID }} | ||
shared: {{ SharedZone $zone }} | ||
|
||
{{ if not (SharedZone $zone) }} | ||
routeTableAssociation/{{ $zone.Name }}.{{ ClusterName }}: | ||
routeTable: routeTable/{{ ClusterName }} | ||
subnet: subnet/{{ $zone.Name }}.{{ ClusterName }} | ||
{{ end}} | ||
{{ end }} | ||
{{ end }} |
Oops, something went wrong.