Huwei Cloud CCE Cluster Network Initialization Configuration
Support Overview
| Support | Conditions | |
|---|---|---|
| Service for LoadBalancer Type | Default Support | No additional deployment operations required. |
| Ingress | Default Support | Enable the Ingress Class feature as needed (after enabling this feature, you can manually select the Ingress class by creating an Ingress through the form page). No additional deployment operations required. |
Prerequisites
If you have created a CCE cluster, please connect to the CCE cluster (public cloud) ; if you haven’t created a CCE cluster, please create an Huawei Cloud CCE cluster .
Procedure
Ingress and LoadBalancer type Service can be created simultaneously or selected one by one based on the actual situation.
Create Ingress
There are two methods to create Ingress. It is recommended to use Method 1: Manually Selecting Ingress Class.
Note: Try to avoid creating two Ingress with the same Path.
(Recommended) Method 1: Manually Select Ingress Class
-
Go to Container Platform, in the left navigation pane, click Networking > Ingresses.
-
Click Create Ingress, and select CCE Ingress Class for Ingress Class.
-
Choose the Protocol, and by default, use the HTTP protocol. If you need to use the HTTPS protocol, please first create a certificate and select to use this certificate.
-
Switch to YAML, and according to the default Ingress Controller type, add the following annotations in the YAML file. For specific annotation descriptions, refer to Configuring Load Balancing Using Annotations .
Note: Replace the values in the following annotations with actual values.
Default Ingress Controller Type Annotation Shared (Auto-Creation) - kubernetes.io/elb.autocreate: ‘{“type”:“public”,“bandwidth_name”:"{random}",“bandwidth_chargemode”:“traffic”,“bandwidth_size”:5,“bandwidth_sharetype”:“PER”,“eip_type”:“5_bgp”}’
- kubernetes.io/elb.class: union
Shared (Reuse) - kubernetes.io/elb.class: union
- kubernetes.io/elb.id:
- kubernetes.io/elb.port: ‘80’
Dedicated (Auto-Creation) - kubernetes.io/elb.autocreate: ‘{“type”:“public”,“bandwidth_name”:"<bandwidth_name>",“bandwidth_chargemode”:“traffic”,“bandwidth_size”:5,“bandwidth_sharetype”:“PER”,“eip_type”:“5_bgp”,“available_zone”:["
"," "," "],“elb_virsubnet_ids”:[" "],“l7_flavor_name”:“L7_flavor.elb.s1.small”,“l4_flavor_name”:“L4_flavor.elb.s1.small”}’ - kubernetes.io/elb.class: performance
- kubernetes.io/elb.port: “80”
Dedicated (Reuse) - kubernetes.io/elb.class: performance
- kubernetes.io/elb.id:
- kubernetes.io/elb.port: “80”
-
Click Create, and after creation, you can access internal services through ELB.
Method 2: Use the Default Ingress Class
-
Create a YAML file for the Ingress Class. The YAML file content is as follows. For details, refer to Default Ingress Class .
apiVersion: networking.k8s.io/v1 kind: IngressClass metadata: annotations: ingressclass.kubernetes.io/is-default-class: "true" name: cce spec: controller: alauda/cce -
After creating the above file, save it and apply the file by executing the following command on the cluster where it is connected. Replace
<filename.yaml>with the actual YAML file name.kubectl apply -f <filename.yaml> -
Go to Container Platform, in the left navigation pane, click Networking > Ingresses.
-
Choose the Protocol, and by default, use the HTTP protocol. If you need to use the HTTPS protocol, please first create a certificate and select to use this certificate.
-
Click Create, and after creation, you can access internal services through ELB.
Create LoadBalancer Type Service
-
Go to Container Platform, in the left navigation pane, click Networking > Services.
-
Click Create Service, and select LoadBalancer for Type.
-
Expand annotitions, and fill in as needed annotations for LoadBalancer type Service .
-
Click Create.
Related Operations
Create Certificate
When using the HTTPS protocol, you need to save HTTPS certificate credentials in the form of a secret (TLS type) in advance.
-
Go to Container Platform, in the left navigation pane, click Configuration > Secrets.
-
Click Create Secret.
-
Select TLS type and import or fill in the Certificates and Private Key as needed.
-
Click Create.