TrueChartsClone/charts/premium/traefik/templates/middlewares/modsecurity.yaml

15 lines
529 B
YAML
Raw Normal View History

feat(traefik): BREAKING CHANGE register traefik and use traefik namespace for middleware instead of tc-system (#11086) **Description** With the removal of manifest manager tc-system is removed for new users. Traefik should use it's own namespace for middlewares instead and common is already adapted to allow this. This change also allows us to throw errors if traefik isn't installed on a system when ingress is enabled. Downside is that this currently breaks ingressclass, which is a non-supported setup currently, untill we do more R&D for cleanly handling ingressClasses, namespaces and middlewares correctly. Also adds helm and SCALE support for the modsecurity plugin. Also fixes CI bug with metallb. **⚙️ Type of change** - [x] ⚙️ Feature/App addition - [x] 🪛 Bugfix - [x] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [x] 🔃 Refactor of current code **🧪 How Has This Been Tested?** <!-- Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration --> **📃 Notes:** <!-- Please enter any other relevant information here --> **✔️ Checklist:** - [ ] ⚖️ My code follows the style guidelines of this project - [ ] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [ ] ⚠️ My changes generate no new warnings - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [ ] ⬆️ I increased versions for any altered app according to semantic versioning **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🪞 I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._
2023-07-31 10:32:04 +00:00
{{- range $index, $middlewareData := .Values.middlewares.modsecurity }}
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: {{ ternary (printf "%v-%v" $.Release.Name $middlewareData.name) $middlewareData.name $.Values.ingressClass.enabled }}
namespace: {{ $.Release.Namespace }}
spec:
plugin:
traefik-modsecurity-plugin:
modSecurityUrl: {{ $middlewareData.modSecurityUrl }}
timeoutMillis: {{ $middlewareData.timeoutMillis }}
maxBodySize: {{ $middlewareData.maxBodySize }}
{{- end -}}