>_ IzzyLab

Hands-on task

This task is step 17 of the course “Kubernetes: manifests from Namespace to RBAC”

Ingress with a host

medium~7 min

Prepare in /root/ing.yaml an Ingress web: for the host app.example.com and path / (pathType: Prefix) it routes traffic to the service web on port 80. You don't have to write it by hand — it's easier to generate it with a kubectl command using --dry-run=client -o yaml. Open the result in the Editor tab and find the rule with the host, path and service.

What you'll practise:
  • kubernetes
  • ingress
  • kubectl
  • routing
  • dry-run

Topic breakdown

Ingress describes HTTP routing from outside into the cluster: rules tie a host and path to a backend service and its port. kubectl create ingress encodes a single rule in a flag using the compact format host/path=service:port, and pathType (Prefix vs. Exact) is inferred from how the path is written. With --dry-run=client -o yaml you get a ready networking.k8s.io/v1 manifest — you just have to fit the host, the prefix path, and the backend into one rule correctly.

What's checked

  1. Manifest is valid
  2. Host is set
  3. pathType Prefix
  4. Path / leads to the web:80 service

What it looks like