- Function Overview
- Product Bulletin
- Service Overview
- Billing
- Getting Started
-
User Guide
- Clusters
- Workloads
- Network
- Storage
- O&M
- Namespaces
- ConfigMaps and Secrets
- Auto Scaling
- Add-ons
- Helm Chart
- Permissions
- Settings
- Best Practices
-
API Reference
- Before You Start
- API Overview
- Calling APIs
-
APIs
- Autopilot Cluster Management
- Add-on Management for Autopilot Clusters
-
Autopilot Cluster Upgrade
- Upgrading a Cluster
- Obtaining Cluster Upgrade Task Details
- Retrying a Cluster Upgrade Task
- Obtaining a List of Cluster Upgrade Task Details
- Performing a Pre-upgrade Check for a Cluster
- Obtaining Details About a Pre-upgrade Check Task of a Cluster
- Obtaining a List of Pre-upgrade Check Tasks of a Cluster
- Performing a Post-upgrade Check for a Cluster
- Backing Up a Cluster
- Obtaining a List of Cluster Backup Task Details
- Obtaining the Cluster Upgrade Information
- Obtaining a Cluster Upgrade Path
- Obtaining the Configuration of Cluster Upgrade Feature Gates
- Enabling the Cluster Upgrade Process Booting Task
- Obtaining a List of Upgrade Workflows
- Obtaining Details About a Specified Cluster Upgrade Booting Task
- Updating the Status of a Specified Cluster Upgrade Booting Task
- Quota Management for Autopilot Clusters
- Tag Management for Autopilot Clusters
-
Chart Management for Autopilot Clusters
- Uploading a Chart
- Obtaining a Chart List
- Obtaining a Release List
- Creating a Release
- Updating a Chart
- Deleting a Chart
- Updating a Release
- Obtaining a Chart
- Deleting a Release
- Obtaining a Release
- Downloading a Chart
- Obtaining Chart Values
- Obtaining Historical Records of a Release
- Obtaining the Quota of a User Chart
- Kubernetes APIs
- Permissions and Supported Actions
- Appendix
-
FAQs
- Billing
- Workloads
- Network Management
-
Storage
- Can PVs of the EVS Type in a CCE Autopilot Cluster Be Restored After They Are Deleted or Expire?
- What Can I Do If a Storage Volume Fails to Be Created?
- Can CCE Autopilot PVCs Detect Underlying Storage Faults?
- How Can I Delete the Underlying Storage If It Remains After a Dynamically Created PVC is Deleted?
- Permissions
- General Reference
Show all
Copied.
Accessing Public Networks from a Container
You can use NAT Gateway to enable the pods in a VPC to access public networks. NAT Gateway provides source network address translation (SNAT), which translates private IP addresses to an EIP bound to the gateway, providing secure and efficient access to the Internet. Figure 1 shows the SNAT architecture. SNAT allows the pods in a VPC to access the Internet without having an EIP bound. SNAT supports a large number of concurrent connections, which makes it suitable for applications that need to handle a large number of requests.
Procedure
To enable a container pod to access the Internet, perform the following steps:
- Assign an EIP.
- Log in to the management console.
- Click
in the upper left corner of the management console and select a region and a project.
- Click
at the upper left corner and choose Networking > Elastic IP in the expanded list.
- On the EIPs page, click Buy EIP.
- Configure the parameters as required.
NOTE:
Set Region to the region where container pods are located.
Figure 2 Buying an elastic IP address - Create a NAT gateway. For details, see Buying a Public NAT Gateway.
- Log in to the management console.
- Click
in the upper left corner of the management console and select a region and a project.
- Click
at the upper left corner and choose Networking > NAT Gateway in the expanded list.
- On the displayed page, click Buy Public NAT Gateway in the upper right corner.
- Configure the parameters as required.
NOTE:
Select the same VPC.
Figure 3 Buying a NAT gateway
- Configure an SNAT rule and bind the EIP to the subnet. For details, see Adding an SNAT Rule.
- Log in to the management console.
- Click
in the upper left corner of the management console and select a region and a project.
- Click
at the upper left corner and choose Networking > NAT Gateway in the expanded list.
- On the displayed page, click the name of the NAT gateway for which you want to add the SNAT rule.
- On the SNAT Rules tab, click Add SNAT Rule.
- Configure the parameters as required.
NOTE:
SNAT rules take effect by network segment. Set Subnet to the subnet where the pods are located.
If there are multiple network segments, you can create multiple SNAT rules or select a user-defined network segment as long as the network segment contains the subnet where the pods are located.
Figure 4 Adding an SNAT ruleAfter the SNAT rule is configured, workloads can access public networks from the container. Public networks can be pinged from the container.
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