ce7cb702218693d08ea6d83464d2457c9250027c
This commit is contained in:
commit
34c5f8963c
1 changed files with 145336 additions and 0 deletions
70
vendor/platform/kyverno/policies/require-app-labels.yaml
vendored
Normal file
70
vendor/platform/kyverno/policies/require-app-labels.yaml
vendored
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
metadata:
|
||||
name: require-app-labels
|
||||
annotations:
|
||||
policies.kyverno.io/title: Require application identity labels
|
||||
policies.kyverno.io/category: Best Practices
|
||||
policies.kyverno.io/severity: medium
|
||||
policies.kyverno.io/description: >-
|
||||
Require application name and instance labels, accepting Dragonfly's native
|
||||
app identity in its namespace.
|
||||
spec:
|
||||
validationFailureAction: Enforce
|
||||
background: true
|
||||
rules:
|
||||
- name: require-app-name-and-instance
|
||||
match:
|
||||
any:
|
||||
- resources:
|
||||
kinds:
|
||||
- Pod
|
||||
exclude:
|
||||
any:
|
||||
- resources:
|
||||
namespaces:
|
||||
- kube-system
|
||||
- kube-public
|
||||
- kube-node-lease
|
||||
- flux-system
|
||||
- flux-canary
|
||||
- kyverno
|
||||
- cert-manager
|
||||
- cilium-secrets
|
||||
- olm
|
||||
- operators
|
||||
- longhorn
|
||||
- openebs
|
||||
- intel-system
|
||||
- nfd
|
||||
- dragonfly
|
||||
validate:
|
||||
message: >-
|
||||
Pod must have non-empty labels app.kubernetes.io/name and
|
||||
app.kubernetes.io/instance for Cilium and operational selectors.
|
||||
pattern:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: "?*"
|
||||
app.kubernetes.io/instance: "?*"
|
||||
- name: dragonfly-identity
|
||||
match:
|
||||
any:
|
||||
- resources:
|
||||
kinds:
|
||||
- Pod
|
||||
namespaces:
|
||||
- dragonfly
|
||||
validate:
|
||||
message: >-
|
||||
Pods require name and instance labels; Dragonfly cache Pods may use
|
||||
their native app label as the instance identity.
|
||||
anyPattern:
|
||||
- metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: "?*"
|
||||
app.kubernetes.io/instance: "?*"
|
||||
- metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: dragonfly
|
||||
app: "?*"
|
||||
Loading…
Reference in a new issue