• HashiCorp Developer

  • HashiCorp Cloud Platform
  • Terraform
  • Packer
  • Consul
  • Vault
  • Boundary
  • Nomad
  • Waypoint
  • Vagrant
Consul
  • Install
  • Tutorials
  • Documentation
  • API
  • CLI
  • Try Cloud(opens in new tab)
  • Sign up
Consul Home

Documentation

Skip to main content
  • Documentation
  • What is Consul?




  • HCP Consul

    • Overview
    • Installation
    • Technical Specifications
    • Upgrades
      • Overview
      • Gateway
      • GatewayClass
      • GatewayClassConfig
      • Routes
      • MeshService

  • Resources

  • Tutorial Library
  • Certifications
  • Community Forum
    (opens in new tab)
  • Support
    (opens in new tab)
  • GitHub
    (opens in new tab)
  1. Developer
  2. Consul
  3. Documentation
  4. Consul API Gateway
  5. Configuration
  6. GatewayClass
  • Consul
  • v1.13.x
  • v1.12.x
  • v1.11.x
  • v1.10.x
  • v1.9.x
  • v1.8.x

ยปGatewayClass Resource Configuration

This topic provides describes how to configure the GatewayClass resource, a generic Kubernetes gateway object used as a template for creating Gateway resources.

Introduction

The GatewayClass specification includes the name of the controller (controllerName) and an API object containing controller-specific configuration resources within the cluster (parametersRef). The value of the controllerName field must be set to hashicorp.com/consul-api-gateway-controller.

When gateways are created from a GatewayClass, they use the parameters specified in the GatewayClass at the time of instantiation.

The GatewayClass resource is a generic Kubernetes gateway object. For configuration specific to Consul API Gateway, see GatewayClassConfig.

Configuration model

The following outline shows how to format the configurations in the GatewayClass object. Click on a property name to view details about the configuration.

  • controllerName: string | required
  • parametersRef: object | optional
    • group: string | required if parametersRef is set
    • kind: string | required if parametersRef is set
    • name: string | required if parametersRef is set
  • description: string | optional

Specification

This topic provides details about the configuration parameters.

controllerName

Specifies the name of the controller that manages the gateways generated by this class. The value must always be hashicorp.com/consul-api-gateway-controller.

  • Type: string
  • Required: required

parametersRef

Defines an API object that references additional configurations required by the gateway controller. The following table describes the fields that you must include in the parametersRef configuration.

  • Type: object
  • Required: optional
ParameterDescriptionTypeRequired
groupSpecifies the Kubernetes group that the parametersRef is a member of.
The value must always be api-gateway.consul.hashicorp.com.
The parametersRef.group is always the same across all deployments of Consul API Gateway.
StringRequired
kindSpecifies the type of Kubernetes object that the parametersRef configuration defines.
The value must always be GatewayClassConfig.
This parametersRef.kind is always the same across all deployments of Consul API Gateway.
StringRequired
nameSpecifies a name for the GatewayClassConfig object.StringRequired

description

Specifies a human-readable description of the gateway class. We recommend using the description field to describe the gateway class's purpose.

  • Type: string
  • Required: optional

Example Configuration

The following example creates a gateway class called example-gateway-class:

gateway.yaml
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: GatewayClass
metadata:
  name: example-gateway-class
spec:
  controllerName: 'hashicorp.com/consul-api-gateway-controller'
  parametersRef:
    group: api-gateway.consul.hashicorp.com
    kind: GatewayClassConfig
    name: example-gateway-class-config
  description: The gateway class is for creating test gateways class configurations

Refer to the Kubernetes Gateway API documentation for details about configuring gateway classes.

Edit this page on GitHub

On this page

  1. GatewayClass Resource Configuration
  2. Introduction
  3. Configuration model
  4. Specification
  5. Example Configuration
Give Feedback(opens in new tab)
  • Certifications
  • System Status
  • Terms of Use
  • Security
  • Privacy
  • Trademark Policy
  • Trade Controls
  • Give Feedback(opens in new tab)