PrivateLink connects an ASM control plane to a data plane ACK cluster that resides in the same region but in a different VPC. ASM provides the ASMPvlConfig custom resource definition (CRD) to simplify the network configuration that this cross-VPC connection requires.
Prerequisites
An ASM instance is created. For more information, see Create an ASM instance.
An ACK cluster is created in the same region as the ASM instance but in a different VPC. For more information, see Create a cluster.
The PrivateLink service is activated. For more information, see Get started with PrivateLink.
To use PrivateLink for cross-VPC connectivity, the vSwitch that you specify for the ASM instance and the vSwitch that you specify for the ACK cluster must be in the same availability zone.
Procedure
Add the ACK cluster to the ASM instance. For more information, see Add a cluster to an ASM instance.
After the cluster is added, it is in the Connecting state. Complete the following steps to establish connectivity.
Create a file named
asmpvlconfig.yamlwith the following content.apiVersion: istio.alibabacloud.com/v1beta1 kind: ASMPvlConfig metadata: name: default spec: ackVpcEndpoint: - clusterId: cab9ace222210457a83f09fcd42e9**** vSwitches: - vSwitchId: vsw-bp1jsgsanpvxpj32yai50 zoneId: cn-hangzhou-j asmVpcEndpoint: vSwitches: - vSwitchId: vsw-bp1l5hini55sstnwd2skf zoneId: cn-hangzhou-iThe following table describes the fields.
Parameter Sub-parameter Description metadatanameThe name of the resource object. The value of namemust bedefault. Any other name is invalid.specackVpcEndpointAn array that contains the following sub-parameters for the VPC of the ACK cluster. specackVpcEndpoint.clusterIdThe ID of the ACK cluster that is added to the ASM instance. Example: cab9ace222210457a83f09fcd42e9****.specackVpcEndpoint.vSwitchesAn array of available vSwitch configurations in the VPC of the ACK cluster. specackVpcEndpoint.vSwitches.vSwitchIdThe ID of a specific vSwitch. Example: vsw-bp1jsgsanpvxpj32yai50.specackVpcEndpoint.vSwitches.zoneIdThe ID of the availability zone for the vSwitch. Example: cn-hangzhou-jis an availability zone in the China (Hangzhou) region. For the availability zone requirement, see Prerequisites.specasmVpcEndpointContains the vSwitch configurations for the VPC of the ASM instance. specasmVpcEndpoint.vSwitchesAn array of vSwitch configurations that contains the following sub-parameters. specasmVpcEndpoint.vSwitches.vSwitchIdThe ID of a specific vSwitch in the VPC of the ASM instance. specasmVpcEndpoint.vSwitches.zoneIdThe ID of the availability zone where the vSwitch of the ASM instance is located. For the availability zone requirement, see Prerequisites. Using the kubeconfig of the ASM instance, run the following command to apply the ASMPvlConfig resource.
kubectl apply -f asmpvlconfig.yamlWait a few minutes, and then run the following command to check the status of the ASMPvlConfig resource object.
kubectl get asmpvlconfig default -o yamlExpected output:
apiVersion: istio.alibabacloud.com/v1beta1 kind: ASMPvlConfig metadata: name: default spec: ackVpcEndpoint: - clusterId: cab9ace222210457a83f09fcd42**** vSwitches: - vSwitchId: vsw-bp1jsgsanpvxpj32yai50 zoneId: cn-hangzhou-j asmVpcEndpoint: vSwitches: - vSwitchId: vsw-bp1l5hini55sstnwd2skf zoneId: cn-hangzhou-i status: clusters: - clusterId: cab9ace222210457a83f09fcd42**** pvlEndpoint: connectionStatus: Connected domainName: ep-bp1i06bad79eb60c60cc.epsrv-bp1gqb8g1b8d7uactd.cn-hangzhou.privatelink.aliyuncs.com id: ep-bp1i06bad79eb60c60 status: Active pvlEndpointService: id: epsrv-bp1gqb8g1b8d7uactd name: com.aliyuncs.privatelink.cn-hangzhou.epsrv-bp1gqb8g1b8d7uactd status: Active pilot: clusters: - clusterId: cab9ace222210457a83f09fcd42**** pvlEndpoint: connectionStatus: Connected domainName: ep-bp1i52311b91a5a25e.epsrv-bp1cl4qwzkf747ug6tmy.cn-hangzhou.privatelink.aliyuncs.com id: ep-bp1i52311b91a5a25e status: Active pvlEndpointService: id: epsrv-bp1cl4qwzkf747ug6t name: com.aliyuncs.privatelink.cn-hangzhou.epsrv-bp1cl4qwzkf747ug6tmy status: Active status: AvailableA
statussection is added to the output. The following table describes its fields.Parameter Description clustersThe list of status information about the ACK clusters. clusters.clusterIdThe unique ID of the ACK cluster. clusters.pvlEndpointDetails about a specific PrivateLink endpoint. clusters.pvlEndpoint.connectionStatusThe status of the PrivateLink connection that the ASM instance uses. clusters.pvlEndpoint.domainNameThe domain name of the PrivateLink endpoint that the ASM instance uses. clusters.pvlEndpoint.idThe unique ID of the PrivateLink endpoint that the ASM instance uses. clusters.pvlEndpoint.statusThe status of the PrivateLink endpoint that the ASM instance uses. clusters.pvlEndpointServiceInformation about the PrivateLink endpoint service resource. clusters.pvlEndpointService.idThe unique ID of the PrivateLink endpoint service for the API server SLB instance of the ACK cluster. clusters.pvlEndpointService.nameThe name of the PrivateLink endpoint service for the API server SLB instance of the ACK cluster. clusters.pvlEndpointService.statusThe status of the PrivateLink endpoint service for the API server SLB instance of the ACK cluster. pilotThe list of status information about the managed service of the ASM control plane. pilot.clustersThe list of ACK cluster statuses. pilot.clusters.clusterIdThe unique ID of the ACK cluster. pilot.clusters.pvlEndpointDetails about a specific PrivateLink endpoint. pilot.clusters.pvlEndpoint.connectionStatusThe status of the PrivateLink connection that the ACK cluster uses. pilot.clusters.pvlEndpoint.domainNameThe domain name of the PrivateLink endpoint that the ACK cluster uses. pilot.clusters.pvlEndpoint.idThe unique ID of the PrivateLink endpoint that the ACK cluster uses. pilot.clusters.pvlEndpoint.statusThe status of the PrivateLink endpoint that the ACK cluster uses. pilot.pvlEndpointServiceInformation about the PrivateLink endpoint service resource. pilot.pvlEndpointService.idThe unique ID of the PrivateLink endpoint service for the Pilot SLB instance of the ASM instance. pilot.pvlEndpointService.nameThe name of the PrivateLink endpoint service for the Pilot SLB instance of the ASM instance. pilot.pvlEndpointService.statusThe status of the PrivateLink endpoint service for the Pilot SLB instance of the ASM instance. statusThe overall availability status. Availableindicates that the connectivity configuration is complete. Any other value indicates a failure.Check the status of the endpoint service and the endpoint in the PrivateLink console.
Log on to the PrivateLink console. In the left-side navigation pane, click Endpoint Service.
In the top navigation bar, select the region in which the endpoint service resides.
On the Endpoint Service page, click the instance ID of the target endpoint service to view its details.
In the left-side navigation pane, click Endpoints, and then click the instance ID of the target endpoint to view its details.
In the output of Step 4, find the
pvlEndpoint.domainNamevalue that is reported underclustersfor theclusterIdof the ACK cluster. Add this value to the Subject Alternative Name (SAN) field of the custom API server certificate of that ACK cluster. An example of this value isep-bp1i06bad79eb60c60cc.epsrv-bp1gqb8g1b8d7uactd.cn-hangzhou.privatelink.aliyuncs.com. For more information, see Customize the SAN of the API server certificate for an ACK cluster.Check the status of the ACK cluster.
If the cluster is in the Running state, cross-VPC connectivity over PrivateLink is established.