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

Changing authenticationMode of EKS cluster should trigger a re-create #4789

Open
flostadler opened this issue Nov 18, 2024 · 2 comments
Open
Labels
kind/enhancement Improvements or new features service/eks EKS issues

Comments

@flostadler
Copy link
Contributor

Courtesy of @jkodroff.

EKS cluster authentication modes can only be changed in the following order CONFIG_MAP -> API_AND_CONFIG_MAP -> API.
Other transitions are not allowed by AWS and require tearing the cluster down before recreating it.

We should detect such transitions and mark the diff to require a replacement. Regular transitions should not lead to replacements as this would break the upgrade path.

The change most likely needs to be made upstream.

Example

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as awsx from "@pulumi/awsx";
import * as eks from "@pulumi/eks";
import * as pcloud from "@pulumi/pulumiservice";

const vpc = new awsx.ec2.Vpc("k8s-better-together", {
  // Using a single NAT Gateway (as opposed to the default of one per AZ) helps
  // reduce cost and may improve provisioning time. In production scenarios, you
  // should typically use one per AZ.
  natGateways: {
    strategy: "Single"
  }
});

const eksCluster = new eks.Cluster("k8s-better-together", {
  authenticationMode: "API", // <-- Omit this line on the first run of the problem.
  vpcId: vpc.vpcId,
  publicSubnetIds: vpc.publicSubnetIds,
  privateSubnetIds: vpc.privateSubnetIds,
  // The CoreDNS add-on takes a while to install (about 10 minutes). Installing
  // the add-on keeps it automatically up to date and is helpful for day 2
  // operations. Since this is just a temporary cluster, we'll leave it
  // disabled.
  corednsAddonOptions: {
    enabled: false,
  },
  createOidcProvider: true
});
@jkodroff
Copy link
Member

@flostadler Do we definitively know that you can't do API -> API_AND_CONFIGMAP?

@flostadler
Copy link
Contributor Author

Yeah, once you set the auth mode to API you cannot go back. Tried this with an actual cluster a while ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements or new features service/eks EKS issues
Projects
None yet
Development

No branches or pull requests

2 participants