Files
kong-k8s-platform/dataplane-globalpolicy-template/global-policies-plugins.yaml
T

106 lines
2.2 KiB
YAML

apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: ${NAME}-openid-connect
namespace: ${NAMESPACE}
plugin: openid-connect
config:
issuer: ${OIDC_ISSUER}
audience_required: ${JWT_AUDIENCE_WHITELIST}
auth_methods:
- bearer
display_errors: false
ssl_verify: true
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: ${NAME}-rate-limiting
namespace: ${NAMESPACE}
plugin: rate-limiting-advanced
config:
limit:
- ${RATE_LIMIT_MINUTE}
window_size:
- 60
sync_rate: -1
strategy: local
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: ${NAME}-cors
namespace: ${NAMESPACE}
plugin: cors
config:
origins:
- ${CORS_ORIGINS}
methods:
- GET
- POST
- PUT
- PATCH
- DELETE
- OPTIONS
credentials: true
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: ${NAME}-request-size-limiting
namespace: ${NAMESPACE}
plugin: request-size-limiting
config:
allowed_payload_size: ${REQUEST_MAX_BODY_SIZE}
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: ${NAME}-correlation-id
namespace: ${NAMESPACE}
plugin: correlation-id
config:
header_name: X-Correlation-ID
generator: uuid
echo_downstream: true
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: ${NAME}-hide-5xx-details
namespace: ${NAMESPACE}
plugin: response-transformer-advanced
config:
replace:
body: '{"error": "internal_server_error", "message": "An unexpected error occurred."}'
if_status:
- "500"
- "502"
- "503"
- "504"
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: ${NAME}-prometheus
namespace: ${NAMESPACE}
plugin: prometheus
config:
status_code_metrics: true
latency_metrics: true
bandwidth_metrics: true
upstream_health_metrics: true
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: ${NAME}-opentelemetry
namespace: ${NAMESPACE}
plugin: opentelemetry
config:
traces_endpoint: ${OTEL_TRACES_ENDPOINT}
resource_attributes:
service.name: ${NAME}
sampling_rate: 1
http_response_header_for_traceid: X-Trace-Id