Annotations in the Service YAML file can be used to implement a wide variety of load balancing features. This section introduces common ELB configurations through annotations from three resource dimensions: ELB, listening, and backend server group.
Annotation Usage Instructions
The content of annotations is case sensitive.
The field format of annotations is service.beta.kubernetes.io/xxx
ELB
Typical ELB Operations
Determine the specification for the load balancer
apiVersion: v1 kind: Service metadata: annotations: service.beta.kubernetes.io/ctyun-loadbalancer-spec: "${load balancer specification ID}" name: nginx namespace: default spec: ports: - port: 443 protocol: TCP targetPort: 443 selector: name: nginx type: LoadBalancer |
Use an existing load balancer
apiVersion: v1 kind: Service metadata: annotations: service.beta.kubernetes.io/ctyun-loadbalancer-id: "${load balancer ID}" name: nginx namespace: default spec: ports: - port: 443 protocol: TCP targetPort: 443 selector: name: nginx type: LoadBalancer |
Common Annotations
Common ELB Annotations
Comments | Type | Description | Default Value | Supported CCM Versions |
service.beta.kubernetes.io/ctyun-loadbalancer-address-type | String | Create a public or private type of ELB with the value "internet" or "intranet". | intranet | v1.0.0 and above |
service.beta.kubernetes.io/ctyun-loadbalancer-id | String | Specify the ID of an existing load balancer instance. When the service is deleted, this ELB will not be deleted. | None | v1.0.0 and above |
service.beta.kubernetes.io/ctyun-loadbalancer-spec | String | Load Balancer Specification | None | v1.0.0 and above |
service.beta.kubernetes.io/ctyun-loadbalancer-resource-pack-id | String | The resource package ID used for activating the ELB | None | v1.0.0 and above |