Skip to content

Set MACAddressPolicy=none for Ubuntu 24.04 #17398

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions cmd/kops/create_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,12 @@ func NewCmdCreateCluster(f *util.Factory, out io.Writer) *cobra.Command {
}

func RunCreateCluster(ctx context.Context, f *util.Factory, out io.Writer, c *CreateClusterOptions) error {
switch {
case strings.HasPrefix(c.Image, "099720109477/ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server"):
c.Image = "099720109477/ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-amd64-server-20250419"
case strings.HasPrefix(c.Image, "099720109477/ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-arm64-server"):
c.Image = "099720109477/ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-arm64-server-20250419"
}
ctx, span := tracer.Start(ctx, "RunCreateCluster")
defer span.End()

Expand Down
5 changes: 3 additions & 2 deletions nodeup/pkg/model/networking/amazon-vpc-routed-eni.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ ManageForeignRoutingPolicyRules=no
})
}

// Running Amazon VPC CNI on Ubuntu 22.04 or any version of al2023 requires
// Running Amazon VPC CNI on Ubuntu 22.04+ or any version of al2023 requires
// setting MACAddressPolicy to `none` (ref: https://github.com/aws/amazon-vpc-cni-k8s/issues/2103
// & https://github.com/aws/amazon-vpc-cni-k8s/issues/2839
// & https://github.com/kubernetes/kops/issues/16255)
if (b.Distribution.IsUbuntu() && b.Distribution.Version() == 22.04) ||
if (b.Distribution.IsUbuntu() && b.Distribution.Version() >= 22.04) ||
b.Distribution == distributions.DistributionAmazonLinux2023 {
contents := `
[Match]
Expand Down
8 changes: 7 additions & 1 deletion upup/pkg/fi/cloudup/new_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,13 @@ func setupNetworking(opt *NewClusterOptions, cluster *api.Cluster) error {
enabled := false
cluster.Spec.KubeProxy.Enabled = &enabled
case "amazonvpc", "amazon-vpc-routed-eni":
cluster.Spec.Networking.AmazonVPC = &api.AmazonVPCNetworkingSpec{}
cluster.Spec.Networking.AmazonVPC = &api.AmazonVPCNetworkingSpec{
Env: []api.EnvVar{
{Name: "AWS_VPC_K8S_CNI_EXTERNALSNAT", Value: "true"},
{Name: "ENABLE_PREFIX_DELEGATION", Value: "true"},
{Name: "WARM_PREFIX_TARGET", Value: "1"},
},
}
case "cilium", "":
addCiliumNetwork(cluster)
case "cilium-etcd":
Expand Down
Loading