# scope: GlobalInControlPlane — applies each plugin to all traffic in this # domain's Control Plane, no route/service target needed (verified real # mechanism, see tasks-rate-limiting-global-binding in # ~/dev/kong/kube/apis/tasks-api/pluginbindings.yaml). # # controlPlaneRef.konnectNamespacedRef.name is ${CONTROL_PLANE_REF_NAME}, # NOT ${NAME}. The KonnectGatewayControlPlane the operator creates from # GatewayConfiguration's `mirror` is auto-named with a random suffix # (catalog-dev-bkphl, not catalog-dev), so this value used to be looked up by # hand after the first reconcile and pasted in per domain — and it went stale # without warning every time the Gateway was recreated. # # It now names the mirror CR declared in # k8s-platform/dataplane-template/controlplane-mirror.yaml, whose name IS # derived from ${NAME} (${NAME}-cp) and therefore stable. The operator's own # auto-named mirror still exists alongside it; both point at the same control # plane id and neither owns its lifecycle. apiVersion: configuration.konghq.com/v1alpha1 kind: KongPluginBinding metadata: name: ${NAME}-openid-connect-binding namespace: ${NAMESPACE} spec: controlPlaneRef: type: konnectNamespacedRef konnectNamespacedRef: name: ${CONTROL_PLANE_REF_NAME} pluginRef: name: ${NAME}-openid-connect scope: GlobalInControlPlane --- apiVersion: configuration.konghq.com/v1alpha1 kind: KongPluginBinding metadata: name: ${NAME}-rate-limiting-binding namespace: ${NAMESPACE} spec: controlPlaneRef: type: konnectNamespacedRef konnectNamespacedRef: name: ${CONTROL_PLANE_REF_NAME} pluginRef: name: ${NAME}-rate-limiting scope: GlobalInControlPlane --- apiVersion: configuration.konghq.com/v1alpha1 kind: KongPluginBinding metadata: name: ${NAME}-cors-binding namespace: ${NAMESPACE} spec: controlPlaneRef: type: konnectNamespacedRef konnectNamespacedRef: name: ${CONTROL_PLANE_REF_NAME} pluginRef: name: ${NAME}-cors scope: GlobalInControlPlane --- apiVersion: configuration.konghq.com/v1alpha1 kind: KongPluginBinding metadata: name: ${NAME}-request-size-limiting-binding namespace: ${NAMESPACE} spec: controlPlaneRef: type: konnectNamespacedRef konnectNamespacedRef: name: ${CONTROL_PLANE_REF_NAME} pluginRef: name: ${NAME}-request-size-limiting scope: GlobalInControlPlane --- apiVersion: configuration.konghq.com/v1alpha1 kind: KongPluginBinding metadata: name: ${NAME}-correlation-id-binding namespace: ${NAMESPACE} spec: controlPlaneRef: type: konnectNamespacedRef konnectNamespacedRef: name: ${CONTROL_PLANE_REF_NAME} pluginRef: name: ${NAME}-correlation-id scope: GlobalInControlPlane --- apiVersion: configuration.konghq.com/v1alpha1 kind: KongPluginBinding metadata: name: ${NAME}-hide-5xx-details-binding namespace: ${NAMESPACE} spec: controlPlaneRef: type: konnectNamespacedRef konnectNamespacedRef: name: ${CONTROL_PLANE_REF_NAME} pluginRef: name: ${NAME}-hide-5xx-details scope: GlobalInControlPlane --- apiVersion: configuration.konghq.com/v1alpha1 kind: KongPluginBinding metadata: name: ${NAME}-prometheus-binding namespace: ${NAMESPACE} spec: controlPlaneRef: type: konnectNamespacedRef konnectNamespacedRef: name: ${CONTROL_PLANE_REF_NAME} pluginRef: name: ${NAME}-prometheus scope: GlobalInControlPlane --- apiVersion: configuration.konghq.com/v1alpha1 kind: KongPluginBinding metadata: name: ${NAME}-opentelemetry-binding namespace: ${NAMESPACE} spec: controlPlaneRef: type: konnectNamespacedRef konnectNamespacedRef: name: ${CONTROL_PLANE_REF_NAME} pluginRef: name: ${NAME}-opentelemetry scope: GlobalInControlPlane