GatewayClass

gateway.networking.k8s.io/v1


Gateway API Versionv1.6.0

GatewayClass describes a class of Gateways available to the user for creating Gateway resources.

It is recommended that this resource be used as a template for Gateways. This means that a Gateway is based on the state of the GatewayClass at the time it was created and changes to the GatewayClass or associated parameters are not propagated down to existing Gateways. This recommendation is intended to limit the blast radius of changes to GatewayClass or associated parameters.
If implementations choose to propagate GatewayClass changes to existing Gateways, that MUST be clearly documented by the implementation.

Whenever one or more Gateways are using a GatewayClass, implementations SHOULD add the gateway-exists-finalizer.gateway.networking.k8s.io finalizer on the associated GatewayClass. This ensures that a GatewayClass associated with a Gateway is not deleted while in use.

GatewayClass is a Cluster level resource.

A GatewayClass name SHOULD be compliant with RFC 1035, consisting of a maximum of 63 lower case alphanumeric characters or hyphens (’-’), and MUST start and end with an alphanumeric character.

---
config:
  theme: base
  themeVariables:
    secondaryColor: '#ffffff'
---
block
  columns 7

  classDef al_ref_box fill:#F2F2F2,stroke:#555;
  classDef al_mgw_box fill:#70991F,stroke:#555;
  classDef al_gwapi_box fill:#326CE5,stroke:#555;
  classDef al_std_box fill:#808B8F,stroke:#555;
  classDef al_self_box fill:#326CE5,stroke:#777,stroke-width:5px; 

  
  
  block:RefBy:1
    columns 1
    Gateway["<a href='../../../gateway-api/gateway/v1'>&nbsp;&nbsp;Gateway&nbsp;&nbsp;</a>"]
    class Gateway al_gwapi_box
  end
  class RefBy al_ref_box
  space:2
  
  
  GatewayClass["<a href='../../../gateway-api/gateway-class/v1'>&nbsp;&nbsp;<b>GatewayClass</b>&nbsp;&nbsp;</a>"]
  class GatewayClass al_self_box
  
  
  space:2
  block:Ref:1
    columns 1
    GatewayParameters["<a href='../../../microgateway/gateway-parameters/v1alpha1'>&nbsp;&nbsp;GatewayParameters&nbsp;&nbsp;</a>"]
    class GatewayParameters al_mgw_box
  end
  class Ref al_ref_box
  
  

  RefBy -- "<br><i>references</i>" --> GatewayClass
  GatewayClass -- "<br><i>references</i>" --> Ref
apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
  name: gateway-class-example
spec:
  controllerName: microgateway.airlock.com/gatewayclass-controller

GatewayClass

Field Description Type Required Default Allowed Values
metadata defines the resource’s metadata ObjectMeta yes
spec defines the desired state of GatewayClass. object yes
status defines the current state of GatewayClass.

Implementations MUST populate status on all GatewayClass resources which specify their controller name.
object no

GatewayClass.spec

Field Description Type Required Default Allowed Values
controllerName is the name of the controller that is managing Gateways of this class. The value of this field MUST be a domain prefixed path.

Example: “example.net/gateway-controller”.

This field is not mutable and cannot be empty.
string yes
description helps describe a GatewayClass with more details. string no
parametersRef

ParametersRef is a reference to a resource that contains the configuration parameters corresponding to the GatewayClass. This is optional if the controller does not require any additional configuration.

ParametersRef can reference a standard Kubernetes resource, i.e. ConfigMap, or an implementation-specific custom resource. The resource can be cluster-scoped or namespace-scoped.

If the referent cannot be found, refers to an unsupported kind, or when the data within that resource is malformed, the GatewayClass SHOULD be rejected with the “Accepted” status condition set to “False” and an “InvalidParameters” reason.

A Gateway for this GatewayClass may provide its own parametersRef. When both are specified, the merging behavior is implementation specific.
It is generally recommended that GatewayClass provides defaults that can be overridden by a Gateway.

Supported kinds: GatewayParameters

object no

GatewayClass.spec.parametersRef

Field Description Type Required Default Allowed Values
group

Group is the group of the referent.

Supported groups: microgateway.airlock.com

string yes
kind

Kind is kind of the referent.

Supported kinds: GatewayParameters

string yes
name is the name of the referent. string yes
namespace is the namespace of the referent.
This field is required when referring to a Namespace-scoped resource and MUST be unset when referring to a Cluster-scoped resource.
string no

GatewayClass.status

Field Description Type
conditions

Conditions is the current status from the controller for this GatewayClass.

Controllers should prefer to publish conditions using values of GatewayClassConditionType for the type of each Condition.

Possible conditions:

  • Accepted: This condition indicates whether the GatewayClass has been accepted by the controller requested in the spec.controller field.

    This condition defaults to Unknown, and MUST be set by a controller when it sees a GatewayClass using its controller string. The status of this condition MUST be set to True if the controller will support provisioning Gateways using this class. Otherwise, this status MUST be set to False.
    If the status is set to False, the controller SHOULD set a Message and Reason as an explanation.

    Possible reasons for this condition to be true are:
    • “Accepted”
    Possible reasons for this condition to be False are:
    • “InvalidParameters”
    • “Unsupported”
    • “UnsupportedVersion”
    Possible reasons for this condition to be Unknown are:
    • “Pending”
    Controllers should prefer to use the values of GatewayClassConditionReason for the corresponding Reason, where appropriate.
  • SupportedVersion: This condition indicates whether the GatewayClass supports the version(s) of Gateway API CRDs present in the cluster. This condition MUST be set by a controller when it marks a GatewayClass “Accepted”.

    The version of a Gateway API CRD is defined by the gateway.networking.k8s.io/bundle-version annotation on the CRD. If implementations detect any Gateway API CRDs that either do not have this annotation set, or have it set to a version that is not recognized or supported by the implementation, this condition MUST be set to false.

    Implementations MAY choose to either provide “best effort” support when an unrecognized CRD version is present. This would be communicated by setting the “Accepted” condition to true and the “SupportedVersion” condition to false.

    Alternatively, implementations MAY choose not to support CRDs with unrecognized versions. This would be communicated by setting the “Accepted” condition to false with the reason “UnsupportedVersions”.

    Possible reasons for this condition to be true are:
    • “SupportedVersion”
    Possible reasons for this condition to be False are:
    • “UnsupportedVersion”
    Controllers should prefer to use the values of GatewayClassConditionReason for the corresponding Reason, where appropriate.

    Note: This property is only available in the Gateway API experimental channel

Condition[]
supportedFeatures is the set of features the GatewayClass support.
It MUST be sorted in ascending alphabetical order by the Name key.
object[]

GatewayClass.status.supportedFeatures[]

Field Description Type
name string