Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New IPv6 clusters now default to private topology #14531

Merged
merged 2 commits into from
Nov 19, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/kops/create_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ func NewCmdCreateCluster(f *util.Factory, out io.Writer) *cobra.Command {
cmd.RegisterFlagCompletionFunc("channel", completeChannel)

// Network topology
cmd.Flags().StringVarP(&options.Topology, "topology", "t", options.Topology, "Network topology for the cluster: public or private")
cmd.Flags().StringVarP(&options.Topology, "topology", "t", options.Topology, "Network topology for the cluster: 'public' or 'private'. Defaults to 'public' for IPv4 clusters and 'private' for IPv6 clusters.")
cmd.RegisterFlagCompletionFunc("topology", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return []string{api.TopologyPublic, api.TopologyPrivate}, cobra.ShellCompDirectiveNoFileComp
})
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/kops_create_cluster.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions docs/releases/1.26-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ This is a document to gather the release notes prior to the release.

* As of Kubernetes version 1.26 and with IRSA enabled, control plane nodes will now run with a max hop limit of 1 for the metadata service. This will prevent Pods without host networking from accessing the instance metadata service.

* New IPv6 clusters now default to using private topology.

# Breaking changes

## Other breaking changes
Expand Down
25 changes: 18 additions & 7 deletions tests/integration/create_cluster/ipv6/expected-v1alpha2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ metadata:
name: ipv6.example.com
spec:
api:
dns: {}
loadBalancer:
class: Network
type: Public
authorization:
rbac: {}
channel: stable
Expand Down Expand Up @@ -45,16 +47,25 @@ spec:
- 0.0.0.0/0
- ::/0
subnets:
- cidr: 172.20.32.0/19
ipv6CIDR: /64#0
- ipv6CIDR: /64#0
name: us-test-1a
type: Public
type: Private
zone: us-test-1a
- cidr: 172.20.32.0/19
ipv6CIDR: /64#1
name: dualstack-us-test-1a
type: DualStack
zone: us-test-1a
- cidr: 172.20.0.0/22
ipv6CIDR: /64#2
name: utility-us-test-1a
type: Utility
zone: us-test-1a
topology:
dns:
type: Public
masters: public
nodes: public
masters: private
nodes: private

---

Expand All @@ -75,7 +86,7 @@ spec:
minSize: 1
role: Master
subnets:
- us-test-1a
- dualstack-us-test-1a

---

Expand Down
13 changes: 10 additions & 3 deletions upup/pkg/fi/cloudup/new_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ type NewClusterOptions struct {

// Networking is the networking provider/node to use.
Networking string
// Topology is the network topology to use. Defaults to "public".
// Topology is the network topology to use. Defaults to "public" for IPv4 clusters and "private" for IPv6 clusters.
Topology string
// DNSType is the DNS type to use; "public" or "private". Defaults to "public".
DNSType string
Expand Down Expand Up @@ -166,7 +166,6 @@ func (o *NewClusterOptions) InitDefaults() {
o.Authorization = AuthorizationFlagRBAC
o.AdminAccess = []string{"0.0.0.0/0", "::/0"}
o.Networking = "cilium"
o.Topology = api.TopologyPublic
o.InstanceManager = "cloudgroups"
}

Expand Down Expand Up @@ -1124,8 +1123,16 @@ func setupNetworking(opt *NewClusterOptions, cluster *api.Cluster) error {
func setupTopology(opt *NewClusterOptions, cluster *api.Cluster, allZones sets.String) ([]*api.InstanceGroup, error) {
var bastions []*api.InstanceGroup

if opt.Topology == "" {
if opt.IPv6 {
opt.Topology = kopsapi.TopologyPrivate
} else {
opt.Topology = kopsapi.TopologyPublic
}
}

switch opt.Topology {
case api.TopologyPublic, "":
case api.TopologyPublic:
cluster.Spec.Topology = &api.TopologySpec{
ControlPlane: api.TopologyPublic,
Nodes: api.TopologyPublic,
Expand Down