Skip to content

Conversation

@staebler
Copy link
Contributor

AWS ELB names are limited to 32 characters. The cluster name is used in the ELB name and can result in an ELB name that is too long. These changes generate a unique cluster name that is trimmed to fit
the limits of ELB names.

https://jira.coreos.com/browse/CORS-1004

AWS ELB names are limited to 32 characters. The cluster name is
used in the ELB name and can result in an ELB name that is too long.
These changes generate a unique cluster name that is trimmed to fit
the limits of ELB names.

https://jira.coreos.com/browse/CORS-1004
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: staebler

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 19, 2019
@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 19, 2019
@staebler
Copy link
Contributor Author

/hold

This is just a POC while the details of cloud tagging are finalized.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 19, 2019
@openshift-ci-robot
Copy link
Contributor

@staebler: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/prow/tf-fmt 954c062 link /test tf-fmt
ci/prow/govet 954c062 link /test govet
ci/prow/unit 954c062 link /test unit
ci/prow/e2e-aws 954c062 link /test e2e-aws
ci/prow/images 954c062 link /test images

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@wking
Copy link
Member

wking commented Feb 19, 2019

Also related is #1089. Do we want to pull that in too?

}
}

// Generate generates a random, unique cluster name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: missing a trailing period here and in some other godocs.


variable "aws_unique_cluster_name" {
type = "string"
description = "The cluster name trimmed down and made unique"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably include "The value will be at most 28 characters".

@wking
Copy link
Member

wking commented Feb 19, 2019

I'm fine with this, although it looks like you're missing a vendor for k8s.io/apimachinery/pkg/util/rand? I'm also fine recycling part of the cluster UUID here, since that's already a pool of unique bits associated with the cluster, and that would avoid the new dependency. Personally, I'd rather slant towards the UUID/random side over the name, and in this case that means I'd rather just use the first 28 characters of the UUID after removing hyphens. But I understand that other folks are more bothered by having to poke around in the AWS web UI to find human-readable tags, and are willing to take the slightly increased risk of collision in the smaller 5-character random identifier-space.

@abhinavdahiya
Copy link
Contributor

@staebler
can we change ClusterID to give us UUID (currenlty globally unique) and HumanID (unique to smaller extent and more human readable)

@@ -1,5 +1,5 @@
resource "aws_lb" "api_internal" {
name = "${var.cluster_name}-int"
name = "${var.unique_cluster_name}-int"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So looks like name is optional.
What if we drop the name here and add Name tag to the elb. And tag values can be max length 256?
is it possible?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@staebler
Copy link
Contributor Author

I'm fine with this, although it looks like you're missing a vendor for k8s.io/apimachinery/pkg/util/rand? I'm also fine recycling part of the cluster UUID here, since that's already a pool of unique bits associated with the cluster, and that would avoid the new dependency. Personally, I'd rather slant towards the UUID/random side over the name, and in this case that means I'd rather just use the first 28 characters of the UUID after removing hyphens. But I understand that other folks are more bothered by having to poke around in the AWS web UI to find human-readable tags, and are willing to take the slightly increased risk of collision in the smaller 5-character random identifier-space.

I am not concerned with the risk of collision with only 5 random characters. The potential is only between clusters that have the same first 22 characters of their cluster name. And even when there is a collision, the result is a failed installation rather than a faulty cluster. 5 random characters is sufficient for kube proper as the default name generator.

@staebler
Copy link
Contributor Author

Also related is #1089. Do we want to pull that in too?

Yes, we should address hyphens as well. Thanks. I can add that after the plan for tagging is finalized. This PR was only meant as a POC.

@staebler
Copy link
Contributor Author

Superseded by #1280.

@staebler staebler closed this Feb 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants