Lesson 09 Ingress Resources
Theme:

Homework: Ingress Resources

Apply what you learned about Ingress templates, TLS, and annotations in Helm charts

Task 1 — Production Ingress Chart

Create a Helm chart for a microservices application called storefront that exposes three services through a single Ingress resource.

Requirements

Deliverables

  1. The templates/ingress.yaml template file
  2. The values.yaml with the complete ingress configuration
  3. Output of helm template storefront . showing the rendered Ingress resource

Self-Check

CriterionPass
Template wrapped in if .Values.ingress.enabled
Three hosts with correct paths and pathTypes
Different port numbers per host (3000, 8080, 4000)
Single TLS entry with wildcard covering all three hosts
All three annotations present in rendered output
Default backend configured for storefront-404:80
helm template renders without errors
Setting ingress.enabled=false produces no Ingress output

Task 2 — cert-manager Integration

Extend a Helm Ingress template to support automated certificate provisioning with cert-manager, controlled entirely through values.

Requirements

Hint

You will need to merge annotations from two sources. Consider building a dict in the template:

{{- $annotations := .Values.ingress.annotations | default dict }}
{{- if .Values.ingress.certManager.enabled }}
  {{- $_ := set $annotations "cert-manager.io/cluster-issuer"
      .Values.ingress.certManager.clusterIssuer }}
{{- end }}

Self-Check

CriterionPass
values.yaml has certManager.enabled and certManager.clusterIssuer
cert-manager annotation appears only when certManager.enabled: true
User-provided annotations are preserved alongside cert-manager annotation
Staging values use letsencrypt-staging, prod values use letsencrypt-prod
Both helm template . -f values-staging.yaml and -f values-prod.yaml render cleanly

Task 3 — Environment-Specific Ingress Values

Create three environment-specific values files that demonstrate how the same Ingress template adapts across development, staging, and production.

Requirements

Deliverables

  1. All three values files
  2. Run helm template with each file and confirm:
    • Dev: no Ingress resource in output
    • Staging: Ingress with basic auth annotations and rate limiting
    • Prod: Ingress with two hosts, TLS block, and cert-manager annotation

Self-Check

CriterionPass
Dev values produce zero Ingress resources
Staging Ingress has basic auth annotations (auth-type, auth-secret, auth-realm)
Staging Ingress has limit-rps: "20"
Prod Ingress has two host rules
Prod Ingress has TLS block with cert-manager annotation
Prod Ingress has proxy-body-size: "100m"
All three files render without Helm errors

Note

These tasks build on each other. Complete Task 1 first, as its template will be reused in Tasks 2 and 3. If you get stuck on the annotation merging in Task 2, review the Helm set and merge functions in the Sprig documentation.