2022-07-05 22:53:56 +00:00
---
layout: docs
page_title: Consul API Gateway GatewayClass
description: >-
2022-07-06 16:59:40 +00:00
Consul API Gateway GatewayClass
2022-07-05 22:53:56 +00:00
---
# GatewayClass
2022-07-26 02:57:30 +00:00
This topic provides full details about the `GatewayClass` resource
## Introduction
2022-07-05 22:53:56 +00:00
The `GatewayClass` resource is used as a template for creating `Gateway` resources.
The 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.
2022-07-26 02:57:30 +00:00
The `GatewayClass` resource is a generic kubernetes gateway object. For configuration specific to Consul API Gateway, see [GatewayClassConfig](/docs/api-gateway/configuration/gatewayclassconfig).
## Configuration model
2022-07-26 17:34:10 +00:00
* [`controllerName`](#controllername): string | required
* [`parametersRef`](#parametersref): object | optional
* [`group`]([#parametersref-group): Group | required is parametersRef is set
* [`kind`](#parametersref-kind): Kind | required is parametersRef is set
* [`name`](#parametersref-name): string | required is parametersRef is set
* [`description`](#description): string | optional
2022-07-26 02:57:30 +00:00
## Specification
This topic provides details about the configuration parameters.
### controllerName
2022-07-26 17:42:46 +00:00
The name of the controller that is managing the gateways of this class.
2022-07-26 02:57:30 +00:00
* Type: string
* Required: required
2022-07-26 17:42:46 +00:00
You must specify the following value:
* `'hashicorp.com/consul-api-gateway-controller'`
2022-07-26 02:57:30 +00:00
### parametersRef
An object that defines additional configuration required by the gateway controller.
* Type: object
* Required: required
### parametersRef.group
2022-07-26 15:10:17 +00:00
The Kubernetes group of the `parametersRef`. This value will always be the same across all deployments of Consul API Gateway.
2022-07-26 02:57:30 +00:00
* Type: Group
* Required: required
2022-07-26 15:10:17 +00:00
You must specify the following value:
* `api-gateway.consul.hashicorp.com`
2022-07-26 02:57:30 +00:00
### parametersRef.kind
2022-07-26 15:10:17 +00:00
The Kubernetes kind of the `parametersRef`. This value will always be the same across all deployments of Consul API Gateway.
* Type: Kind
2022-07-26 02:57:30 +00:00
* Required: required
2022-07-26 15:10:17 +00:00
You must specify the following value:
* `GatewayClassConfig`
2022-07-26 02:57:30 +00:00
### parametersRef.name
2022-07-26 15:10:17 +00:00
The name of the `GatewayClassConfig` object
2022-07-26 02:57:30 +00:00
* Type: object
* Required: required
### description
Helps describe a gateway class with more details
* Type: string
* Required: optional
## Complete Configuration
2022-07-05 22:53:56 +00:00
The following example creates a gateway class called `test-gateway-class`:
<CodeBlockConfig filename="gateway.yaml">
```yaml
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: GatewayClass
metadata:
2022-07-13 21:01:45 +00:00
name: test-gateway-class
2022-07-05 22:53:56 +00:00
spec:
2022-07-13 21:01:45 +00:00
controllerName: 'hashicorp.com/consul-api-gateway-controller'
parametersRef:
group: api-gateway.consul.hashicorp.com
kind: GatewayClassConfig
name: test-gateway-class-config
2022-07-14 16:31:18 +00:00
```
2022-07-05 22:53:56 +00:00
</CodeBlockConfig>
Refer to the [Kubernetes Gateway API documentation](https://gateway-api.sigs.k8s.io/v1alpha2/references/spec/#gateway.networking.k8s.io/v1alpha2.GatewayClass) for details about configuring gateway classes.