If your pod needs to access the Internet, you must configure a public IP address for the pod. This topic describes how to configure a public IP address for a pod.
You can configure a pod to access the Internet through an elastic IP address (EIP) or an Internet NAT gateway. The following section describes the differences between the two methods:
Use an EIP: Container Service for Kubernetes (ACK) associates an EIP with the IP address of the pod.
Use an Internet NAT gateway: You must configure SNAT entries for the vSwitch that is used by the pod. A vSwitch is used by a group of pods. After you configure SNAT entries for a vSwitch, the pods that use the vSwitch can access the Internet. For more information about how to configure SNAT entries for a vSwitch, see Create and manage SNAT entries.
The following section describes the operations required by the two methods:
Use an EIP: You can use this method to configure a public IP address for a single pod. For more information, see Associate an exclusive EIP with a pod.
Use an Internet NAT gateway: You can use this method to configure a public IP address for a group of pods. For more information, see Configure network settings for individual nodes in a cluster that uses Terway and Configure a static IP address, a separate vSwitch, and a separate security group for each pod.