Access ECS OpenAPI using the VPC endpoint on ECS #1179
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
#449 seems to want to enable VPC endpoint for the listed 19 regions, but ended up using public endpoint for them and use VPC endpoint for other regions. Now we are sure the listed 19 (actually 18) regions support VPC endpoint, and we have been using VPC endpoint for other regions for years without problem. So this change should be safe.
For the listed regions:
ecs-vpc.cn-north-2-gov-1.aliyuncs.com
is accessableNow VPC endpoint is available for all regions, we should use them by default so that we don't rely on Internet access.
We enable VPC endpoint with a new envvar ALIBABA_CLOUD_NETWORK_TYPE, to try to not breaking the users who deploy CSI on non-ECS env.
If ALIBABA_CLOUD_NETWORK_TYPE is set to:
vpc
: always useecs-vpc.<region-id>.aliyuncs.com
public
: always useecs.<region-id>.aliyuncs.com
ecs.<region-id>.aliyuncs.com
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
For internal mode, we always use localAPI endpoint, like
ecs-openapi-share.cn-beijing.aliyuncs.com
, queried fromlocation-readonly.aliyuncs.com
Some regions also can resolve public endpoint to VPC VIP. But this is not documented, not supported in all regions, and can be affected by the custom DNS config. So we should not rely on this.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: