Skip to content

gcp: reduce the length of the names of machines #2088

Merged
openshift-merge-robot merged 2 commits intoopenshift:masterfrom
abhinavdahiya:gcp_msets_name
Jul 25, 2019
Merged

gcp: reduce the length of the names of machines #2088
openshift-merge-robot merged 2 commits intoopenshift:masterfrom
abhinavdahiya:gcp_msets_name

Conversation

@abhinavdahiya
Copy link
Contributor

The GCE kubelet uses the os.Hostname() to create node names and there's a har limit on hostnames to be 64 characters. based on 1
On GCP, the hostnames are <instance name>.c.<project-id>.internal and since the project ids on GCP can be of max 30 characters, an instance name can be max 22 characters.
The instances created by a machineset have the 6 character of randomness added to machineset's name, therefore the max length of machineset's name can be 16 characters. Therefore to accomodate the pool's name and zone (as we create machineset per zone) :

the mastes machines are now <infra-id>-m-<idx> and
the worker machinesets are now <infra-is>-w-<zone>, where the infra-id can be max 12 characters on GCP.

/cc @csrwng @jstuever

The GCE kubelet uses the `os.Hostname()` to create node names and there's a har limit on hostnames to be 64 characters. based on [1]
On GCP, the hostnames are `<instance name>.c.<project-id>.internal` and since the project ids on GCP can be of max 30 characters, an instance name can be max 22 characters.
The instances created by a machineset have the `6` character of randomness added to machineset's name, therefore the max length of machineset's name can be 16 characters. Therefore to accomodate the pool's name and zone (as we create machineset per zone) :

the mastes machines are now `<infra-id>-m-<idx>` and
the worker machinesets are now `<infra-is>-w-<zone>`, where the infra-id can be max 12 characters on GCP.

[1]: https://tools.ietf.org/html/rfc2181#section-11
@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 24, 2019
@csrwng
Copy link
Contributor

csrwng commented Jul 24, 2019

Awesome, I'm thinking that with the lower max size I can remove the need for a separate ingress-uid for service load balancers. I can do that in follow-up PR.
So I gave this a try and the autoapprover is not quite approving the csr's but it's because it's not matching the CN with the machine internalDNS... needs another small change in the machine api.
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 24, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavdahiya, csrwng

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
Copy link
Contributor

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

Test name Commit Details Rerun command
ci/prow/e2e-openstack daddfdc link /test e2e-openstack
ci/prow/e2e-aws-scaleup-rhel7 daddfdc link /test e2e-aws-scaleup-rhel7

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.

@openshift-merge-robot openshift-merge-robot merged commit 900a921 into openshift:master Jul 25, 2019
abhinavdahiya added a commit to abhinavdahiya/installer that referenced this pull request May 19, 2020
The infra id of the clusters on GCP was reduced to 12 in openshift#2088 because we couldn't handle the hostname seen by rhcos machine to be greater than 64.
More details on this are available in https://bugzilla.redhat.com/show_bug.cgi?id=1809345

now since BZ 1809345 is fixed by openshift/machine-config-operator#1711 and openshift/cluster-api-provider-gcp#88 the installer can relax the restriction on the infra-id to match the other platforms.

Why is it important?

On GCP all resources are prefixed with infra-id, which currently is 12 chars with 6 chars used by random bit, leaving only 6 chars from cluster name. This causes trouble associating the cluster to jobs in CI as most of the identifyable characters are dropped from the resource names in CI due to this restriction.

Also because of the previous restriction, only one char are used from pool's name, making is higly likely to collide in cases there are more.
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/installer that referenced this pull request May 22, 2020
The infra id of the clusters on GCP was reduced to 12 in openshift#2088 because we couldn't handle the hostname seen by rhcos machine to be greater than 64.
More details on this are available in https://bugzilla.redhat.com/show_bug.cgi?id=1809345

now since BZ 1809345 is fixed by openshift/machine-config-operator#1711 and openshift/cluster-api-provider-gcp#88 the installer can relax the restriction on the infra-id to match the other platforms.

Why is it important?

On GCP all resources are prefixed with infra-id, which currently is 12 chars with 6 chars used by random bit, leaving only 6 chars from cluster name. This causes trouble associating the cluster to jobs in CI as most of the identifyable characters are dropped from the resource names in CI due to this restriction.

Also because of the previous restriction, only one char are used from pool's name, making is higly likely to collide in cases there are more.
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/installer that referenced this pull request May 22, 2020
The infra id of the clusters on GCP was reduced to 12 in openshift#2088 because we couldn't handle the hostname seen by rhcos machine to be greater than 64.
More details on this are available in https://bugzilla.redhat.com/show_bug.cgi?id=1809345

now since BZ 1809345 is fixed by openshift/machine-config-operator#1711 and openshift/cluster-api-provider-gcp#88 the installer can relax the restriction on the infra-id to match the other platforms.

Why is it important?

On GCP all resources are prefixed with infra-id, which currently is 12 chars with 6 chars used by random bit, leaving only 6 chars from cluster name. This causes trouble associating the cluster to jobs in CI as most of the identifyable characters are dropped from the resource names in CI due to this restriction.

Also because of the previous restriction, only one char are used from pool's name, making is higly likely to collide in cases there are more.
jstuever added a commit to jstuever/openshift-installer that referenced this pull request Jun 3, 2020
This mirrors changes to GCP IPI in openshift#3544

The infra id of the clusters on GCP was reduced to 12 in openshift#2088 because
we couldn't handle the hostname seen by rhcos machine to be greater than
64.
More details on this are available in
https://bugzilla.redhat.com/show_bug.cgi?id=1809345

now since BZ 1809345 is fixed by openshift/machine-config-operator#1711
and openshift/cluster-api-provider-gcp#88 the installer can relax the
restriction on the infra-id to match the other platforms.

Why is it important?

On GCP all resources are prefixed with infra-id, which currently is 12
chars with 6 chars used by random bit, leaving only 6 chars from cluster
name. This causes trouble associating the cluster to jobs in CI as most
of the identifyable characters are dropped from the resource names in CI
due to this restriction.

Also because of the previous restriction, only one char are used from
pool's name, making is higly likely to collide in cases there are more.
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. lgtm Indicates that a PR is ready to be merged. platform/google size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants