apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
name: openshift-default
spec:
controllerName: openshift.io/gateway-controller/v1
To route traffic using Gateway API, you must first enable the feature on your cluster. You can enable Gateway API by creating a GatewayClass custom resource, which triggers the Ingress Operator to provision the necessary controller and components.
After you successfully enable Gateway API, you can begin deploying gateways, assigning network addresses, and configuring listeners to control your network traffic flow.
To configure Gateway API for use on your cluster, you must create a GatewayClass resource. During the creation of the GatewayClass resource, the Ingress Operator installs a lightweight Istio control plane, based on Red Hat OpenShift Service Mesh, in the openshift-ingress namespace.
You have access to the cluster as a user with the cluster-admin role.
You have installed the OpenShift CLI (oc).
Create a GatewayClass object:
Create a YAML file, openshift-default.yaml, that contains the following information:
GatewayClass CRapiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
name: openshift-default
spec:
controllerName: openshift.io/gateway-controller/v1
metadata.name: The name of your GatewayClass object. The name must consist of a maximum of 63 lowercase alphanumeric characters or hyphens (-). The name must also start and end with an alphanumeric character.
|
The |
Run the following command to create the GatewayClass resource:
$ oc create -f openshift-default.yaml
gatewayclass.gateway.networking.k8s.io/openshift-default created
Verify that the GatewayClass CR has been accepted and the controller is successfully installed by running the following command:
$ oc get gatewayclass openshift-default -o yaml
# ...
status:
conditions:
- lastTransitionTime: "2026-05-15T10:00:00Z"
message: The GatewayClass has been accepted
reason: Accepted
status: "True"
type: Accepted
- lastTransitionTime: "2026-05-15T10:00:00Z"
message: Istio installed successfully
reason: Installed
status: "True"
type: ControllerInstalled
- lastTransitionTime: "2026-05-15T10:00:00Z"
message: Istio CRDs are being managed by cluster-ingress-operator
reason: ManagedByCIO
status: "True"
type: CRDsReady
# ...
Inspect the status.conditions block in the output. A healthy GatewayClass CR reports a status of True for the Accepted, ControllerInstalled, and CRDsReady conditions.