Restart authelia on acl config update
This commit is contained in:
parent
4ae76d668e
commit
00a9f25d5c
|
@ -18,7 +18,8 @@ spec:
|
|||
- resources:
|
||||
kinds:
|
||||
- Secret
|
||||
name: authelia-acl
|
||||
names:
|
||||
- authelia-acl
|
||||
namespaces:
|
||||
- authelia
|
||||
context:
|
||||
|
|
|
@ -3,3 +3,4 @@ kind: Kustomization
|
|||
resources:
|
||||
- ./kube-vip-network-adapter.yaml
|
||||
- ./generate-authelia-acl.yaml
|
||||
- ./restart-on-secret-change.yaml
|
||||
|
|
43
infra/kyverno-policies/restart-on-secret-change.yaml
Normal file
43
infra/kyverno-policies/restart-on-secret-change.yaml
Normal file
|
@ -0,0 +1,43 @@
|
|||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
metadata:
|
||||
name: restart-deployment-on-secret-change
|
||||
annotations:
|
||||
policies.kyverno.io/title: Restart Deployment On Secret Change
|
||||
policies.kyverno.io/category: Other
|
||||
policies.kyverno.io/severity: medium
|
||||
policies.kyverno.io/subject: Deployment
|
||||
kyverno.io/kyverno-version: 1.7.0
|
||||
policies.kyverno.io/minversion: 1.7.0
|
||||
kyverno.io/kubernetes-version: "1.23"
|
||||
spec:
|
||||
mutateExistingOnPolicyUpdate: false
|
||||
rules:
|
||||
- name: update-secret
|
||||
skipBackgroundRequests: false
|
||||
match:
|
||||
any:
|
||||
- resources:
|
||||
kinds:
|
||||
- Secret
|
||||
names:
|
||||
- authelia-acl
|
||||
namespaces:
|
||||
- authelia
|
||||
preconditions:
|
||||
all:
|
||||
- key: "{{request.operation || 'BACKGROUND'}}"
|
||||
operator: Equals
|
||||
value: UPDATE
|
||||
mutate:
|
||||
targets:
|
||||
- apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: authelia
|
||||
namespace: authelia
|
||||
patchStrategicMerge:
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
config.huizinga.dev/triggerRestart: "{{request.object.metadata.resourceVersion}}"
|
|
@ -28,6 +28,12 @@ backgroundController:
|
|||
verbs:
|
||||
- get
|
||||
- update
|
||||
- apiGroups:
|
||||
- "apps"
|
||||
resources:
|
||||
- "deployments"
|
||||
verbs:
|
||||
- update
|
||||
cleanupController:
|
||||
replicas: 2
|
||||
reportsController:
|
||||
|
|
Loading…
Reference in New Issue
Block a user