---
schema_version: "1"
id: fff34feeb9c9688c7e7d81b1324f4400c3f11aab74db679f884afeae6d8b8d3c
title: Configure Flex Gateway as an Ingress Controller in Local Mode
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/gateway/1.12/flex-gateway-k8-ingress-class.md
canonical_url: https://docs.mulesoft.com/gateway/1.12/flex-gateway-k8-ingress-class
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 0358ade097566fe3c6548cc485d7a7b2c483f99e52fdcf7e3646388aae127382
description: MuleSoft Documentation Site
release: "1.12"
latest: false
---
---
product: Omni Gateway
version: 1.12
---

# Configure Flex Gateway as an Ingress Controller in Local Mode

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

For Kubernetes deployments in Local Mode, Flex Gateway typically acts as an ingress controller that
manages external access to your Kubernetes cluster.

By default, Flex Gateways deployed on Kubernetes in Local Mode are configured as ingress controllers
and can consume `Ingress` resources. The ingress controller configuration is defined in the
`IngressClass` resource parameters in the Flex Gateway Helm chart.

In Kubernetes terminology, `IngressClass` resources configure a gateway as an ingress controller,
and `Ingress` resources configure a routing between the ingress controller and the Kubernetes
services it controls. For a detailed explanation of Kubernetes `IngressClass` resources and
`Ingress` resources, see
[Kubernetes Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/).

In the Helm chart, you can edit the `IngressClass` configuration or disable the ingress controller
functionality.

## Before You Begin

1.  [Download Flex Gateway for Use in a Kubernetes Cluster](https://docs.mulesoft.com/gateway/1.12/flex-install#kubernetes).

2.  [Register and Run Flex Gateway in a Kubernetes Cluster in Local Mode](https://docs.mulesoft.com/gateway/1.12/flex-local-reg-run).

## Ingress Class Parameters

The Helm chart includes the following default `IngressClass` parameters and values:

```helm
ingressClass.enabled: true
ingressClass.name: "{releaseName}-{namespace}"
ingressClass.setAsDefault: false
```

<table><colgroup><col> <col> <col></colgroup><tbody><tr><td><p>Parameter</p></td><td><p>Description</p></td><td><p>Possible values</p></td></tr><tr><td><p><code>ingressClass.enabled</code></p></td><td><p>Enables Flex Gateway as an <code>IngressClass</code> resource</p></td><td><p><code>true</code> or <code>false</code></p></td></tr><tr><td><p><code>ingressClass.name</code></p></td><td><p>The name of the <code>IngressClass</code></p></td><td><p>Any string</p></td></tr><tr><td><p><code>ingressClass.setAsDefault</code></p></td><td><p>Sets Flex Gateway as the default <code>IngressClass</code></p></td><td><p><code>true</code> or <code>false</code></p></td></tr></tbody></table>

Setting `ingressClass.setAsDefault: true` defines the Flex Gateway instance as the default
`IngressClass` resource for the cluster. The default `IngressClass` is the default ingress
controller for all `Ingress` resources you create in the cluster.

If there is no default `IngressClass`, or if the default `IngressClass` resource shouldn’t be the
ingress controller for a specific resource, you must manually define the ingress controller in the
`Ingress` resource.

You can modify the default `IngressClass` parameters during or after the initial installation of the
Helm chart. For more information about how to modify a Helm chart, see
[Update Pod Settings for a Flex Gateway Deployment Through a Helm Chart](https://docs.mulesoft.com/gateway/1.12/flex-gateway-k8-change-helm-settings)

## Creating Ingress Resources

After you [install a Helm chart into a namespace](https://docs.mulesoft.com/gateway/1.12/flex-local-reg-run-up#kubernetes), you can verify
your new `IngressClass` resource by running the following command:

```helm
kubectl get ingressclasses
```

To create an ingress routing:

1.  [Publish an API in Local Mode](https://docs.mulesoft.com/gateway/1.12/flex-local-publish-simple-api#kubernetes).

2.  Define the new API as a Kubernetes Service.  
    For more information about Kubernetes Service definitions, see
    [Defining a Service](https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service).

3.  Using `kubectl apply`, create an `Ingress` resource to define routing rules between the
    `IngressClass` Flex Gateway and the new Kubernetes Service:

    ```ssh
    cat <<EOF | kubectl apply -f -
    ---
    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
      name: <metadata-name>
      annotations:
        flex-gateway.ingress.kubernetes.io/api-instance: <api-instance-name>.<namespace>
    spec:
      ingressClassName: <ingress-class-name>
      rules:
      - http: ...
    EOF
    ```

    The `annotations` field value must match the API instance name and namespace specified when the
    API was defined.

    Omit the `ingressClassName` field if the gateway instance is configured as the default ingress
    controller.

    For more information about `Ingress` resources, see
    [Kubernetes Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/).

## See Also

- [Update Pod Settings for a Flex Gateway Deployment Through a Helm Chart](https://docs.mulesoft.com/gateway/1.12/flex-gateway-k8-change-helm-settings)

- [Managing Kubernetes Deployments](https://docs.mulesoft.com/gateway/1.12/flex-gateway-k8-management)
