gateway
by nicklasfrahm
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
| Parameter | Description | Default |
|---|---|---|
gateway.name | Name of the Gateway resource | shared-http |
gateway.className | Gateway class name | cilium |
gateway.tls.enabled | Enable HTTPS listener and TLS certificates | true |
gateway.tls.issuer.kind | cert-manager issuer kind (Issuer/ClusterIssuer) | Issuer |
gateway.tls.issuer.name | cert-manager issuer name | letsencrypt-production |
gateway.hostnames | List of hostnames for the gateway | ["example.com"] |
Certificate Issuers Configuration
| Parameter | Description | Default |
|---|---|---|
issuers.letsEncryptProduction.enabled | Enable Let's Encrypt production issuer | true |
issuers.letsEncryptProduction.kind | Issuer type (Issuer/ClusterIssuer) | Issuer |
issuers.letsEncryptProduction.name | Issuer name | letsencrypt-production |
issuers.letsEncryptProduction.server | ACME server URL | https://acme-v02.api.letsencrypt.org/directory |
issuers.letsEncryptStaging.enabled | Enable Let's Encrypt staging issuer | false |
issuers.letsEncryptStaging.kind | Issuer type (Issuer/ClusterIssuer) | Issuer |
issuers.letsEncryptStaging.name | Issuer name | letsencrypt-staging |
issuers.letsEncryptStaging.server | ACME server URL | https://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:
- Creates cert-manager Certificate resources for each hostname
- Configures the Gateway to use these certificates for HTTPS termination
- 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-tlswww.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
- Gateway not ready: Check if the Gateway class controller is running
- Certificate not issued: Verify the issuer is properly configured and the HTTP-01 challenge can be completed
- 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartgateway is pinned at v0.3.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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