-
Notifications
You must be signed in to change notification settings - Fork 2
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
terraform upcloud: Added possibility to set up nodes with only private networks #20
Conversation
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.
LGTM, But I will try it later today 🙂
contrib/terraform/upcloud/README.md
Outdated
* `force_public_ip`: If `use_public_ips` is set to false, this forces a public NIC on the machine. Useful if you're migrating from public nodes to only private. Defaults to `false` | ||
* `force_no_user_data`: If `private_network_dns` is set existing nodes will be deleted. This forces this mahcine to not add the user_data. Useful if you're migrating from public nodes to only private. Defaults to `false` |
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.
Should there be some migration steps to move from public to private and vice verse?
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.
Hmm, yea that makes sense. I'll write some small section about that. But it's basically to just replace all nodes.
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.
When trying to apply these changes on an existing cluster I'm seeing will be updated in-place
, is this not true or what do you mean by "replace all nodes"?
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.
The issue is that the indexing for the interfaces in terraform matter. So if you remove the public IP it will look like it's in place. But in reality it will recreate the interface completely, so it will get a new IP. See this issue
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.
That's scary... :o
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.
I tried to create vms with just private ips and a bastion host and it works 👍
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.
The plans after switching to this branch from the base branch of this PR looks like this:
With use_public_ips=true
:
~ master_ip = {
~ simonklb-control-plane-0 = {
+ private = "172.16.123.3"
- private_ip = "172.16.123.3"
+ public = "185.26.51.68"
- public_ip = "185.26.51.68"
}
}
I would not have expected any diffs here if it was completely backwards compatible. I'm not sure if there is something relying on the output variables but if there are it might be Example of backwards incompatibility https://github.com/elastisys/ck8s-devbox/pull/535 which makes it worth noting that it's not backwards compatible.
With use_public_ips=false
:
~ master_ip = {
~ simonklb-control-plane-0 = {
+ private = "185.26.51.68"
- private_ip = "172.16.123.3"
- public_ip = "185.26.51.68"
}
}
This looks wrong or maybe I'm not understanding what "private IPs" means here. I would have assumed the private IP would have been the local address.
Response: #20 (comment)
contrib/terraform/upcloud/README.md
Outdated
* `force_public_ip`: If `use_public_ips` is set to false, this forces a public NIC on the machine. Useful if you're migrating from public nodes to only private. Defaults to `false` | ||
* `force_no_user_data`: If `private_network_dns` is set existing nodes will be deleted. This forces this mahcine to not add the user_data. Useful if you're migrating from public nodes to only private. Defaults to `false` |
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.
When trying to apply these changes on an existing cluster I'm seeing will be updated in-place
, is this not true or what do you mean by "replace all nodes"?
fb19888
to
685a617
Compare
@davidumea @Xartos any updates for this? Or should we try to review this again and merge it? |
I thought about making |
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.
Only a non-blocker that I think would make this change look a bit less "migration-oriented". It looks like it does the job though and I appreciate the work done to not break existing machines!
1cbabd0
to
8017589
Compare
What type of PR is this?
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
This is just for review purpuse, I'll take it upstream when this is approved
This also changes the output variables
master_ip
andworker_ip
from having the IPs inprivate_ip
andpublic_ip
for each node to beprivate
andpublic
. I tried to look and that doesn't seem to be used anywhere so it should be fineDoes this PR introduce a user-facing change?: