57 KiB
- original_name
cce_10_0385.html
Service Annotations
CCE allows you to add annotations to a YAML file to realize some advanced Service functions. The following table describes the annotations you can add.
The annotations of a Service are the parameters that need to be specified for connecting to a load balancer. For details about how to use the annotations, see Using kubectl to Create a Service (Automatically Creating a Load Balancer) <cce_10_0014__section12168131904611>
.
Parameter | Type | Description | Default Value on the Console | Supported Cluster Version |
---|---|---|---|---|
kubernetes.io/elb.class | String | Select a proper load balancer type. The value can be:
|
performance | v1.9 or later |
kubernetes.io/elb.id | String | ID of a load balancer. The value can contain 1 to 100 characters. Mandatory when an existing load balancer is to be associated. How to obtain: On the management console, click Service List, and choose Networking > Elastic Load Balance. Click the name of the target load balancer. On the Summary tab page, find and copy the ID. |
None | v1.9 or later |
kubernetes.io/elb.subnet-id | String | ID of the subnet where the cluster is located. The value can contain 1 to 100 characters.
|
None | Mandatory for versions earlier than v1.11.7-r0 Discarded in versions later than v1.11.7-r0 |
kubernetes.io/elb.autocreate | Table 2 <cce_10_0385__table148341447193017> |
Whether to automatically create a load balancer associated with the Service. Example:
|
None | v1.9 or later |
kubernetes.io/elb.lb-algorithm | String | Specifies the load balancing algorithm of the backend server group. Value:
When the value is SOURCE_IP, the weights of backend servers in the server group are invalid. |
ROUND_ROBIN | v1.9 or later |
kubernetes.io/elb.health-check-flag | String | Whether to enable the ELB health check.
If this parameter is enabled, the |
off | v1.9 or later |
kubernetes.io/elb.health-check-option | Table 3 <cce_10_0385__table19192143412319> |
ELB health check configuration items. | None | v1.9 or later |
kubernetes.io/elb.session-affinity-mode | String | Listeners ensure session stickiness based on IP addresses. Requests from the same IP address will be forwarded to the same backend server.
|
None | v1.9 or later |
kubernetes.io/elb.session-affinity-option | Table 4 <cce_10_0385__table3340195463412> |
Sticky session timeout. | None | v1.9 or later |
kubernetes.io/hws-hostNetwork | Boolean | Whether the workload Services use the host network. Setting this parameter to true will enable the load balancer to forward requests to the host network. The value is true or false. The default value is false, indicating that the host network is not used. |
None | v1.9 or later |
Parameter | Mandatory | Type | Description |
---|---|---|---|
name | No | String | Name of the load balancer that is automatically created. Value range: 1 to 64 characters, including lowercase letters, digits, and underscores (_). The value must start with a lowercase letter and end with a lowercase letter or digit. Default: cce-lb+service.UID |
type | No | String | Network type of the load balancer.
Default: inner |
bandwidth_name | Yes for public network load balancers | String | Bandwidth name. The default value is cce-bandwidth-**. Value range: 1 to 64 characters, including lowercase letters, digits, and underscores (_). The value must start with a lowercase letter and end with a lowercase letter or digit. |
bandwidth_chargemode | No | String | Bandwidth mode. |
bandwidth_size | Yes for public network load balancers | Integer | Bandwidth size. The default value is 1 to 2000 Mbit/s. Set this parameter based on the bandwidth range allowed in your region. |
bandwidth_sharetype | Yes for public network load balancers | String | Bandwidth sharing mode.
|
eip_type | Yes for public network load balancers | String | EIP type.
|
available_zone | Yes | Array of strings | AZ where the load balancer is located. This parameter is available only for dedicated load balancers. |
l4_flavor_name | Yes | String | Flavor name of the layer-4 load balancer. This parameter is available only for dedicated load balancers. |
l7_flavor_name | No | String | Flavor name of the layer-7 load balancer. This parameter is available only for dedicated load balancers. |
elb_virsubnet_ids | No | Array of strings | Subnet where the backend server of the load balancer is located. If this parameter is left blank, the default cluster subnet is used. Load balancers occupy different number of subnet IP addresses based on their specifications. Therefore, you are not advised to use the subnet CIDR blocks of other resources (such as clusters and nodes) as the load balancer CIDR block. This parameter is available only for dedicated load balancers. Example:
|
Parameter | Mandatory | Type | Description |
---|---|---|---|
delay | No | String | Initial waiting time (in seconds) for starting the health check. Value range: 1 to 50. Default value: 5 |
timeout | No | String | Health check timeout, in seconds. Value range: 1 to 50. Default value: 10 |
max_retries | No | String | Maximum number of health check retries. Value range: 1 to 10. Default value: 3 |
protocol | No | String | Health check protocol. Default value: protocol of the associated Service Value options: TCP, UDP, or HTTP |
path | No | String | Health check URL. This parameter needs to be configured when the protocol is HTTP. Default value: / The value can contain 1 to 10,000 characters. |
Parameter | Mandatory | Type | Description |
---|---|---|---|
persistence_timeout | Yes | String | Sticky session timeout, in minutes. This parameter is valid only when elb.session-affinity-mode is set to SOURCE_IP. Value range: 1 to 60. Default value: 60 |