Responsible for routing requests to pods
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example-ingress
spec:
rules:
- host: inmylab.de
http:
paths:
- pathType: Prefix
path: "/foo"
backend:
service:
name: foo-service
port:
number: 5678
Ingress defines rule to match requests and how to route them
Wildcard host names are allowed
Match paths using Exact
or Prefix
Can be backed by multiple pods
Service takes care of load balancing
Using nginx-based ingress controller
Two pods foo
and bar
and…
…accompanying services
Match host inmylab.de
Match path prefix /foo
and forward to service foo-service
Match path prefix /bar
and forward to service bar-service
Deploy ingress controller, services and test connectivity
Manage access automatically - as code
external-dns
manages DNS records pointing to ingress controller
cert-manager
maintains certificates for TLS termination
Flexible ingress controllers offer important features, e.g. traefik
among others
Ingress
resource: focused on HTTP(S), annotations for advanced features
Solved by custom resources, e.g. IngressRoute
in traefik
Supports Ingress
resource with annotations and IngressRoute
resource
Use with single node Docker for testing
Supports HTTP(S) and TCP
Resource definition Middleware
to mutate requests and responses
Dashboard to inspect active configuration
Deploy traefik as ingress controller using a host port
Deploy demo applications foo
and bar
Add IngressRoute
resources