Istio implements the Kubernetes ingress resource to expose a service and make it accessible from outside the cluster.
The general recommendation is to use Istio gateway, and virtual service resources to allow a more complete control over the traffic. That content is covered in the traffic management section.
The Kubernetes ingress resource has a set of rules to match the incoming HTTP traffic to route the request to a back-end service. Each rule matches a DNS name and a set of paths to forward the traffic to a back-end service.
The ingress resource has the following fields on the YAML manifest.
List of rules to match against incoming HTTP traffic.
List of host names to match the HTTP traffic. The host can be set to a specific DNS name, wildcards such as
*.example.comare supported, and it can be defined as
'*'to match all hostnames.
List of URL paths that are matched against HTTP requests.
Exactmatches the provided path as is.
Prefixmatches the provided path if it begins with the specified prefix.
Specifies the service that receives the traffic.
The following code listing is an example of an ingress resource manifest.
--- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: kubernetes-dashboard namespace: kubernetes-dashboard annotations: kubernetes.io/ingress.class: istio # (1) spec: rules: # (2) - host: dashboard.192.168.59.20.nip.io # (3) http: paths: # (4) - path: / pathType: Prefix # (5) backend: # (6) service: name: kubernetes-dashboard port: number: 80
Specifies that Istio handles this ingress resource.
Set of rules to be applied against incoming HTTP traffic.
DNS host name where the ingress serves traffic.
List of paths to match HTTP traffic.
Type of match that should be applied to the path.
Back-end service name and port number.
The annotation is required to tell the Istio gateway controller that it should handle this ingress resource, otherwise is ignored.
metadata: annotations: kubernetes.io/ingress.class: istio