scale-catalog/premium/traefik/27.0.13/templates/middlewares/geoblock.yaml
Julian Haseleu 5d1ab94342 cleanup
2024-07-14 21:54:53 +00:00

30 lines
1.2 KiB
YAML

{{- range $index, $middlewareData := .Values.middlewares.geoBlock }}
---
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:
GeoBlock:
allowLocalRequests: {{ $middlewareData.allowLocalRequests }}
logLocalRequests: {{ $middlewareData.logLocalRequests }}
logAllowedRequests: {{ $middlewareData.logAllowedRequests }}
logApiRequests: {{ $middlewareData.logApiRequests }}
api: {{ $middlewareData.api }}
apiTimeoutMs: {{ $middlewareData.apiTimeoutMs }}
cacheSize: {{ $middlewareData.cacheSize }}
forceMonthlyUpdate: {{ $middlewareData.forceMonthlyUpdate }}
allowUnknownCountries: {{ $middlewareData.allowUnknownCountries }}
unknownCountryApiResponse: {{ $middlewareData.unknownCountryApiResponse }}
blackListMode: {{ $middlewareData.blackListMode }}
{{- if not $middlewareData.countries -}}
{{- fail "You have to define at least one country..." -}}
{{- end }}
countries:
{{- range $middlewareData.countries }}
- {{ . }}
{{- end }}
{{- end -}}