scale-catalog/premium/traefik/27.0.14/templates/middlewares/geoblock.yaml

30 lines
1.2 KiB
YAML
Raw Normal View History

2024-07-13 07:59:30 +00:00
{{- 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 -}}