Cluster-api-provider-azure: Support Azure client request to other Azure Clouds (eg. Sovereign clouds)

Created on 24 Mar 2020  路  23Comments  路  Source: kubernetes-sigs/cluster-api-provider-azure

/kind feature

Describe the solution you'd like
[A clear and concise description of what you want to happen.]
We use cluster api to create k8s cluster in China. But this project uses cloudapp.azure.com as a default DNS zone, and sends client request to management.azure.com for default.
Is it ok to add an option to support other datacenter?

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

https://docs.microsoft.com/en-us/azure/active-directory/develop/authentication-national-cloud

Environment:

  • cluster-api-provider-azure version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):
help wanted kinfeature

All 23 comments

Great idea!

@gaulzhw that's definitely something that should be on the roadmap, thanks for opening the issue. If you'd like to help and contribute this feature feel free to assign yourself!

/help

@CecileRobertMichon:
This request has been marked as needing help from a contributor.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

/help

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/test-infra repository.

n.b.: this must not be hardcoded to the existing Go SDK environments. Azure Stack is the obvious exception, but we should enable free form support for anything that can supply the endpoints at runtime (e.g., airgapped environments, gov't cloud).

We just hardcoded to support azure-cn. The project github.com/Azure/azure-sdk-for-go may be out of date about some client URI. We have no idea to support in an elegant manner.

See our commit on https://github.com/q8s-io/cluster-api-provider-azure/commit/6f529b25b0adb44c76d6fdd8bb63b5000f071755

Thanks for sharing @gaulzhw, this gives a good idea of what changes are required for anyone who wants to pick this up and implement a more generic solution.

@devigned, @CecileRobertMichon and I discussed this. These are the following points we've agreed on for implementation:

  • Cloud Instance selection should happen at the Controller level
  • Optional AZURE_ENVIRONMENT environment variable parsed by azure.EnvironmentFromName(string) in go-autorest enabling environment endpoints from file
  • All clients must be created using the endpoints from the AZURE_ENVIRONMENT

@devigned also brought up that if an ARM endpoint has been provided that you can look up the rest of the endpoints from there.

After looking through the code between cluster-api-provider-azure and go-autorest it seems that that functionality should live in go-autorest to replace the environments map from EnvironmentName to Environment.

Does that work for you @devigned?

Was this page helpful?
0 / 5 - 0 ratings