Kubernetes·Kubernetes from first pod to production app

Ingress

Route HTTP traffic by host and path with an Ingress controller.

Intermediate 13 min read Lesson 6 of 300 Challenge included
What you will be able to do
  • Install an Ingress controller first.
  • Route by host and path.
  • Add TLS with a certificate manager.
  • Keep routing rules in version control.

In plain English

An Ingress is a routing rule for HTTP. The cluster needs an Ingress controller to implement it. Use host and path rules with TLS, and keep the controller’s annotations minimal.

ingress.yamlYAML
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: web
spec:
  rules:
    - host: app.example.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: web
                port:
                  number: 80
Your turn

Route a path

Medium

Add an Ingress path for /api to a service named api on port 80.

YAML · starter
paths: []
Check your understanding before moving on.
Knowledge checkQuestion 1

What is required for an Ingress resource to work?

Select an answer to continue
Study tools

Make it yours.

Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.

Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign in
Finished reading?

Lock in what you just learned.

Mark this lesson complete to save your place and move one step closer to the certificate.

Next: Storage
Lesson 6 of 300 · 0% of course