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

Set AWS EKS cluster name #277

Closed
gregbacchus opened this issue Nov 17, 2019 · 7 comments · Fixed by #322
Closed

Set AWS EKS cluster name #277

gregbacchus opened this issue Nov 17, 2019 · 7 comments · Fixed by #322
Assignees
Milestone

Comments

@gregbacchus
Copy link

When creating the aws.eks.Cluster, it would be great if the name property that is provided would passed in would be passed in. This way the AWS resource created will have a sensible name and will then be easily identifiable.

All that is required is to pass the name to the aws.eks.Cluster opts argument

const eksCluster = new aws.eks.Cluster(`${name}-eksCluster`, {
roleArn: eksRole.apply(r => r.arn),
vpcConfig: {

  const eksCluster = new aws.eks.Cluster(`${name}-eksCluster`, {
      name,
      roleArn: eksRole.apply(r => r.arn), 
      vpcConfig: { 
      ...
@pgavlin
Copy link
Member

pgavlin commented Nov 18, 2019

We generally leave autonaming on to lower the probability of the resources in two stacks ending up with conflicting names, but this does seem like a reasonable configuration point we could provide (i.e. we could optionally do what you're suggesting while still making autonaming the default behavior).

@gregbacchus
Copy link
Author

Yes that would be ok. I just started using it with the auto name and it caused issues because in another script I needed to reference it, which I couldn't. So I had to take a copy of the while thing and add a one love change.. not ideal. The other option would be some other way to make it easier to override smaller bits of functionality

@gregbacchus
Copy link
Author

One of the reasons that it is useful to have a known name for the EKS cluster, is that you need to add a tag to the subnets kubernetes.io/cluster/${eksClusterName}: 'shared', and you need to create the subnets before you create the EKS cluster.

Without that tag on the subnets, AWS has problems auto-creating the load balancers required by the k8s services.

See
https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html

@icereed
Copy link

icereed commented Feb 6, 2020

Hey @gregbacchus, fighting the same issue. Did you find a solution?
Otherwise I would also like to have the feature so we can preset the name.

@gregbacchus
Copy link
Author

gregbacchus commented Feb 8, 2020 via email

@advissor
Copy link

So, what is the solution for this ?
I've tried to create a cluster today and it misses the required tags on subnets
kubernetes.io/cluster/${eksClusterName}: 'shared'

So, the whole thing stalls until timeout for 30 mins.. And, there not gonna be any messages, until you fight for some hours deleting partially resources

@gregbacchus
Copy link
Author

You can now specify the name in the options

const cluster = new Cluster(name, {
    name,
    // ...
  }, {...});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants