Skip to content

Commit

Permalink
feat(Traefik Proxy): add abortOnPluginFailure field
Browse files Browse the repository at this point in the history
  • Loading branch information
bmagic authored Nov 26, 2024
1 parent 40473e8 commit b932958
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions traefik/VALUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Kubernetes: `>=1.22.0-0`
| deployment.terminationGracePeriodSeconds | int | `60` | Amount of time (in seconds) before Kubernetes will send the SIGKILL signal if Traefik does not shut down |
| env | list | See _values.yaml_ | Additional Environment variables to be passed to Traefik's binary |
| envFrom | list | `[]` | Environment variables to be passed to Traefik's binary from configMaps or secrets |
| experimental.abortOnPluginFailure | bool | `false` | Defines whether all plugins must be loaded successfully for Traefik to start |
| experimental.kubernetesGateway.enabled | bool | `false` | Enable traefik experimental GatewayClass CRD |
| experimental.plugins | object | `{}` | Enable traefik experimental plugins |
| extraObjects | list | `[]` | Extra objects to deploy (value evaluated as a template) In some cases, it can avoid the need for additional, extended or adhoc deployments. See #595 for more details and traefik/tests/values/extra.yaml for example. |
Expand Down
3 changes: 3 additions & 0 deletions traefik/templates/_podtemplate.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,9 @@
- "--experimental.plugins.{{ $pluginName }}.moduleName={{ $plugin.moduleName }}"
- "--experimental.plugins.{{ $pluginName }}.version={{ $plugin.version }}"
{{- end }}
{{- if and (semverCompare ">=3.2.1-0" $version) (.Values.experimental.abortOnPluginFailure)}}
- "--experimental.abortonpluginfailure={{ .Values.experimental.abortOnPluginFailure }}"
{{- end }}
{{- if .Values.providers.kubernetesCRD.enabled }}
- "--providers.kubernetescrd"
{{- if .Values.providers.kubernetesCRD.labelSelector }}
Expand Down
8 changes: 8 additions & 0 deletions traefik/tests/deployment-config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,14 @@ tests:
- --providers.kubernetesingress.ingressendpoint.publishedservice=NAMESPACE/RELEASE-NAME-traefik
- --entryPoints.websecure.http.tls=true
- --log.level=INFO
- it: should have abortOnPluginFailure, when enabled
set:
experimental:
abortOnPluginFailure: true
asserts:
- contains:
path: spec.template.spec.containers[0].args
content: "--experimental.abortonpluginfailure=true"
- it: should have http redirections enabled, when enabled with redirectTo
set:
ports:
Expand Down
3 changes: 3 additions & 0 deletions traefik/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@
},
"experimental": {
"properties": {
"abortOnPluginFailure": {
"type": "boolean"
},
"kubernetesGateway": {
"properties": {
"enabled": {
Expand Down
2 changes: 2 additions & 0 deletions traefik/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ core: # @schema additionalProperties: false

# Traefik experimental features
experimental:
# -- Defines whether all plugins must be loaded successfully for Traefik to start
abortOnPluginFailure: false
# -- Enable traefik experimental plugins
plugins: {}
# demo:
Expand Down

0 comments on commit b932958

Please sign in to comment.