-
Notifications
You must be signed in to change notification settings - Fork 447
Azure Stack Support #5532
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?
Azure Stack Support #5532
Conversation
Welcome @patrickdillon! |
Hi @patrickdillon. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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-sigs/prow repository. |
/ok-to-test |
6e775e8
to
4605c9e
Compare
Don't think anybody has looked at this yet so I went ahead and force pushed to rebase, and fixed the unit test failure (due to newly wrappd error). |
/assign @willie-yao @jackfrancis |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5532 +/- ##
==========================================
- Coverage 52.86% 52.81% -0.05%
==========================================
Files 272 272
Lines 29474 29520 +46
==========================================
+ Hits 15582 15592 +10
- Misses 13080 13113 +33
- Partials 812 815 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 for your work on this! I just had a few comments that are mostly nitpicky and addressing a need for unit testing. Also, I think adding some documentation relating to this feature would be great!
api/v1beta1/types_class.go
Outdated
@@ -48,6 +48,7 @@ type AzureClusterClassSpec struct { | |||
// - GermanCloud: "AzureGermanCloud" | |||
// - PublicCloud: "AzurePublicCloud" | |||
// - USGovernmentCloud: "AzureUSGovernmentCloud" | |||
// - StackCloud: "HybridEnvironment" |
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 this be renamed to AzureStackCloud to keep it consistent with the other clouds, or is it required to be called "HybridCloud"?
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.
"HybridCloud" is what is returned by the azure autorest package, but I believe it should be possible to allow users to set "AzureStackCloud" in the cluster spec, but we accept "HybridCloud" internally within the code.
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 have updated this to AzureStack. This means when users provide their environment json file, they will need to set the name to AzureStack.
@@ -186,6 +193,7 @@ type AzureManagedControlPlaneClassSpec struct { | |||
// - PublicCloud: "AzurePublicCloud" | |||
// - USGovernmentCloud: "AzureUSGovernmentCloud" | |||
// | |||
// |
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.
Is it intended to add AzureStack to the comment here as well?
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 intentionally did not add it here, because I did not think there would be support for Azure Stack with managed control planes. Happy to discuss more, but I don't have a lot of background knowledge on this.
azure/defaults.go
Outdated
case StackCloudName: | ||
cloudEnv, err := azure.EnvironmentFromURL(armEndpoint) | ||
if err != nil { | ||
return nil, fmt.Errorf("unable to get Azure Stack cloud environment: %w", err) | ||
} | ||
opts.APIVersion = StackAPIVersionProfile | ||
opts.Cloud = cloud.Configuration{ | ||
ActiveDirectoryAuthorityHost: cloudEnv.ActiveDirectoryEndpoint, | ||
Services: map[cloud.ServiceName]cloud.ServiceConfiguration{ | ||
cloud.ResourceManager: { | ||
Audience: cloudEnv.TokenAudience, | ||
Endpoint: cloudEnv.ResourceManagerEndpoint, | ||
}, | ||
}, | ||
} |
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.
Can you add a unit test case for this in TestARMClientOptions
?
if strings.EqualFold(cloudEnvironment, azure.StackCloudName) { | ||
return ptr.To(int32(2)), nil | ||
} |
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.
Can you add a unit test case for when cloud environment is Azure Stack to TestParameters
in spec_test.go
?
} | ||
if err != nil { | ||
return nil, err | ||
} |
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 looks like a good improvement, but is it related to Azure Stack support? What problem is it trying to solve?
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.
Yes, azure stack throws a 400 error that says the force flag is not supported... Should I add a comment?
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.
oops I think I forgot to add the comment. This is specified in the commit message, but I will add a code comment in my next pass.
@willie-yao thanks for the in-depth review and feedback. I am just back today from vacation, & will incorporate the changes ASAP. |
Hey @patrickdillon , how is this PR coming along ? How can we help you push this forward ? |
@nawazkh thanks for checking in. I've just started working on the feedback, and should have plenty of time tomorrow to look into it. |
ok finally figured it out was just using the wrong aso crds 🤦 |
No worries! Also looks like you need a rebase to fix the CI |
Adds AzureStack as a valid cloud environment. The value "AzureStackCloud" corresponds to the name expected by the azure autorest package, which will expect a environment configuration file to be found at a path specified by the environment variable AZURE_ENVIRONMENT_FILEPATH. See: https://github.com/Azure/go-autorest/blob/main/autorest/azure/environments.go#L300-L302
Sets ARM Client Options when using the Azure Stack environment. Sets the APIVersion to a hybrid cloud profile to ensure compatibility with hybrid environments.
Azure Stack Hub does not support private dns zones, so skip them.
The Resource SKU API for availability sets may not be available in an Azure Stack environment. The cache is used to determine the fault domain count. For Azure Stack, we can default to 2. Future work could potentially set this programatically or expose the fault domain count in the API.
The tag service using the V2 SDK is not available in azure stack. Skip tag reconciliation in Azure Stack environments.
The standard 2020-06-01 API Version is not supported for disk operations in Azure Stack, so change to the compatible 2018-06-01 profile.
Azure Stack returns a 400 error when trying to delete a VM with the force flag and the error message suggests retrying without the flag.
Trying to get tags at scope in Azure Stack results in an error, so just assume that IPs are managed.
[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 have now updated and tested the PR to get the environment using |
/retest |
@patrickdillon: The following tests failed, say
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-sigs/prow repository. I understand the commands that are listed here. |
@patrickdillon Is this ready for another round of review? Let me know when you're able to get to the tests! You might also need to rebase as there were quite a few things merged lately. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR adds infrastructure provisioning support on Azure Stack. Currently Azure Stack is completely unsupported, but with the changes in this PR I was able to fully provision an OpenShift cluster.
This PR adds a new field
armEndpoint
to the cluster spec, and extendsazureEnvironment
to accept a new value,HybridEnvironment
, to indicate installation to Azure Stack:Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
#5201
Special notes for your reviewer:
This is a large PR, which I know is not preferred, but I have laid out the commits logically and with messages so they should be easy to follow in that manner. I would be happy to break it up into smaller PRs if that would help.
Furthermore, there were some significant challenges in this implementation. Particularly: I could not get tag reconciliation using the tagging service to work: an inscrutable 500 error was returned. Therefore, 88fc6ea skips adding the tagging service for azure stack. Perhaps I should do the same for MachinePool?
I was pretty satisfied with how other challenges were addressed, but definitely happy to discuss them. Thanks!
TODOs:
Release note: