-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Auto-detect Azure cloud name via IMDS #16515
Auto-detect Azure cloud name via IMDS #16515
Conversation
@ti-mo -- we chatted about this in #16043 (comment) + #16043 (comment). I'd be curious how to execute the flag migration. At the moment there are the following cases:
We could mark it as deprecated but given it has a default I don't know of a way to check in code if it was passed or not. If it would be a way to check that this was not passed then we could invoke the new codepath. Interested to hear your opinions on this. @aanm -- I know we talked in the past about flag migrations, if you have any thoughts they are welcomed! |
4149473
to
0ac5dd6
Compare
test-me-please |
Thanks for the patch! Unfortunately, I don't have an answer to the flag migration. Since this only recently started working, and it's not configurable through Helm (yet?), I don't think this would be used in the wild. Personally, I wouldn't worry too much about breaking this, but I don't know what our usual policy is. I would guess we can't ever break backports, so this might need to go into 1.11. |
@ti-mo -- in this case I marked the PR as ready for review. |
pkg/ipam/allocator/azure/azure.go
Outdated
@@ -48,6 +48,11 @@ func (*AllocatorAzure) Start(getterUpdater ipam.CiliumNodeGetterUpdater) (alloca | |||
|
|||
log.Info("Starting Azure IP allocator...") | |||
|
|||
azureCloudName, err := azureAPI.GetAzureCloudName(context.TODO()) |
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 can see there is at least one other instance of context.TODO()
in this function, do we have a plan to address these todos?
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.
@errordeveloper -- I changed the signature of the Allocator
interface to pass a context to the Start
.
Marking as draft while reviews are addressed to remove from others' review queue. |
@ungureanuvladvictor would you be able to dust off this PR? |
hey folks -- sorry for the silence here, work schedule got busy. I'll get to it by EoW. |
0ac5dd6
to
22b8d6b
Compare
…ider Signed-off-by: Vlad Ungureanu <vladu@palantir.com>
Via the instance metadata service we can query in which Azure cloud the operator is running. Marked the "azure-cloud-name" flag as deprecated and to be removed in 1.11. Signed-off-by: Vlad Ungureanu <vladu@palantir.com>
22b8d6b
to
8a1ac80
Compare
test-me-please |
ci-aks |
ci-eks |
ci-gke |
test-1.21-4.9 |
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.
Thanks Vlad! Left 2 small nits.
@@ -19,6 +19,7 @@ import ( | |||
"fmt" | |||
|
|||
operatorMetrics "github.com/cilium/cilium/operator/metrics" | |||
"github.com/cilium/cilium/operator/option" |
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.
This package is already imported on the subsequent line.
@@ -48,10 +50,22 @@ func (*AllocatorAzure) Start(getterUpdater ipam.CiliumNodeGetterUpdater) (alloca | |||
|
|||
log.Info("Starting Azure IP allocator...") | |||
|
|||
var azureCloudName string |
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 think the following might be nicer:
azureCloudName := operatorOption.Config.AzureCloudName
if !viper.IsSet(operatorOption.AzureCloudName) {
// Call IMDS...
}
Via the instance metadata service we can query in which Azure cloud the
operator is running.
Signed-off-by: Vlad Ungureanu vladu@palantir.com