> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/self-managed-enterprise-edition/use-self-managed-enterprise-edition/advanced-configuration/use-ingress-controller-overrides.md).

# Configure and customize Ingress and NGINX Controller using Overrides

Learn how to configure and use ingress controller overrides for the on-prem Harness Self-Managed Enterprise Edition.

This guide explains how to configure ingress resources and the NGINX controller in your Harness deployment, including how to customize its behavior using overrides.

Go to [Ingress Controllers](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/) in the Kubernetes documentation for details.

### Ingress configuration <a href="#ingress-configuration" id="ingress-configuration"></a>

#### Enable ingress <a href="#enable-ingress" id="enable-ingress"></a>

```yaml
global:
  ingress:
    enabled: true
    className: "harness"  # Specifies the Ingress controller class
```

#### Host configuration <a href="#host-configuration" id="host-configuration"></a>

```yaml
global:
  ingress:
    hosts:
      - 'myhost.example.com'  # Replace with your domain
```

#### TLS configuration <a href="#tls-configuration" id="tls-configuration"></a>

```yaml
global:
  ingress:
    tls:
      - secretName: my-tls-secret
        hosts:
          - myhost.example.com
```

### Advanced configuration options <a href="#advanced-configuration-options" id="advanced-configuration-options"></a>

#### Path type <a href="#path-type" id="path-type"></a>

```yaml
global:
  ingress:
    pathType: ImplementationSpecific  # Other options: Prefix, Exact
```

#### Custom annotations <a href="#custom-annotations" id="custom-annotations"></a>

```yaml
global:
  ingress:
    objects:
      annotations:
        nginx.ingress.kubernetes.io/proxy-body-size: "50m"
        nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
```

#### Host configuration <a href="#host-configuration" id="host-configuration"></a>

```yaml
global:
  ingress:
    disableHostInIngress: false  # Set to true to disable host rules in Ingress
```

### Example full configuration <a href="#example-full-configuration" id="example-full-configuration"></a>

```yaml
global:
  ingress:
    enabled: true
    className: "harness"
    objects:
      annotations:
        nginx.ingress.kubernetes.io/proxy-body-size: "50m"
        nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
    disableHostInIngress: false
    pathType: ImplementationSpecific
    hosts:
      - 'myhost.example.com'
    tls:
      - secretName: my-tls-secret
        hosts:
          - myhost.example.com
```

### Configure ingress controller arguments <a href="#configure-ingress-controller-arguments" id="configure-ingress-controller-arguments"></a>

You can configure `nginx-ingress-controller` arguments using the following overrides.

```yaml
nginx:
  controller:
    watchNamespace: ""
    updateStatus: true
    httpPort: 8080
    httpsPort: 8443
    watchIngressWithoutClass: true
    defaultSSLCertificate: ""
    configMap: ""
    defaultBackendService: ""
    publishService: ""
    electionId: ""
    controllerClass: ""
```

#### Add extra arguments <a href="#add-extra-arguments" id="add-extra-arguments"></a>

Use the following to add extra arguments.

```yaml
nginx:
  controller:
    extraCommandArgs:
      - --argument=example-argument
```

#### Create cluster roles <a href="#create-cluster-roles" id="create-cluster-roles"></a>

The following creates a `clusterRole` and `clusterRoleBindings`.

```yaml
nginx:
  clusterRole:
    create: true
```

### Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

Common issues and solutions:

1. **502 Bad Gateway**
   * Check upstream service availability
   * Verify proxy timeout settings
   * Check service name and port configuration
2. **404 Not Found**
   * Verify ingress path configuration
   * Check rewrite-target annotation if used
   * Confirm service endpoint existence
   * Check nginx controller logs for errors
3. **SSL/TLS Issues**
   * Verify TLS secret exists
   * Check certificate validity
4. **Performance Issues**
   * Increase nginx controller replicas if needed
   * Check nginx controller logs for errors

{% @harness-feedback/feedback %}
