Implement Traefik Error Middleware
This commit is contained in:
27957
catalog.json
27957
catalog.json
File diff suppressed because it is too large
Load Diff
@@ -306,6 +306,15 @@ serviceAccount:
|
||||
primary: true
|
||||
# -- SCALE Middleware Handlers
|
||||
middlewares:
|
||||
errors: []
|
||||
# - name: errorsName
|
||||
# statusCodes:
|
||||
# - "400-599"
|
||||
# query: "/{status}.html"
|
||||
# serviceName: "whoami"
|
||||
# serviceKind: Service
|
||||
# serviceNamespace: ix-traefik
|
||||
# servicePort: 80
|
||||
basicAuth: []
|
||||
# - name: basicauthexample
|
||||
# users:
|
||||
|
||||
@@ -455,6 +455,66 @@ questions:
|
||||
additional_attrs: true
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: errors
|
||||
label: Errors
|
||||
schema:
|
||||
type: list
|
||||
default: []
|
||||
items:
|
||||
- variable: errorsEntry
|
||||
label: ""
|
||||
schema:
|
||||
additional_attrs: true
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: name
|
||||
label: Name
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
default: ""
|
||||
- variable: statusCodes
|
||||
label: Status Codes
|
||||
schema:
|
||||
type: list
|
||||
default: [ ]
|
||||
items:
|
||||
- variable: statusCodesEntry
|
||||
label: "Status Codes Entry"
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
default: ""
|
||||
- variable: query
|
||||
label: Query
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
default: ""
|
||||
- variable: serviceKind
|
||||
label: Service Kind
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
default: ""
|
||||
- variable: serviceNamespace
|
||||
label: Service Namespace
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
default: ""
|
||||
- variable: serviceName
|
||||
label: Service Name
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
default: ""
|
||||
- variable: servicePort
|
||||
label: Service Port
|
||||
schema:
|
||||
type: int
|
||||
required: true
|
||||
default: 80
|
||||
- variable: basicAuth
|
||||
label: basicAuth
|
||||
schema:
|
||||
|
||||
@@ -70,6 +70,7 @@ args:
|
||||
{{- if $.Values.ingressClass.enabled }}
|
||||
- "--providers.kubernetesingress.ingressclass={{ .Release.Name }}"
|
||||
{{- end }}
|
||||
- "--providers.kubernetescrd.allowCrossNamespace=true"
|
||||
{{- range $entrypoint, $config := $ports }}
|
||||
{{/* add args for proxyProtocol support */}}
|
||||
{{- if $config.proxyProtocol }}
|
||||
|
||||
20
enterprise/traefik/25.4.0/templates/middlewares/errors.yaml
Normal file
20
enterprise/traefik/25.4.0/templates/middlewares/errors.yaml
Normal file
@@ -0,0 +1,20 @@
|
||||
{{- range $index, $middlewareData := .Values.middlewares.errors }}
|
||||
---
|
||||
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:
|
||||
errors:
|
||||
status:
|
||||
{{- range $middlewareData.statusCodes }}
|
||||
- "{{ . }}"
|
||||
{{- end }}
|
||||
query: {{ $middlewareData.query }}
|
||||
service:
|
||||
name: {{ $middlewareData.serviceName }}
|
||||
port: {{ $middlewareData.servicePort }}
|
||||
kind: {{ $middlewareData.serviceKind }}
|
||||
namespace: ix-{{ $middlewareData.serviceNamespace }}
|
||||
{{- end -}}
|
||||
@@ -823,6 +823,81 @@
|
||||
"additional_attrs": true,
|
||||
"type": "dict",
|
||||
"attrs": [
|
||||
{
|
||||
"variable": "errors",
|
||||
"label": "errors",
|
||||
"schema": {
|
||||
"type": "list",
|
||||
"default": [],
|
||||
"items": [
|
||||
{
|
||||
"variable": "errorsEntry",
|
||||
"label": "",
|
||||
"schema": {
|
||||
"additional_attrs": true,
|
||||
"type": "dict",
|
||||
"attrs": [
|
||||
{
|
||||
"variable": "name",
|
||||
"label": "Name",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"default": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"variable": "statusCodes",
|
||||
"label": "Status Codes",
|
||||
"schema": {
|
||||
"type": "list",
|
||||
"default": [],
|
||||
"items": [
|
||||
{
|
||||
"variable": "statusCodesEntry",
|
||||
"label": "",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"default": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"variable": "query",
|
||||
"label": "Query",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"default": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"variable": "serviceName",
|
||||
"label": "Service Name",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"default": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"variable": "servicePort",
|
||||
"label": "Service Port",
|
||||
"schema": {
|
||||
"type": "int",
|
||||
"required": true,
|
||||
"default": 80
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"variable": "basicAuth",
|
||||
"label": "basicAuth",
|
||||
|
||||
Reference in New Issue
Block a user