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

[OpenStack][UPI]: tweaks #2823

Merged
merged 2 commits into from Dec 20, 2019

Conversation

iamemilio
Copy link

@iamemilio iamemilio commented Dec 16, 2019

  • get cluster-name from infraID generated by the installer from the metadata.json now
  • Make the naming scheme uniform with how we name resources in IPI

@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 16, 2019
@iamemilio
Copy link
Author

/assign @tomassedovic
/assign @pierreprinetti

@@ -6,7 +6,7 @@ all:

# User-provided values
os_subnet_range: '10.0.0.0/16'
os_cluster_name: 'openshift'
os_cluster_name: "{{ lookup('env', 'INFRA_ID') }}"
Copy link
Member

Choose a reason for hiding this comment

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

The idea here is that the user provides values in this section. What is the use case for having some variables in env?

Copy link
Author

Choose a reason for hiding this comment

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

I just figured it would be easy, since we already tell the user to source this value. But I'll tell you what, I can change it to {{ lookup('env', 'INFRA_ID') | default('openshift') }}

Copy link
Author

@iamemilio iamemilio Dec 17, 2019

Choose a reason for hiding this comment

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

The difference is, that the installer will always define this value as <cluster-name>-<random hash>, so this at least makes sure that the name on your configs matches the name on your infra. It also depends on the workflow you want here. If we are going install-config --> inventory, as the docs currently lay it out, it makes sense this way. However, if we go
inventory --> install-config then it makes sense to have a user defined cluster name here, and then read in the INFRA_ID elsewhere. Ultimately though, somewhere in the inventory, we will have to read this value back from the installer metadata.

Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW I'd prefer if the inventory/playbooks read it from install-config. Less error-prone that way.

Also I believe, there's a difference between cluster name and infra ID. Cluster name is the name you specify in install-config.yaml / installer prompt (e.g. lolcloud) but infra-id is cluster name plus the random suffix (e.g. lolcloud-23n9).

So I think the simplest workflow we can do would be to have os_cluster_name as a user-defined variable in the inventory and read os_infra_id from install-config (or rather, metadata.json).

@@ -26,7 +26,7 @@ all:
# OpenShift cluster resources. It is built in the form of:
#
# "{{ os_cluster_name }}{{ installation-specific string }}"
os_infra_id: "{{ os_cluster_name }}-upi"
os_infra_id: "{{ os_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.

oh yes, thank you for this. That upi was meant to be a placeholder for the random string generated by the installer; however, it makes little sense to change a value the user provided explicitly. 👍

Do you mind amending the comment above accordingly?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think os_infra_id must be unique and we shouldn't allow users to specify it at all. If there are two clusters with the same infra ID, then there may be resource collisions. Also as you remember the installer destroys clusters based on their os_infra_id values, so we can accidentally destroy another cluster with the same infra ID.

@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 18, 2019
@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 18, 2019
@mandre
Copy link
Member

mandre commented Dec 20, 2019

/label platform/openstack

@@ -22,7 +25,6 @@
allowed_address_pairs:
- ip_address: "{{ os_subnet_range | next_nth_usable(5) }}"
- ip_address: "{{ os_subnet_range | next_nth_usable(6) }}"
- ip_address: "{{ os_subnet_range | next_nth_usable(7) }}"
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the heads up, this has been extracted to #2848

@pierreprinetti
Copy link
Member

/approve

Good work, and absolutely needed.

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pierreprinetti

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

The pull request process is described here

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 Dec 20, 2019
@mandre
Copy link
Member

mandre commented Dec 20, 2019

/lgtm

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

/retest

Please review the full test history for this PR and help us cut down flakes.

3 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 7f6aab4 into openshift:master Dec 20, 2019
@openshift-ci-robot
Copy link
Contributor

@iamemilio: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/prow/e2e-aws-scaleup-rhel7 6faf47c 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.

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.

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/openstack 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.

None yet

8 participants