aws-samples / aws-samples/cdk-eks-karpenter

Upgrading from 0.37.5 to 1.X versions using this CDK library

Open
#197 6 comments 1 reaction 1 assignee Claimed by @andskli View on GitHub
Dominant language
TypeScript
Stars
48
Forks
21
PR merge metrics
No merged PRs in 30d

Description

We're maintaining CDK stack which deploys multiple resources we use in K8 cluster, including Karpenter.

Currently, deploying it with other means is for many reasons impossible.

We're looking to upgrade our Karpenter instance to 1.x versions. Currently it sits at `0.37.5`

Our deployment logic looks something like this:

```js
import { Karpenter } from 'cdk-eks-karpenter';

// other code here ...

installKarpenter(env: EnvConfig, cluster: Cluster, nodeRole: IRole, dependencies: IDependable[]): any {
const karpenterNodeRole = new Role(this, 'NodeRole', {
roleName: `karpenter-node-role`,
assumedBy: new ServicePrincipal(`ec2.${Aws.URL_SUFFIX}`),
managedPolicies: [
ManagedPolicy.fromAwsManagedPolicyName('AmazonEKS_CNI_Policy'),
ManagedPolicy.fromAwsManagedPolicyName('AmazonEKSWorkerNodePolicy'),
ManagedPolicy.fromAwsManagedPolicyName('AmazonEC2ContainerRegistryReadOnly'),
// ... other policies here
],
});

const version = '0.37.5';

// Install karpenter-crd helm chart
const karpenterCrd = new eks.HelmChart(this, 'karpenter-crd', {
cluster: cluster,
chart: 'karpenter-crd',
repository: 'oci://public.ecr.aws/karpenter/karpenter-crd',
version: version,
namespace: 'karpenter',
release: 'karpenter-crd',
values: {
clusterName: cluster.clusterName,
},
});

const karpenter = new Karpenter(this, 'karpenter', {
cluster: cluster,
version: version,
nodeRole: karpenterNodeRole,
});

karpenter.node.addDependency(...dependencies, karpenterCrd);

return karpenter;
}
```

So we have separated Karpenter version from Karpenter CRD version.

Questions - can we update it without, or minimizing manual actions (i.e through terminal) having such deployment? Our previous update attempt failed.

Currently, I've been thinking about performing upgrade steps from [Upgrade information for migrating to v1
](https://karpenter.sh/docs/upgrading/v1-migration/) and applying every command manually through terminal to ensure order, and if everything succeeded, only then bump version (to 1.0.7, same as manually) in CDK stack and deploy.

This would probably trigger redeploy but I think there would be no issue since resources would already be migrated.

I am only not sure about new IAM permissions.

Question: was it already tried and would it work?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.