Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Private Network Access

Updated on 2024-10-29 GMT+08:00
The following two methods are available for private network access:
  • Workload Access Through a Service: Use this method when workloads in a namespace need to access each other.
  • Workload Access Through a Private Network Load Balancer: Use this method when a workload need to access other cloud resources (such as ECSs) in the same VPC. You can also use this method when you want workloads in the same VPC but different namespaces to access each other. The workload can be accessed using Private domain name or Load balancer's IP address:Port over HTTP/HTTPS and TCP/UDP. If other resources are in a VPC different from the current workload, you can also create a VPC peering connection to enable communication between VPCs.

Pod is the smallest resource unit in the workload. Accessing a workload is to access the pods in the workload. Pods in a workload can be dynamically created and destroyed, for example, during capacity scaling or rolling upgrade. In this case, the pod addresses will change, which makes it inconvenient to access pods.

To solve this problem, CCI provides the CoreDNS add-on (used for internal domain name resolution). Pod changes are managed by workloads and are not visible to users.

A workload can be accessed using Service name:Workload access port, where the access port is mapped to the container port. As shown in the following figure, if the pod in the frontend needs to access a pod in the backend, it only needs to access nginx:8080.

Figure 1 Workload access through the Service

Setting Service-based Workload Access When Creating a Workload

To enable a workload to be accessed through Service name:Workload access port, configure the following parameters when creating the workload:

  • Service Name: Specify the Service, which will be used to manage pod access. For details, see Service.
  • CoreDNS: Enable this option if you want to use the CoreDNS add-on. The CoreDNS add-on resolves internal domain names of workloads. If you do not install this add-on, the workload cannot be accessed through Service name:Workload access port.
  • Workload Port Settings:
    • Protocol: Specify the protocol that will be used to access the workload. Select TCP or UDP.
    • Workload Access Port: Specify the port for accessing the workload.
    • Container Port: Specify the port on which the container listens. The workload access port will be mapped to the container port.

Setting Service-based Workload Access After a Workload Is Created

You can configure Service-based access settings after a workload is created. The settings have no impact on the workload status and take effect immediately.

  1. Log in to the CCI console. In the navigation pane on the left, choose Network Management > Services. On the page displayed, click Create Service.
  2. On the Create Service page, select ClusterIP for Access Type.
  3. Set intra-cluster access parameters.

    • Service Name: Specify the Service, which will be used to manage pod access.
    • Namespace: Select the namespace that the workload belongs to.
    • Workload: Select a workload that you want to add the Service for.
    • Port Settings:
      • Protocol: Specify the protocol that will be used to access the workload. Select TCP or UDP.
      • Access Port: Specify the port for accessing the workload.
      • Container Port: Specify the port on which the container listens. The workload access port will be mapped to the container port.

  4. Click Submit. The ClusterIP Service will be added for the workload.

Creating a Service Using kubectl

For details, see Service.

Workload Access Through a Private Network Load Balancer

If you want a workload to be accessed by other cloud resources or CCI workloads in other namespaces, bind a private network shared load balancer when you create the workload. In this way, the workload can be accessed over the private IP address of the load balancer.

When you configure access settings, select a private network load balancer and follow the description in Public Network Access to configure other parameters.

Figure 2 Setting ELB-based workload access when creating a workload

Setting Ingress-based Workload Access

You can configure ingress-based access settings after a workload is created. The settings have no impact on the workload status and take effect immediately.

  1. Log in to the CCI console. In the navigation pane on the left, choose Network Management > Ingresses. On the page displayed, click Create Ingress.
  2. Set ingress parameters.

    • Ingress Name: Enter a custom ingress name.
    • Namespace: Select the namespace to which you want to add the ingress.
    • Load Balancer: Specify a load balancer, which will automatically distribute Internet access traffic to multiple nodes running the workload.
    • External Port: Specify a port number that is open to the ELB service address.
    • External Protocol: HTTP and HTTPS are available. If you select HTTPS, choose a key certificate. For details about the certificate format, see Certificate and Private Key Format.
      NOTE:
      • The key certificate ingress-test-secret.yaml is required only if you have selected HTTPS. For details on how to create a key, see Secrets.
      • If there is already an HTTPS ingress for the chosen port on the load balancer, the certificate of the new HTTPS ingress must be the same as the certificate of the existing ingress. This means that a listener has only one certificate. If two certificates, each with a different ingress, are added to the same listener of the same load balancer, only the certificate that was added first will take effect for the load balancer.
    • Ingress Rule
      • Domain Name: (Optional) Specify the domain name that will be used for access. Ensure that the domain name can be mapped to the IP address of the selected load balancer.
      • Rule Matching: Currently, only Prefix match is supported.

        Prefix match: Specify the prefix to be matched. If the mapping URL is /healthz, the URL that meets the prefix can be accessed. For example, /healthz/v1 and /healthz/v2.

      • URL: Specify the access path to be registered.
      • Service Name: Select the Service whose ingress you want to add.
      • Service Port: Specify the port on which the container in the container image listens.

  3. Click Submit.

    After the ingress is created, it is displayed in the ingress list.

Updating a Service

After you add a Service, you can update the port configuration of the Service.

  1. Log in to the CCI console. In the navigation pane on the left, choose Network Management > Services. On the Services page, select the corresponding namespace. In the row that contains the Service, click Update.
  2. Update intra-cluster access parameters.

    • Namespace: Specify the namespace that the workload belongs to. The value is inherited from the workload creation page and cannot be changed.
    • Workload: Select the workload that you want to add a Service for. The value is inherited from the workload creation page and cannot be changed.
    • Service Name: Specify the Service, which will be used to manage pod access. The value is inherited from the workload creation page and cannot be changed.
    • Port Settings:
      • Protocol: Select a protocol used by the Service.
      • Container Port: Specify the port on which the workload listens. The Nginx workload listens on port 80.
      • Access Port: Specify the port mapped to the container port at the cluster-internal IP address. The workload can be accessed at <cluster-internal IP address>:<access port>. The port number range is 1–65535.

  3. Click Submit. The Service will be updated for the workload.

Updating an Ingress

After adding an ingress, you can update its port, domain name, and route configuration.

  1. Log in to the CCI console. In the navigation pane on the left, choose Network Management > Ingresses and then select the corresponding namespace. In the row that contains the ingress to be updated, click Update.
  2. On the Update Ingress page, set the following parameters:

    • External Port: Specify a port number that is open to the ELB service address.
    • Ingress Rule: You can click Add Ingress Rule to add a rule.
      • Domain Name: (Optional) Specify the domain name that will be used for access. You need to have registered a domain name. Ensure that the domain name can be mapped to the IP address of the selected load balancer. If you have configured a domain name rule, the domain name must always be used for access.
      • Rule Matching: Currently, only Prefix match is supported.

        Prefix match: Specify the prefix to be matched. If the mapping URL is /healthz, the URL that meets the prefix can be accessed. For example, /healthz/v1 and /healthz/v2.

      • URL: Specify the access path to be registered, for example, /healthz.
      • Service Name: Select the Service whose ingress you want to update.
      • Service Port: Specify the port on which the container in the container image listens.

  3. Click Submit. The ingress will be updated for the workload.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback