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

Remove romana support #9255

Merged
merged 5 commits into from
Jun 3, 2020
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 0 additions & 2 deletions cmd/kops/create_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1008,8 +1008,6 @@ func RunCreateCluster(ctx context.Context, f *util.Factory, out io.Writer, c *Cr
cluster.Spec.Networking.Canal = &api.CanalNetworkingSpec{}
case "kube-router":
cluster.Spec.Networking.Kuberouter = &api.KuberouterNetworkingSpec{}
case "romana":
cluster.Spec.Networking.Romana = &api.RomanaNetworkingSpec{}
case "amazonvpc", "amazon-vpc-routed-eni":
cluster.Spec.Networking.AmazonVPC = &api.AmazonVPCNetworkingSpec{}
case "cilium":
Expand Down
2 changes: 2 additions & 0 deletions docs/releases/1.19-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

# Breaking changes

* Removed support for Romana networking provider.
olemarkus marked this conversation as resolved.
Show resolved Hide resolved

# Required Actions

# Deprecations
Expand Down
3 changes: 2 additions & 1 deletion k8s/crds/kops.k8s.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3202,7 +3202,8 @@ spec:
type: object
romana:
description: RomanaNetworkingSpec declares that we want Romana
networking
networking Romana is deprecated as of kops 1.18 and removed
as of kops 1.19
properties:
daemonServiceIP:
description: DaemonServiceIP is the Kubernetes Service IP
Expand Down
2 changes: 1 addition & 1 deletion nodeup/pkg/model/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (b *NetworkBuilder) Build(c *fi.ModelBuilderContext) error {
// external is based on kubenet
assetNames = append(assetNames, "bridge", "host-local", "loopback")

} else if networking.CNI != nil || networking.Weave != nil || networking.Flannel != nil || networking.Calico != nil || networking.Canal != nil || networking.Kuberouter != nil || networking.Romana != nil || networking.AmazonVPC != nil || networking.Cilium != nil {
} else if networking.CNI != nil || networking.Weave != nil || networking.Flannel != nil || networking.Calico != nil || networking.Canal != nil || networking.Kuberouter != nil || networking.AmazonVPC != nil || networking.Cilium != nil {
assetNames = append(assetNames, "bridge", "host-local", "loopback", "ptp", "portmap")
// Do we need tuning?

Expand Down
2 changes: 0 additions & 2 deletions pkg/apis/kops/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,6 @@ func (c *Cluster) fillClusterSpecNetworkingSpec() {
// OK
} else if c.Spec.Networking.Kuberouter != nil {
// OK
} else if c.Spec.Networking.Romana != nil {
// OK
} else if c.Spec.Networking.AmazonVPC != nil {
// OK
} else if c.Spec.Networking.Cilium != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/kops/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ type KuberouterNetworkingSpec struct {
}

// RomanaNetworkingSpec declares that we want Romana networking
// Romana is deprecated as of kops 1.18 and removed as of kops 1.19
type RomanaNetworkingSpec struct {
// DaemonServiceIP is the Kubernetes Service IP for the romana-daemon pod
DaemonServiceIP string `json:"daemonServiceIP,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/kops/v1alpha2/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ type KuberouterNetworkingSpec struct {
}

// RomanaNetworkingSpec declares that we want Romana networking
// Romana is deprecated as of kops 1.18 and removed as of kops 1.19
type RomanaNetworkingSpec struct {
// DaemonServiceIP is the Kubernetes Service IP for the romana-daemon pod
DaemonServiceIP string `json:"daemonServiceIP,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/kops/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ func validateNetworking(c *kops.ClusterSpec, v *kops.NetworkingSpec, fldPath *fi
}

if v.Romana != nil {
allErrs = append(allErrs, field.Forbidden(fldPath.Child("romana"), "support for Romana has been removed"))
if optionTaken {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if block can be removed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can it? If I remove that block, kops creates my cluster.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A validation error should prevent creation. How is that happening?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I thought you were referring to the outer if. Yeah, this one can technically be removed.

allErrs = append(allErrs, field.Forbidden(fldPath.Child("romana"), "only one networking option permitted"))
}
Expand Down
13 changes: 0 additions & 13 deletions pkg/model/components/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,5 @@ func (b *NetworkingOptionsBuilder) BuildOptions(o interface{}) error {
return fmt.Errorf("classic networking not supported")
}

if networking.Romana != nil {
daemonIP, err := WellKnownServiceIP(clusterSpec, 99)
if err != nil {
return err
}
networking.Romana.DaemonServiceIP = daemonIP.String()
etcdIP, err := WellKnownServiceIP(clusterSpec, 88)
if err != nil {
return err
}
networking.Romana.EtcdServiceIP = etcdIP.String()
}

return nil
}
7 changes: 0 additions & 7 deletions pkg/model/firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,6 @@ func (b *FirewallModelBuilder) applyNodeToMasterBlockSpecificPorts(c *fi.ModelBu
protocols = append(protocols, ProtocolIPIP)
}

if b.Cluster.Spec.Networking.Romana != nil {
// Romana needs to access etcd
klog.Warningf("Opening etcd port on masters for access from the nodes, for romana. This is unsafe in untrusted environments.")
tcpBlocked[4001] = false
protocols = append(protocols, ProtocolIPIP)
}

if b.Cluster.Spec.Networking.Kuberouter != nil {
protocols = append(protocols, ProtocolIPIP)
}
Expand Down
38 changes: 0 additions & 38 deletions pkg/model/iam/iam_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,6 @@ func (b *PolicyBuilder) BuildAWSPolicyMaster() (*Policy, error) {
addECRPermissions(p)
}

if b.Cluster.Spec.Networking != nil && b.Cluster.Spec.Networking.Romana != nil {
addRomanaCNIPermissions(p, resource, b.Cluster.Spec.IAM.Legacy, b.Cluster.GetName())
}

if b.Cluster.Spec.Networking != nil && b.Cluster.Spec.Networking.AmazonVPC != nil {
addAmazonVPCCNIPermissions(p, resource, b.Cluster.Spec.IAM.Legacy, b.Cluster.GetName(), b.IAMPrefix())
}
Expand Down Expand Up @@ -826,40 +822,6 @@ func addRoute53ListHostedZonesPermission(p *Policy) {
})
}

func addRomanaCNIPermissions(p *Policy, resource stringorslice.StringOrSlice, legacyIAM bool, clusterName string) {
if legacyIAM {
// Legacy IAM provides ec2:*, so no additional permissions required
return
}

// Romana requires additional Describe permissions
// Comments are which Romana component makes the call
p.Statement = append(p.Statement,
&Statement{
Effect: StatementEffectAllow,
Action: stringorslice.Slice([]string{
"ec2:DescribeAvailabilityZones", // vpcrouter
"ec2:DescribeVpcs", // vpcrouter
}),
Resource: resource,
},
&Statement{
Effect: StatementEffectAllow,
Action: stringorslice.Slice([]string{
"ec2:CreateRoute", // vpcrouter
"ec2:DeleteRoute", // vpcrouter
"ec2:ReplaceRoute", // vpcrouter
}),
Resource: resource,
Condition: Condition{
"StringEquals": map[string]string{
"ec2:ResourceTag/KubernetesCluster": clusterName,
},
},
},
)
}

func addLyftVPCPermissions(p *Policy, resource stringorslice.StringOrSlice, legacyIAM bool, clusterName string) {
if legacyIAM {
// Legacy IAM provides ec2:*, so no additional permissions required
Expand Down
7 changes: 1 addition & 6 deletions pkg/model/openstackmodel/firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ func (b *FirewallModelBuilder) addETCDRules(c *fi.ModelBuilderContext, sgMap map
addDirectionalGroupRule(c, masterSG, masterSG, etcdMgmrRule)
}

if b.Cluster.Spec.Networking.Romana != nil ||
b.Cluster.Spec.Networking.Calico != nil {
if b.Cluster.Spec.Networking.Calico != nil {

etcdCNIRule := &openstacktasks.SecurityGroupRule{
Lifecycle: b.Lifecycle,
Expand Down Expand Up @@ -391,10 +390,6 @@ func (b *FirewallModelBuilder) addCNIRules(c *fi.ModelBuilderContext, sgMap map[
protocols = append(protocols, ProtocolIPEncap)
}

if b.Cluster.Spec.Networking.Romana != nil {
tcpPorts = append(tcpPorts, 9600)
}

if b.Cluster.Spec.Networking.Kuberouter != nil {
protocols = append(protocols, ProtocolIPEncap)
}
Expand Down
Loading