gatekeeper
gatekeeper copied to clipboard
No warning displayed on kubectl apply with enforcementAction warn
What steps did you take and what happened:
- OPA Gatekeeper is installed in the k8s cluster
- A constraint has been created
- On
enforcementAction: deny
, resource admission is denied on constraint violation, with a proper message onkubectl apply
- On
enforcementAction: warn
, no warning message is displayed onkubectl apply
, even if resources violates the constraint/
What did you expect to happen: A warning message would be printed according to the Warn enforcement action.
Anything else you would like to add:
- Gatekeeper has been deployed via gatekeeper.yaml
- A proper message is printed when
enforcementAction
is set to deny - If
--log-denies
is set, a constrain violation get logged correctly on both warn and deny. - Based of
kubectl --v=9
andGatekeeper’s --logdenies
, a constrain violation gets logged in stderr of the gatekeeper’s pod but kubectl does not get a HTTP 299 response but 201 instead - Any debugging tips or requests for an additional information are welcome
Environment:
- Gatekeeper version: 3.13.0
- Kubernetes version:
Client Version: v1.27.11
Kustomize Version: v5.0.1
Server Version: v1.27.9