mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-10 01:46:55 +00:00
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com> Co-authored-by: shuting <shuting@nirmata.com>
32 lines
754 B
YAML
32 lines
754 B
YAML
---
|
|
apiVersion: kyverno.io/v1
|
|
kind: ClusterPolicy
|
|
metadata:
|
|
name: policy-reload-on-secret-update
|
|
spec:
|
|
rules:
|
|
- name: update-secret
|
|
match:
|
|
any:
|
|
- resources:
|
|
kinds:
|
|
- Secret
|
|
names:
|
|
- applicationsecret
|
|
preconditions:
|
|
all:
|
|
- key: "{{ request.operation || 'BACKGROUND' }}"
|
|
operator: Equals
|
|
value: UPDATE
|
|
mutate:
|
|
mutateExistingOnPolicyUpdate: false
|
|
targets:
|
|
- apiVersion: apps/v1
|
|
kind: Deployment
|
|
name: monitor-grafana
|
|
patchStrategicMerge:
|
|
spec:
|
|
template:
|
|
metadata:
|
|
annotations:
|
|
example.com/triggerrestart: "{{ request.object.metadata.resourceVersion }}"
|