Is there any guidance on how to ugprade an EKS clu...
# aws
b
Is there any guidance on how to ugprade an EKS cluster that uses a Managed Node Group? I updated the EKS cluster version and hoped that pulumi would update the EKS cluster and then the worker AMIs used by the node group, but only the EKS cluster got upgraded.
🎯 1
I also noticed that upgrading the k8s version doesn't update the version of the addons that pulumi automatically installed when I set the cluster up. For example, I'm upgrading from 1.27 to 1.28 and my kube-proxy is still at 1.28. What do I need to do to upgrade these?
q
Hey, are you using the aws classic EKS cluster resource or the EKS cluster component? You mentioned that your kube-proxy is still at version 1.28 after upgrading, I assume you mean 1.27, right?
b
I am using
pulumi_eks.Cluster
, so the latter of the two. And yeah, sorry, I meant 1.27
v1.27.6-minimal-eksbuild.2
is the exact version
q
You're right that the node group version isn't auto updated right now. As a workaround you could set the Managed Node Group version to the version output of the EKS cluster like so:
Copy code
const cluster = new eks.Cluster("example-managed-nodegroups", {
  skipDefaultNodeGroup: true,
  deployDashboard: false,
  vpcId: eksVpc.vpcId,
  publicSubnetIds: eksVpc.publicSubnetIds,
  privateSubnetIds: eksVpc.privateSubnetIds,
  instanceRoles: [role],
  version: "1.29",
});

const managedNodeGroup0 = eks.createManagedNodeGroup("example-managed-ng0", {
  cluster: cluster,
  nodeRole: role,
  enableIMDSv2: true,
  version: cluster.eksCluster.version, // <- this makes the version propagate to the node group
});
Ideally we should do this in the provider by default. I created an issue to track this enhancement: https://github.com/pulumi/pulumi-eks/issues/1253
This should also explain kube-proxy being of an older version as it follows the kubelets version. Could you try updating the node group version like I mentioned above? After that kube-proxy should be updated as well
b
ack - I'll give that a shot. Will pulumi take care to update the eks cluster before upgrading the node group? Or should I do it over two pulumi runs?
q
It should because the node group has a dependency on the cluster.
b
thanks! that worked. I'm upgrading from 1.27 to 1.28. But I'm seeing that my kubeproxy pods are still on 1.27 (
v1.27.1-minimal-eksbuild.1
)
q
Oh you're right. I just dug a bit deeper and the EKS service doesn't auto upgrade the add ons it adds itself. As a workaround you need to specify the versions for the EKS platform addons (
kube-proxy
and
coredns
). Example:
Copy code
const kubeProxyVersion = aws.eks.getAddonVersionOutput({
  addonName: "kube-proxy",
  kubernetesVersion: cluster.eksCluster.version,
  mostRecent: true, // whether to return the default version or the most recent version for the specified kubernetes version
}).apply((addonVersion) => addonVersion.version);

const example = new aws.eks.Addon("example", {
  clusterName: cluster.eksCluster.name,
  addonName: "kube-proxy",
  addonVersion: kubeProxyVersion,
});
I'll also create an issue to track this enhancement
b
this means I have to disable addons in the pulumi eks cluster object which will tear down my eks cluster right?
q
No you don't. This should "adopt" the addons instead of recreating them.
b
I'll also create an issue to track this enhancement
do you have a pointer to the issue?
q
Uh sorry, missed sending it. It's this one here: https://github.com/pulumi/pulumi-eks/issues/1254
🙏 1