Skip to content
Open
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
9ba5bdf
feat(plugins): support ConfigMap inline local plugins alongside hostPath
Aug 4, 2025
278c337
feat(plugins): Add tests for support ConfigMap inline local plugins a…
Aug 4, 2025
4a43f73
feat(plugins): rm consecutive blank lines
Aug 4, 2025
12bf0a2
feat(plugins): add example comment
Aug 4, 2025
552cffa
Merge branch 'master' into feat/support-cm-local-plugins
cilasbeltrame Aug 5, 2025
b6df316
feat(plugins): add hello world example
Aug 8, 2025
0826e5d
Merge branch 'feat/support-cm-local-plugins' of github.com-cilasbeltr…
Aug 8, 2025
1ddb67e
feat(): rm blank spaces
Aug 8, 2025
dfaa36d
Merge branch 'master' into feat/support-cm-local-plugins
cilasbeltrame Aug 8, 2025
bc2af2f
feat(): add helper for local plugin cm and remove $root
Aug 11, 2025
1945596
Merge branch 'feat/support-cm-local-plugins' of github.com-cilasbeltr…
Aug 11, 2025
959cf65
Merge branch 'master' into feat/support-cm-local-plugins
cilasbeltrame Aug 14, 2025
bd92882
Merge branch 'master' into feat/support-cm-local-plugins
cilasbeltrame Sep 1, 2025
eb1cfaf
feat(): rm production deployment quote as it still under experimental
Sep 1, 2025
a7d0639
Merge branch 'master' into feat/support-cm-local-plugins
cilasbeltrame Sep 1, 2025
b33f4f5
feat(): add backwards compatibility with previous localPlugins declar…
Sep 1, 2025
4d31c24
feat(): fix schema
Sep 2, 2025
da1b2e3
feat(): fix helm tests
Sep 2, 2025
1a03526
feat(): update docs
Sep 2, 2025
24fa2cb
feat(): update docs
Sep 2, 2025
f7603c7
feat(): link markdown
Sep 2, 2025
b6fce53
feat(): type conditions
Sep 6, 2025
5dd9f84
Merge branch 'master' into feat/support-cm-local-plugins
Sep 27, 2025
1878378
feat(): fix unitest
Sep 27, 2025
38924a7
feat(): add source to provide cm data
Oct 21, 2025
53c6eb9
feat(): update migration example
Oct 21, 2025
14bb9e7
Merge branch 'master' into feat/support-cm-local-plugins
cilasbeltrame Oct 21, 2025
d284e50
Merge branch 'master' into feat/support-cm-local-plugins
cilasbeltrame Oct 23, 2025
1d95811
feat(): add required source key for inline plugin
Oct 30, 2025
5314ae9
Merge branch 'feat/support-cm-local-plugins' of github.com-cilasbeltr…
Oct 30, 2025
6ef72eb
Update EXAMPLES.md
cilasbeltrame Nov 5, 2025
d8c2c91
Update EXAMPLES.md
cilasbeltrame Nov 5, 2025
0d5b2a0
Update EXAMPLES.md
cilasbeltrame Nov 5, 2025
da6fa84
Update EXAMPLES.md
cilasbeltrame Nov 5, 2025
380a308
Merge branch 'master' into feat/support-cm-local-plugins
cilasbeltrame Nov 5, 2025
c7c10c0
feat(): rm readme files
Nov 6, 2025
a63f783
Merge branch 'feat/support-cm-local-plugins' of github.com-cilasbeltr…
Nov 6, 2025
c067122
Merge branch 'master' into feat/support-cm-local-plugins
cilasbeltrame Nov 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 121 additions & 6 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -623,20 +623,135 @@ extraObjects:

To develop or test plugins without pushing them to a public registry, you can load plugin source code directly from your local filesystem.

>[!NOTE]
> The ``hostPath`` must point to a directory containing the plugin source code and a valid ``go.mod`` file. The ``moduleName`` must match the module name specified in the ``go.mod`` file.
>[!WARNING]
> The legacy `hostPath` configuration at the `experimental.localPlugins` level is deprecated. Please use the new structured `experimental.localPlugins.<yourplugin>.type` configuration for better organization and future features.

### Legacy Configuration (Backward Compatibility)

>[!WARNING]
> This legacy `hostPath` configuration is deprecated and will be removed in the next major version. Please migrate to the structured `type` configuration below.

```yaml
experimental:
localPlugins:
legacy-demo:
moduleName: github.com/traefik/legacydemo
mountPath: /plugins-local/src/github.com/traefik/legacydemo
hostPath: /path/to/plugin-source # ⚠️ Deprecated - use type: hostPath instead
```

## Structured Local Plugins (Current Approach)

The `localPlugins` configuration supports a structured `experimental.localPlugins.<yourplugin>.type` approach that provides better organization, security, and flexibility:

### Using Inline Plugin (Recommended for small/medium plugins)

For testing or general use, embed plugin source directly in values.yaml using the secure `inlinePlugin` type:

```yaml
experimental:
localPlugins:
helloworld-plugin:
moduleName: github.com/example/helloworldplugin
mountPath: /plugins-local/src/github.com/example/helloworldplugin
type: inlinePlugin
source:
go.mod: |
module github.com/example/helloworldplugin

go 1.23
.traefik.yml: |
displayName: Hello World Plugin
type: middleware

import: github.com/example/helloworldplugin

summary: |
This is a simple plugin that prints "Hello, World!" to the response.

testData:
message: "Hello, World!"
main.go: |
package helloworldplugin

import (
"context"
"net/http"
)

type Config struct{}

func CreateConfig() *Config {
return &Config{}
}

type HelloWorld struct {
next http.Handler
}

func New(ctx context.Context, next http.Handler, config *Config, name string) (http.Handler, error) {
return &HelloWorld{next: next}, nil
}

func (h *HelloWorld) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
rw.Write([]byte("Hello, World!"))
h.next.ServeHTTP(rw, req)
}
```

> **Advantages**: Secure (no host filesystem access), portable, version controlled with Helm values, supports up to 1MB of plugin code.

### Using Host Path Plugin (Use with Caution)

>[!WARNING]
> The `hostPath` type should be avoided for security reasons and requires additional work to pull plugins from repositories or blob storage. Consider using `inlinePlugin` or `localPath` instead.

```yaml
experimental:
localPlugins:
local-demo:
moduleName: github.com/traefik/localplugindemo
mountPath: /plugins-local/src/github.com/traefik/localplugindemo
type: hostPath
hostPath: /path/to/plugin-source
```

>[!IMPORTANT]
> When using ``hostPath`` volumes, the plugin source code must be available on every node where Traefik pods might be scheduled.
### Using Local Path Plugin (Advanced)

>[!NOTE]
> The `localPath` type leverages the existing `additionalVolumes` mechanism for maximum flexibility. This supports PVC, CSI drivers (s3-csi-driver, FUSE), and other volume types.

```yaml
# Define the volume in additionalVolumes first
deployment:
additionalVolumes:
- name: plugin-storage
persistentVolumeClaim:
claimName: plugin-storage-pvc
# Or use CSI driver for S3/blob storage:
# - name: s3-plugin-storage
# csi:
# driver: s3.csi.aws.com
# volumeAttributes:
# bucketName: my-plugin-bucket

# Then reference it in localPlugins
experimental:
localPlugins:
s3-plugin:
moduleName: github.com/example/s3plugin
mountPath: /plugins-local/src/github.com/example/s3plugin
type: localPath
volumeName: plugin-storage # Must match additionalVolumes name
subPath: plugins/s3plugin # Optional subpath within volume
```

> **Advantages**:
>
> - **Flexible**: Supports any Kubernetes volume type (PVC, CSI, NFS, etc.)
> - **Secure**: Works with CSI drivers for cloud storage (S3, Azure Blob, GCS)
> - **Scalable**: Centralized plugin storage, no per-node requirements
> - **Consistent**: Uses existing Helm chart patterns (`additionalVolumes`)

## Using Traefik-Hub with private plugin registries

Expand Down Expand Up @@ -778,8 +893,8 @@ podSecurityContext:

Setup:

* cert-manager installed in `cert-manager` namespace
* A cloudflare account on a DNS Zone
- cert-manager installed in `cert-manager` namespace
- A cloudflare account on a DNS Zone

**Step 1**: Create `Secret` and `Issuer` needed by `cert-manager` with your API Token.
See [cert-manager documentation](https://cert-manager.io/docs/configuration/acme/dns01/cloudflare/)
Expand Down
39 changes: 39 additions & 0 deletions traefik-crds/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# traefik-crds
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not exactly sure what happened here, but this README (and also the one in the traefik chart directory) are autogenerated and thus should not be committed; definitely not as part of this PR.

@mloiseleur should we gitignore these maybe?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jnoordsij this README should be removed from the PR.
There is only one README.md at the root of this project and it's not auto-generated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that makes sense 👍

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just figured out these are actually the output from make docs, however outputted as README.md rather than VALUES.md.

@cilasbeltrame can you remove this file (and the one in traefik chart) from this PR, then run make docs and ensure it updates VALUES.md rather than adding readmes?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jnoordsij That's correct, let me review this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jnoordsij just did it, I've removed the files. When running make docs it didn't update the files values.md, my gues is because I haven't changed the existent schema:
experimental.localPlugins | object | {}

It should be good. Pls confirm.

cilasbeltrame in traefik-helm-chart on  feat/support-cm-local-plugins [⇣$✘?] 
❯ make docs
docker run --rm -v "/Users/cilasbeltrame/Documents/projects/opensource/traefik-helm-chart:/helm-docs" jnorwood/helm-docs:v1.14.2 -o VALUES.md
time="2025-11-06T09:41:54Z" level=info msg="Found Chart directories [traefik, traefik-crds]"
time="2025-11-06T09:41:54Z" level=info msg="Generating README Documentation for chart traefik-crds"
time="2025-11-06T09:41:54Z" level=info msg="Generating README Documentation for chart traefik"


![Version: 1.10.0](https://img.shields.io/badge/Version-1.10.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

A Traefik based Kubernetes ingress controller

**Homepage:** <https://traefik.io/>

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| mloiseleur | <[email protected]> | |
| darkweaver87 | <[email protected]> | |
| jnoordsij | | |

## Source Code

* <https://github.com/traefik/traefik-helm-chart>
* <https://github.com/traefik/traefik>

## Requirements

Kubernetes: `>=1.22.0-0`

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| deleteOnUninstall | bool | `false` | Set it to true if you want to uninstall CRDs when uninstalling this chart. By default, CRDs will be kept so your custom resources will not be deleted accidentally. |
| enabled | bool | `true` | Field that can be used as a condition when this chart is a dependency. This definition is only here as a placeholder such that it is included in the json schema. See https://helm.sh/docs/chart_best_practices/dependencies/#conditions-and-tags for more info. |
| gatewayAPI | bool | `false` | Set it to true to install GatewayAPI CRDs. Needed if you set providers.kubernetesGateway.enabled to true in main chart Cannot be used together with gatewayAPIExperimental |
| gatewayAPIExperimental | bool | `false` | Set it to true to install experimental GatewayAPI CRDs. This includes additional experimental features beyond the standard Gateway API Cannot be used together with gatewayAPI |
| global | object | `{}` | Global values This definition is only here as a placeholder such that it is included in the json schema. |
| hub | bool | `false` | Set it to true to install Traefik Hub CRDs. Needed if you set hub.enabled to true in main chart |
| traefik | bool | `true` | Install Traefik CRDs by default |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
Loading