gateway

by nicklasfrahm

Helm chartv0.3.0App 0.3.0Verified publisher

Deploy a Kubernetes Gateway for managing ingress traffic.

About this chart

Gateway Helm Chart

A Helm chart for deploying a Kubernetes Gateway API Gateway with automatic TLS certificate management using cert-manager.

Overview

This chart deploys a Kubernetes Gateway resource that manages ingress traffic using the Gateway API. It includes:

  • Gateway: A Kubernetes Gateway resource with HTTP and HTTPS listeners
  • Certificate Issuers: cert-manager Issuer/ClusterIssuer resources for automatic TLS certificate provisioning
  • Certificates: cert-manager Certificate resources for TLS termination

Prerequisites

  • Kubernetes cluster with Gateway API CRDs installed
  • A Gateway API-compatible ingress controller (e.g., Cilium, Istio, Envoy Gateway)
  • cert-manager installed in the cluster
  • Helm 3.0+

Installation

Install the chart

helm install my-gateway oci://ghcr.io/nicklasfrahm/charts/gateway -n kube-system

Install with custom values

helm install my-gateway oci://ghcr.io/nicklasfrahm/charts/gateway -n kube-system -f my-values.yaml

Configuration

Gateway Configuration

ParameterDescriptionDefault
gateway.nameName of the Gateway resourceshared-http
gateway.classNameGateway class namecilium
gateway.tls.enabledEnable HTTPS listener and TLS certificatestrue
gateway.tls.issuer.kindcert-manager issuer kind (Issuer/ClusterIssuer)Issuer
gateway.tls.issuer.namecert-manager issuer nameletsencrypt-production
gateway.hostnamesList of hostnames for the gateway["example.com"]

Certificate Issuers Configuration

ParameterDescriptionDefault
issuers.letsEncryptProduction.enabledEnable Let's Encrypt production issuertrue
issuers.letsEncryptProduction.kindIssuer type (Issuer/ClusterIssuer)Issuer
issuers.letsEncryptProduction.nameIssuer nameletsencrypt-production
issuers.letsEncryptProduction.serverACME server URLhttps://acme-v02.api.letsencrypt.org/directory
issuers.letsEncryptStaging.enabledEnable Let's Encrypt staging issuerfalse
issuers.letsEncryptStaging.kindIssuer type (Issuer/ClusterIssuer)Issuer
issuers.letsEncryptStaging.nameIssuer nameletsencrypt-staging
issuers.letsEncryptStaging.serverACME server URLhttps://acme-staging-v02.api.letsencrypt.org/directory

Example Values

Basic Configuration

gateway:
  name: "my-gateway"
  className: "cilium"
  hostnames:
    - "api.example.com"
    - "app.example.com"

Using Staging Environment

gateway:
  name: "staging-gateway"
  className: "cilium"
  tls:
    enabled: true
    issuer:
      kind: "Issuer"
      name: "letsencrypt-staging"
  hostnames:
    - "staging.example.com"

issuers:
  letsEncryptProduction:
    enabled: false
  letsEncryptStaging:
    enabled: true

Multiple Hostnames with ClusterIssuer

gateway:
  name: "shared-gateway"
  className: "istio"
  tls:
    enabled: true
    issuer:
      kind: "ClusterIssuer"
      name: "cluster-letsencrypt"
  hostnames:
    - "api.example.com"
    - "www.example.com"
    - "admin.example.com"

issuers:
  letsEncryptProduction:
    enabled: true
    kind: "ClusterIssuer"
    name: "cluster-letsencrypt"

Usage

After installing the chart, you can create HTTPRoute resources to route traffic through the gateway:

apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: my-app-route
  namespace: my-app
spec:
  parentRefs:
    - name: shared-http
      namespace: kube-system
  hostnames:
    - "api.example.com"
  rules:
    - matches:
        - path:
            type: PathPrefix
            value: /
      backendRefs:
        - name: my-app-service
          port: 80

TLS Certificate Management

When TLS is enabled, the chart automatically:

  1. Creates cert-manager Certificate resources for each hostname
  2. Configures the Gateway to use these certificates for HTTPS termination
  3. Sets up HTTP-01 challenge solving through the Gateway

Certificate secrets are named using the pattern: {hostname-with-dots-replaced-by-dashes}-tls

For example:

  • api.example.com → api-example-com-tls
  • www.example.com → www-example-com-tls

Troubleshooting

Check Gateway Status

kubectl get gateway -A
kubectl describe gateway <gateway-name>

Check Certificate Status

kubectl get certificates
kubectl describe certificate <cert-name>

Check Certificate Issuer Status

kubectl get issuer
kubectl describe issuer <issuer-name>

Common Issues

  1. Gateway not ready: Check if the Gateway class controller is running
  2. Certificate not issued: Verify the issuer is properly configured and the HTTP-01 challenge can be completed
  3. DNS issues: Ensure hostnames resolve to the Gateway's external IP

Uninstalling

helm uninstall my-gateway -n kube-system

Deploy gateway with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has gateway on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartgateway is pinned at v0.3.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply