-
Notifications
You must be signed in to change notification settings - Fork 48
allow user to define controlplane_network_gateway #694
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
base: main
Are you sure you want to change the base?
Conversation
When public vlan is true, user can't override the value for controlplane_network_gateway. In prow, we want to use the bastion host as the default gateway instead of vlan's default gateway for some workloads. This allows user to specify the default gateway for both the public and private networks. If the user not defines it, then jetlag defines it using the existing mechanism. Signed-off-by: venkataanil <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I believe we discussed this in a google doc but this is already possible without using ...
# Set to true ONLY if you have a public routable vlan in your scalelab or performancelab cloud.
# Autoconfigures cluster_name, base_dns_name, controlplane_network_interface_idx, controlplane_network,
# controlplane_network_prefix, and controlplane_network_gateway to the values required for your cloud's public VLAN.
# SNO configures only the first cluster on the api dns resolvable address
# MNO/SNO still requires the correct value for bastion_controlplane_interface
public_vlan: false
... As mentioned, you can use |
thanks @akrzos
However this is introducing lot of additional work for @josecastillolema in matainaing the jobs with and wihtout vlans. So he is mandating public vlans unless the test doesn't support it. We can adapt his suggestion and use private network only if it is necessary. So this PR is required if we want to go with public vlan for our network workloads. @mohit-sheth fyi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets try the adjustment I suggested and run a few CI runs to see nothing else break so we can get this merged.
@@ -9,7 +9,6 @@ controlplane_network_interface_idx: 0 | |||
controlplane_network_interface: eth0 | |||
controlplane_network: 198.18.0.0/16 | |||
controlplane_network_prefix: 16 | |||
controlplane_network_gateway: "{{ controlplane_network | ansible.utils.nthhost(1) }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately removing this when the file is widely symlinked between many roles will result in potential breakage in at least 2 roles
- bastion-gogs
- bastion-disconnected-haproxy
Since those roles have vars that depend on controlplane_network_gateway
. You might ask why do these roles "import" by symlink the variables in ansible/roles/create-inventory/defaults/main/networks.yml, well the reason is a long time ago when jetlag was first being developed we attempted to have a single vars file (all.yml) and for it to have every possible var required therefore all vars were global, however the length of all.yml became very large and folks would muck with vars that rarely needed to be adjusted or changed. There was also very few variables that needed to be modified per deployment for a basic deployment. The end result was we could "localize" vars more into each role but this meant repeating many variables across different roles. We left the most needed variables in all.yml and put a "spot" on the bottom of the file to override variables that had been "localized" to the role. The solution we landed on at the time was to make "related" vars files that could be symlinked into roles to reduce repetition of vars and ideally improve maintainability. The symlinked vars files have both pros and cons, as a pro it means we have a single file to modify for a variable's existent, and a con is that when it comes time to modify that variable, it can have a much more significant effect than intended if it is not well understood what consumes this variable when it is symlinked. If we stuck to repeating each variable in each role's default variables file, then we would end up have many spots to potential modify for a new default variable value. As you can see both of these solutions have pros and cons. To this day, no one has taken on the task to attempting to improve the vars maintenance further. This means there can be instances where it seems like the appropriate solution is to remove a variable from a vars file however it will effect many more roles than you may have intended.
That being said, one potential solution here would be to change which var is referenced here:
From gogs_host: "{{ controlplane_network_gateway }}"
to gogs_host: "{{ bastion_controlplane_ip }}"
I think that would solve the dependency issue we see here however I do not have the extensive means to test this at this time. Another potential solution would be adding yet another special variable just for your use case of using public_vlan
for auto configuration but running a custom controlplane_network_gateway
which I would prefer not to add yet another variable just for a single edge case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately removing this when the file is widely symlinked between many roles will result in potential breakage in at least 2 roles
- bastion-gogs
- bastion-disconnected-haproxy
Since those roles have vars that depend on
controlplane_network_gateway
. You might ask why do these roles "import" by symlink the variables in ansible/roles/create-inventory/defaults/main/networks.yml, well the reason is a long time ago when jetlag was first being developed we attempted to have a single vars file (all.yml) and for it to have every possible var required therefore all vars were global, however the length of all.yml became very large and folks would muck with vars that rarely needed to be adjusted or changed. There was also very few variables that needed to be modified per deployment for a basic deployment. The end result was we could "localize" vars more into each role but this meant repeating many variables across different roles. We left the most needed variables in all.yml and put a "spot" on the bottom of the file to override variables that had been "localized" to the role. The solution we landed on at the time was to make "related" vars files that could be symlinked into roles to reduce repetition of vars and ideally improve maintainability. The symlinked vars files have both pros and cons, as a pro it means we have a single file to modify for a variable's existent, and a con is that when it comes time to modify that variable, it can have a much more significant effect than intended if it is not well understood what consumes this variable when it is symlinked. If we stuck to repeating each variable in each role's default variables file, then we would end up have many spots to potential modify for a new default variable value. As you can see both of these solutions have pros and cons. To this day, no one has taken on the task to attempting to improve the vars maintenance further. This means there can be instances where it seems like the appropriate solution is to remove a variable from a vars file however it will effect many more roles than you may have intended.That being said, one potential solution here would be to change which var is referenced here:
From
gogs_host: "{{ controlplane_network_gateway }}"
togogs_host: "{{ bastion_controlplane_ip }}"
Agree.
I think that would solve the dependency issue we see here however I do not have the extensive means to test this at this time.
We can wait for this change until someone can verify "gogs" roles. Is it possible to request any folks who use "gogs" role to verify later when they get thechance.
Another potential solution would be adding yet another special variable just for your use case of using
public_vlan
for auto configuration but running a customcontrolplane_network_gateway
which I would prefer not to add yet another variable just for a single edge case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can wait for this change until someone can verify "gogs" roles. Is it possible to request any folks who use "gogs" role to verify later when they get thechance.
I'm not sure I understand, you can or can't wait? I suggested a fix after reviewing the code and following the vars, did you want to implement it or keep the patch in limbo?
When public vlan is true, user can't override the value for controlplane_network_gateway. In prow, we want to use the bastion host as the default gateway instead of vlan's default gateway for some workloads. This allows user to specify the default gateway for both the public and private networks. If the user not defines it, then jetlag defines it using the existing mechanism.