Skip to content

GatewayClass

A GatewayClass selects the controller that manages a Gateway. The default HAPTIC installation creates a class named haptic; set spec.gatewayClassName: haptic on Gateways you want it to serve.

To install the Gateway API CRDs and create your first route, follow the Gateway API walkthrough.

Configuration

Add these settings to your Helm values file and apply the complete file when you upgrade. The example shows the defaults:

controller:
  templateLibraries:
    gateway:
      enabled: true

gatewayClass:
  enabled: true
  name: haptic
  default: false
  controllerName: haproxy-haptic.org/controller
  parametersRef:
    group: haproxy-haptic.org
    kind: HAProxyTemplateConfig
    name: ""        # Defaults to controller.configName
    namespace: ""   # Defaults to Release.Namespace

Creation conditions

HAPTIC creates the GatewayClass when all three conditions are met:

  1. gatewayClass.enabled: true (default)
  2. controller.templateLibraries.gateway.enabled: true (default)
  3. The cluster serves the gateway.networking.k8s.io gatewayclasses CRD

The controller manages the class at runtime. If the CRDs are absent, HAPTIC still handles Ingresses; installing the CRDs later creates the class without a Helm upgrade.

The generated GatewayClass uses spec.parametersRef to identify the release's HAProxyTemplateConfig. This reference documents the association; changing it doesn't make a running controller load a different configuration. Each controller loads the configuration selected at startup.

Defaults:

  • parametersRef.name defaults to controller.configName (typically haptic-config)
  • parametersRef.namespace defaults to chart's release namespace

Inspect the reference:

kubectl get gatewayclass haptic -o yaml

Multi-controller environments

Give each controller a distinct GatewayClass name and controller identifier. For multiple HAPTIC installations, follow Running multiple HAPTIC instances. Gateways must set spec.gatewayClassName. The gatewayClass.default value only emits the gateway.networking.k8s.io/is-default-class annotation; HAPTIC doesn't use it to choose a class.

Advanced: Multiple GatewayClasses

To separate internal and internet-facing traffic, install a HAPTIC release for each fleet, with its own classes, configuration, and HAProxy Service. Use the separate-release example and configure each release's HAProxy Service through its Helm values.

Creating another GatewayClass and setting parametersRef alone doesn't create another controller or HAProxy fleet.

Disabling GatewayClass creation

If you manage GatewayClass resources separately:

gatewayClass:
  enabled: false

See also

Found a problem on this page? Report it