Skip to content

feat(ingressClass): make controller value configurable - #1976

Closed
asamudrala1 wants to merge 1 commit into
traefik:masterfrom
asamudrala1:feat/configurable-ingressclass-controller
Closed

feat(ingressClass): make controller value configurable#1976
asamudrala1 wants to merge 1 commit into
traefik:masterfrom
asamudrala1:feat/configurable-ingressclass-controller

Conversation

@asamudrala1

Copy link
Copy Markdown

Description

This PR makes the IngressClass controller value configurable via values.yaml, enabling users to run multiple Traefik instances with isolated IngressClass routing in the same cluster.

Problem

Currently, the IngressClass controller value is hardcoded as traefik.io/ingress-controller in the Helm chart template. This prevents users from running multiple Traefik instances (e.g., Internal and External) with proper traffic segregation, as both instances discover and process ALL ingresses regardless of the IngressClass name.

Fixes #13733

Solution

Added a new ingressClass.controller field in values.yaml with a default value of traefik.io/ingress-controller to maintain backward compatibility. Users can now override this value to create unique controller identifiers for each Traefik instance.

Changes

  • values.yaml: Added controller field to ingressClass section with default value and documentation
  • templates/ingressclass.yaml: Updated to use {{ .Values.ingressClass.controller }} instead of hardcoded value
  • values.schema.json: Added controller property with appropriate schema definition
  • tests/ingressclass-config_test.yaml: Added tests for default and custom controller values

Example Usage

Default Behavior (Backward Compatible)

ingressClass:
  enabled: true
  name: traefik
  controller: traefik.io/ingress-controller  # default

Multiple Traefik Instances with Isolated Routing

# Traefik Internal Instance
ingressClass:
  enabled: true
  name: traefik-internal
  controller: traefik.io/ingress-controller-internal

# Traefik External Instance  
ingressClass:
  enabled: true
  name: traefik-external
  controller: traefik.io/ingress-controller-external

With this change, each Traefik instance will only process ingresses that reference its specific IngressClass, enabling proper traffic segregation.

Testing

  • ✅ All existing ingressClass tests pass
  • ✅ Added test: "should use default controller value"
  • ✅ Added test: "should be possible to provide a custom controller value"
  • ✅ Backward compatible - default behavior unchanged
helm unittest -f 'tests/ingressclass-config_test.yaml' traefik

### Chart [ traefik ] traefik
 PASS  IngressClass configuration
Charts:      1 passed, 1 total
Test Suites: 1 passed, 1 total
Tests:       6 passed, 6 total

Checklist

  • Follows conventional commit format
  • Added documentation comments following helm-docs conventions
  • Updated values.schema.json
  • Added unit tests
  • All tests pass
  • Backward compatible

Related Issues

  • Fixes #13733
  • Related to discussion in #7896 and #13402

Allow users to override the IngressClass controller value via values.yaml.
This enables running multiple Traefik instances with isolated IngressClass
routing in the same cluster.

Previously, the controller value was hardcoded as 'traefik.io/ingress-controller',
preventing proper traffic segregation between multiple Traefik instances.

Changes:
- Add 'controller' field to ingressClass values with default 'traefik.io/ingress-controller'
- Update IngressClass template to use configurable controller value
- Add tests for default and custom controller values
- Update values.schema.json to include new controller property

Fixes: #13733
@mloiseleur

Copy link
Copy Markdown
Member

See #1645
Feel free to reopen or open a new one if we missed something

@mloiseleur mloiseleur closed this Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants