Accessing an SWR Enterprise Edition Instance Across Regions over the Private Network
Scenario
In SWR Enterprise Edition, if you need to push or pull images across regions, the VPC in the source region and the VPC in the region of the target SWR Enterprise Edition instance must be able to communicate with each other. You can take the following steps to enable mutual communication between the two VPCs:
- Configure Cloud Connect to enable network communication across regions.
- Obtain the required information for network connectivity.
- Configure a VPC endpoint to access OBS.
- Configure the IP address ranges in Cloud Connect for forwarding OBS requests.
- Configure private DNS resolution to access the target SWR Enterprise Edition instance.
- Verify that images can be downloaded across regions.
After completing these steps, you can push images to or pull images from the target SWR Enterprise Edition instance.

The following uses the resources of the same tenant to describe how to access an SWR Enterprise Edition instance in the CN South-Guangzhou region from an ECS in the CN East-Shanghai1 region. The environment information is as follows:
- vpc-10
- Region: CN East-Shanghai1
- IPv4 CIDR block: 10.0.0.0/8
- IP address of ECS 1: 10.0.0.10 (ECS 1 is used to verify the image upload and download.)
- vpc-default
- Region: CN South-Guangzhou
- IPv4 CIDR block: 192.168.0.0/16
- IP address of ECS 2: 192.168.0.18 (ECS 2 is used to obtain the IP address mapped to the OBS domain name.)
- Access IP address of the SWR Enterprise Edition instance: 192.168.0.17
Constraints
Docker or containerd has been installed on ECS 1.
Procedure
- Configure cross-region network connectivity.
Enable network connectivity between vpc-10 in CN East-Shanghai1 and vpc-default in CN South-Guangzhou using Cloud Connect. For details, see Using a Cloud Connection to Connect VPCs in the Same Account But Different Regions.
- Obtain the domain name, OBS bucket name, and IP address of the target instance.
- Access the SWR console and switch to the CN South-Guangzhou region.
- In the navigation pane, choose Enterprise Edition. On the Repositories page, click the name of the target repository to go to the repository details page.
- On the Dashboard page, obtain the access address and OBS bucket name.

- In the navigation pane, choose Access > Access Control > Private Network Access. On the displayed page, locate the row that contains vpc-default in the VPC column, and record the value in the IP column.
- Obtain the IP address of the OBS bucket in vpc-default.
Run the ping command to obtain the IP address of the OBS domain name and record it. Ping the OBS domain name for several times to obtain multiple IP addresses.
Table 1 Information about the target instance SWR Enterprise Edition Instance ID
Bucket Name
Domain Name (IP address) of SWR Enterprise Edition Instance
OBS Domain Name (IP Address)
${instance-id}
swr-ee-${instance-id}-registry
xxx.swr-pro.myhuaweicloud.com (192.168.0.17)
swr-ee-${instance-id}-registry.obs.${region-id}.myhuaweicloud.com
(100.*.*.6, 100.*.*.7)
- Configure a VPC endpoint for accessing OBS.
- Access the management console.
- Click
in the upper left corner and select the CN South-Guangzhou region. - Click
in the upper left corner and choose Networking > VPC Endpoint. - On the VPC Endpoint console, click Buy VPC Endpoint. Set Service Category to Cloud services, and select com.myhuaweicloud.{region_id}.swr. If this service is not found, select Find a service by name for Service Category. Configure other parameters as needed.
- VPC Endpoint Service Name: Based on the OBS bucket name of the target instance, submit a service ticket or contact OBS O&M personnel to obtain the name of the OBS VPC endpoint service of the gateway type. Enter the OBS endpoint service name and click Verify.
- VPC: Select vpc-default.
- Route Table: Use the default route table of vpc-default.
- Configure the IP address ranges in Cloud Connect for forwarding OBS requests.
- In the route table of vpc-default, view the routes for accessing OBS through the VPC endpoint.
On the VPC Endpoint console, select the CN South-Guangzhou region. Then choose Virtual Private Cloud > Route Tables. Locate the row that contains the default route table rtb-vpc-default and click the name. On the displayed page, locate the route whose next hop type is VPC endpoint.
- Click the number in the IP Addresses column to view all IP address ranges that can access OBS. Record the values in the Destination column.
- On the management console, click
in the upper left corner and select the CN East-Shanghai1 region. Click
in the upper left corner and choose Networking > Cloud Connect. Click the name of the cloud connection created in 1. On the Network Instances tab, locate vpc-default and click Modify VPC CIDR Block.
- In the Other CIDR Block area, add the IP address ranges obtained in 4.b.
- In the route table of vpc-default, view the routes for accessing OBS through the VPC endpoint.
- In the CN East-Shanghai1 region, configure private DNS resolution to access the target SWR Enterprise Edition instance and OBS domain name from vpc-10.
- Go to the Private Zones page.
- Click
in the upper left corner and select the CN East-Shanghai1 region. - In the upper right corner of the page, click Create Private Zone.
- Configure the private domain name used to access the target SWR Enterprise Edition instance.
- Enter the domain name of the target SWR Enterprise Edition instance and configure other parameters. For details, see Creating a Private Zone.
Domain Name: xxx.swr-pro.myhuaweicloud.com
Region: CN East-Shanghai1
VPC: vpc-10
Locate the created private zone, click Manage Record Sets in the Operation column, and click Add Record Set to add the IP address of the target instance. In this example, the IP address is 192.168.0.17.
- Repeat 5.d and 5.e to create a private zone for the OBS domain name.
Domain Name: swr-ee-${instance-id}-registry.obs.${region-id}.myhuaweicloud.com
Region: CN East-Shanghai1
VPC: vpc-10
Locate the created private zone, click Manage Record Sets in the Operation column, and click Add Record Set to add the IP addresses of OBS. In this example, the IP addresses are 100.*.*.6 and 100.*.*.7.
- Log in to ECS 1 in CN East-Shanghai1 and verify that the image in the image repository in CN South-Guangzhou can be downloaded.

Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot