-
Notifications
You must be signed in to change notification settings - Fork 82
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
Allow users to override Name tag in autoscaling group #859
base: master
Are you sure you want to change the base?
Conversation
PR is now waiting for a maintainer to run the acceptance tests. This PR will only perform build and linting. |
/run-acceptance-tests |
Please view the PR build - https://github.com/pulumi/pulumi-eks/actions/runs/4359280434 |
Name: `${clusterName}-worker`, | ||
[`kubernetes.io/cluster/${clusterName}`]: "owned", | ||
...asgTags, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spread in the original implementation is after the explicit name - and therefore if a Name
exists in asgTags
it should overwrite the Name
specified before the spread.
Do you have example code which demonstrates the issue you're seeing with the custom name not being applied?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick test run:
const clusterName = "test-cluster"
const asgTags = {
Name: "overriden-name"
}
const result = {
Name: `${clusterName}-worker`,
[`kubernetes.io/cluster/${clusterName}`]: "owned",
...asgTags
};
console.log(result);
prints:
{
kubernetes.io/cluster/test-cluster: "owned",
Name: "overriden-name"
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As it stands now it works to set your own name with the tag, that's not the issue. But everytime you re-run the command you get a diff on tags since the value fetched from AWS does not contain the Name: {clusterName}-worker
value.
There might be a difference between your example and how it works when evaluating it the way it's done in the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This happens every time you run preview
or up
but you've provided your own name tag.
~ aws:autoscaling/group:Group: (update)
[id=k8s-core]
[urn=urn:pulumi:dev.eu-central-1::k8s::eks:index:Cluster$aws:iam/instanceProfile:InstanceProfile$eks:index:NodeGroupV2$aws:autoscaling/group:Group::k8s-core]
[provider=urn:pulumi:dev.eu-central-1::k8s::pulumi:providers:aws::default_5_16_2::5f73b234-f1c8-489b-8de0-2c66cf783459]
~ launchTemplate: {
~ version: "18" => output<string>
}
~ tags : [
+ [9]: {
+ key : "Name"
+ propagateAtLaunch: true
+ value : "k8s-worker"
}
]
Proposed changes
Currently you get confilcts every time you update the cluster through Pulumi if you've provided a Name tag using the AutoScaling group tags. This fix will allow you to override the Name tag to ensure you can control the name of the nodes.
Related issues (optional)
None (as far as I can tell)