Configure for an Application Load Balancer
On the [Ingress for an Application Load Balancer] page, we have shown you how to install the Ingress Controller and create ingress via the Ingress Yaml file. The following are detailed meanings of the information you can set for an Ingress
Annotations
Use the annotations below when creating ingress to customize the Load Balancer to suit your needs:
Annotations | Required/Not required | Meaning |
vks.vngcloud.vn/load-balancer-id | Optional |
Attention: If your ALB has:
then when creating Ingress an error will occur. At this point, you need to edit valid listener information on the vLB system and recreate ingress. |
vks.vngcloud.vn/load-balancer-name | Optional |
|
vks.vngcloud.vn/package-id | Optional |
|
vks.vngcloud.vn/tags | Optional |
|
vks.vngcloud.vn/scheme | Optional |
|
vks.vngcloud.vn/security-groups | Optional |
|
vks.vngcloud.vn/inbound-cidrs | Optional |
|
vks.vngcloud.vn/healthy-threshold-count | Optional |
|
vks.vngcloud.vn/unhealthy-threshold-count | Optional |
|
vks.vngcloud.vn/healthcheck-interval-seconds | Optional |
|
vks.vngcloud.vn/healthcheck-timeout-seconds | Optional |
|
vks.vngcloud.vn/healthcheck-protocol | Optional |
|
vks.vngcloud.vn/healthcheck-http-method | Optional |
|
vks.vngcloud.vn/healthcheck-path | Optional |
|
vks.vngcloud.vn/healthcheck-http-version | Optional |
|
vks.vngcloud.vn/healthcheck-http-domain-name | Optional |
|
vks.vngcloud.vn/healthcheck-port | Optional |
|
vks.vngcloud.vn/success-codes | Optional |
|
vks.vngcloud.vn/idle-timeout-client | Optional |
|
vks.vngcloud.vn/idle-timeout-member | Optional |
|
vks.vngcloud.vn/idle-timeout-connection | Optional |
|
vks.vngcloud.vn/pool-algorithm | Optional |
|
vks.vngcloud.vn/enable-sticky-session | Optional |
|
vks.vngcloud.vn/enable-tls-encryption | Optional |
|
vks.vngcloud.vn/target-node-labels | Optional |
|
vks.vngcloud.vn/certificate-ids | Optional |
|
IngressClassName
The Ingress installed by the VNGCloud Ingress Controller will have the information IngressClassName = "vngcloud". You may not change this information.
DefaultBackend
An Ingress without any rules will send all traffic to a single default service default backend, or if no host and path match the HTTP request in the Ingress Yaml file, traffic will be routed to the service default backend. For example below, we are configuring the default if the request does not satisfy any rule in the Ingress yaml file, it will go to service name: example-svc-1 with port number 8080
TLS
You can secure Ingress by specifying a Secret that contains the TLS key and certificate. Currently Ingress only supports TLS port 443 and is the termination point for TLS (TLS termination). TLS Secret must contain fields with key names tls.crt and tls.key, which are the certificate and private key to use for TLS. Specifically, you need to specify:
Host: the specified hosts will use the cert.
SecretName: secret name containing cert.
Path types
Each path in Ingress has a corresponding pathType. There are three supported pathTypes:
Exact: Matches the URL path with absolute precision and is case sensitive.
Prefix: Matches based on the URL path prefix separated by /. Matching is case-sensitive and is performed on each element of the URL path. A component of the main URL path is a label separated by a / in the URL path (This means that the URL path can consist of multiple levels separated by /, each string is between two main / marks). is a label, each label is a component of the URL path). A URL request is considered to match a path field (configured in the Ingress specification) when the entire value of the path (which can include multiple components separated by /) matches the first labels (adjectives). left of the URL). For example /example1/path1 matches /example1/path1/path2, but not /example1/path1path2
Specific examples:
Path type | Path(s) | Request path(s) | Is there a match or not? |
Exact |
|
| Have |
Exact |
|
| Are not |
Exact |
|
| Are not |
Exact |
|
| Are not |
Prefix |
| (all paths) | Have |
Prefix |
|
| Have |
Prefix |
|
| Have |
Prefix |
|
| Are not |
Prefix |
|
| Have |
Prefix |
|
| Have |
Prefix |
|
| Have |
Prefix |
|
| Have |
Prefix |
|
| Are not |
Prefix |
|
| Have |
Prefix |
|
| Have |
Prefix |
|
| Have |
Prefix |
|
| Are not |
In some cases, multiple paths within Ingress will match the path of the request URL. In those cases, priority will be given to the longest matching path first. If the two paths still have the same length, the priority will be in the order of the rule created on the Ingress Yaml file.
Ingress rule
Each HTTP rule contains the following information:
1 optional host . If no host (we can understand it as a domain name) is specified, the rule will be applied to all HTTP traffic inbound to the specified IP address. If a host is specified (for example example1.com), the rule only applies to that host.
A list of paths ( for example
/example1/host1
), each path has a backend service associated with it defined by Service Name and Port Number. Both host and path must match the content of the incoming request before the load balancer directs traffic to the desired Services.A backend is a combination of the Service name and Port Number. HTTP and HTTPS requests going to Ingress and whose URL matches the host and path of the rule will be sent to the list of backends.
For example, does Host match the Host header according to the table:
Host | Host header | Is there a match or not? |
Have | ||
Are not | ||
Are not |
Last updated