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

Use the server's zone to determine a node selector when running in pods #19789

Merged
merged 7 commits into from
Feb 5, 2020

Conversation

carbonin
Copy link
Member

@carbonin carbonin commented Jan 31, 2020

This will allow workers to be target to specific nodes.

This works for now, but I haven't looked into what happens if a server changes zones. Leaving this as WIP until I get around to that.

As a part of this I added a validation to fail updates to a server's zone in pods. Additionally I created a UI PR to disable the zone drop-down for pods and handle validation errors when changing the server zone.

Fixes ManageIQ/manageiq-pods#353

app/models/miq_server.rb Outdated Show resolved Hide resolved
This will allow workers to be target to specific nodes.
@carbonin carbonin force-pushed the add_node_selector_for_zone branch from afd2ad2 to dbb28af Compare February 4, 2020 21:44
@carbonin carbonin changed the title [WIP] Use the server's zone to determine a node selector when running in pods Use the server's zone to determine a node selector when running in pods Feb 4, 2020
@carbonin carbonin removed the wip label Feb 4, 2020
@carbonin
Copy link
Member Author

carbonin commented Feb 4, 2020

Cross repo tests ManageIQ/manageiq-cross_repo-tests#62

app/models/miq_server.rb Outdated Show resolved Hide resolved
app/models/miq_server.rb Outdated Show resolved Hide resolved
We auto-create a server per zone so a change should
never be necessary
This tells the UI if we're currently able/allowed to change
the zone of servers
This will prevent database access every time we call this method
and we're not running in pods.
This will allow us to include a node in multiple zones for more
flexibility.
@carbonin carbonin force-pushed the add_node_selector_for_zone branch from dbb28af to 1a5f85b Compare February 5, 2020 16:17
Without this change we get errors from Kube about the label format:

$> oc label node node.example.com manageiq/zone/asdf=true
The Node "node.example.com" is invalid: metadata.labels: Invalid value:
"manageiq/zone/asdf": a qualified name must consist of alphanumeric
characters, '-', '_' or '.', and must start and end with an
alphanumeric character (e.g. 'MyName',  or 'my.name',  or '123-abc',
regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]')
with an optional DNS subdomain prefix and '/' (e.g. 'example.com/MyName')
@miq-bot
Copy link
Member

miq-bot commented Feb 5, 2020

Checked commits carbonin/manageiq@c5e7d98~...c9015dc with ruby 2.5.5, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
6 files checked, 1 offense detected

app/models/zone.rb

@Fryguy Fryguy merged commit 145a4d1 into ManageIQ:master Feb 5, 2020
@Fryguy Fryguy added this to the Sprint 130 Ending Feb 17, 2020 milestone Feb 5, 2020
@carbonin carbonin deleted the add_node_selector_for_zone branch February 5, 2020 22:10
@chessbyte chessbyte added this to the Jansa milestone Mar 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Podification] Make it work with Zones
4 participants