incalculable-midnight-8291
01/05/2022, 11:12 AMcluster.eksCluster.name.apply
seems to work a bit differently than I thought.
so basically using it like this seems to work:
cluster.eksCluster.name.apply((eksClusterName) => {
const nodegroup = new eks.NodeGroup(`${name}-nodegroup`, {
cluster,
instanceProfile,
labels: {
role: 'managed-nodes',
},
instanceType: 't2.medium',
desiredCapacity: 1,
minSize: 1,
maxSize: 3,
autoScalingGroupTags: {
['<http://k8s.io/cluster-autoscaler/enabled|k8s.io/cluster-autoscaler/enabled>']: 'true',
[`<http://k8s.io/cluster-autoscaler/${eksClusterName}`|k8s.io/cluster-autoscaler/${eksClusterName}`>]: 'owned',
},
});
------------
Original:
Hi!
Im trying to setup an eks cluster with k8s cluster autoscaler.
To get this to work, I need to tag the nodegroup with:
autoScalingGroupTags: {
['<http://k8s.io/cluster-autoscaler/enabled|k8s.io/cluster-autoscaler/enabled>']: 'true',
[`<http://k8s.io/cluster-autoscaler/${cluster.eksCluster.name}`|k8s.io/cluster-autoscaler/${cluster.eksCluster.name}`>]: 'owned',
},
However, the operation fails since Template format error: YAML not well-formed
Checking details shows that cluster.eksCluster.name
is never expanded to the name, instead it becomes: <http://k8s.io/cluster-autoscaler/Calling|k8s.io/cluster-autoscaler/Calling> [toString] on an [Output<T>] is not supported....
Im creating the cluster with
const cluster = new eks.Cluster(name, { optionsĀ });
But the eks cluster dont just get the name name
, but ${name}-eksCluster-1234567
The number seems to be generated on creation, so I would really need some way of extracting it so I can use it in my tag.
I have tried `pulumi.interpolate`k8s.io/cluster-autoscaler/${cluster.eksCluster.name}`` and
cluster.eksCluster.name.apply(v => `<http://k8s.io/cluster-autoscaler/${v}`|k8s.io/cluster-autoscaler/${v}`>)
but they both fail with error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
Any ideas?No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by