I am having below questions related to Ingress resource in Kubernetes
- Can a single Ingress controller (ex: NginxIngress Controller) be mapped to multiple Ingress resources?
- If the Ingress resources are mapped to single namespace, how to requested be routed in case of multiple ingress resources?
- Is the Ingress resource mapped to unique hostname?
- Is the ingress controller (ex: Nginx Ingress controller) bound to a namespace or is it a cluster level resource?
CodePudding user response:
- Yes, it's possible, you can have a look here: Is it possible to have multiple ingress resources with a single GKE ingress controller
- Considering ingress resources are ingress rules:
If you create an Ingress resource without any hosts defined in the rules, then any web traffic to the IP address of your Ingress controller can be matched without a name based virtual host being required.
For example, the following Ingress routes traffic requested for first.bar.com to service1, second.bar.com to service2, and any traffic to the IP address without a hostname defined in request (that is, without a request header being presented) to service3.
3.
An optional host. In this example, no host is specified, so the rule applies to all inbound HTTP traffic through the IP address specified. If a host is provided (for example, foo.bar.com), the rules apply to that host.
4.
Parameters field has a scope and namespace field that can be used to reference a namespace-specific resource for configuration of an Ingress class. Scope field defaults to Cluster, meaning, the default is cluster-scoped resource. Setting Scope to Namespace and setting the Namespace field will reference a parameters resource in a specific namespace:
Namespace-scoped parameters avoid the need for a cluster-scoped CustomResourceDefinition for a parameters resource. This further avoids RBAC-related resources that would otherwise be required to grant permissions to cluster-scoped resources.