Help Center> Cloud Container Engine> FAQ> Networking> Network Configuration> How Do I Set the Port When Configuring the Workload Access Mode on CCE?

How Do I Set the Port When Configuring the Workload Access Mode on CCE?

CCE supports both internal and external access.

When setting the workload access mode, you need to set two ports: Container Port and Access Port.

Container Port indicates the listening port of a workload in the container. The port number varies according to the service type and is usually specified in a container image.

Access Port is specified based on the access type.

  • For internal access, the access type can be either Cluster virtual IP address or Node private IP address.
    Table 1 Internal access type description

    Internal Access Type

    Description

    Guide

    Cluster virtual IP address

    Used for mutual access between workloads in a cluster. For example, if a backend workload needs to communicate with a frontend workload, use this access type.

    When this access type is selected, a cluster IP address is automatically allocated.

    Access port: When a workload in a container is released as a service, the access port is the service port number. The value is an integer ranging from 1 to 65535. Workloads access each other through cluster IP:access port.

    Node private IP address

    A workload can be accessed through node IP:access port. If an elastic IP address is bound to the node, workloads on the node can be accessed from external networks.

    Access port: Port (on the node) to which a container is mapped. When the configuration is complete, the system enables a real port on all nodes in the project where the user is located. A workload can be accessed through node IP:access port.

    If there are no special requirements, select Automatically generated so that the system automatically assigns an access port. If you select Specified port, enter an integer ranging from 30000 to 32767 and ensure that the value is unique in the cluster.

  • For external access, the access type can be either EIP or ELB.
    Table 2 External access type description

    External Access Type

    Description

    Guide

    EIP

    Elastic IP address bound to a node. A workload can be accessed through elastic node IP:node port. The workload can be accessed from the Internet.

    Access port: Port (on the node) to which a container is mapped. When the configuration is complete, the system enables a real port on all nodes in the project where the user is located. A workload can be accessed through node IP:access port.

    If there are no special requirements, select Automatically generated so that the system automatically assigns an access port. If you select Specified port, enter an integer ranging from 30000 to 32767 and ensure that the value is unique in the cluster.

    ELB

    ELB automatically distributes access traffic to multiple nodes to balance their service load. It supports higher levels of fault tolerance for workloads and expands workload service capabilities.

    You need to create an ELB instance in advance and select ELB as the CCE access type.

    Access port: external port registered on the ELB. The virtual IP address and service port of the ELB are used for external access.