2023-09-18 00:24:26 +02:00
|
|
|
---
|
2023-09-07 00:02:48 +02:00
|
|
|
apiVersion: kyverno.io/v1
|
|
|
|
kind: ClusterPolicy
|
|
|
|
metadata:
|
|
|
|
annotations:
|
|
|
|
pod-policies.kyverno.io/autogen-controllers: none
|
|
|
|
policies.kyverno.io/category: Pod Security Standards (Restricted)
|
2023-09-18 00:24:26 +02:00
|
|
|
policies.kyverno.io/severity: medium
|
|
|
|
name: pod-requirements
|
2023-09-07 00:02:48 +02:00
|
|
|
spec:
|
2023-09-18 00:24:26 +02:00
|
|
|
admission: true
|
2023-09-07 00:02:48 +02:00
|
|
|
background: false
|
|
|
|
rules:
|
2023-09-18 00:24:26 +02:00
|
|
|
- match:
|
|
|
|
any:
|
|
|
|
- resources:
|
|
|
|
kinds:
|
|
|
|
- Pod
|
|
|
|
name: pods-require-account
|
2023-09-07 00:02:48 +02:00
|
|
|
validate:
|
|
|
|
message: User pods must include an account for charging
|
|
|
|
pattern:
|
|
|
|
metadata:
|
|
|
|
labels:
|
2023-09-18 00:24:26 +02:00
|
|
|
account: '*?'
|
|
|
|
- match:
|
|
|
|
any:
|
|
|
|
- resources:
|
|
|
|
kinds:
|
|
|
|
- Pod
|
|
|
|
name: pods-require-limits
|
2023-09-07 00:02:48 +02:00
|
|
|
validate:
|
|
|
|
message: CPU and memory resource requests and limits are required for user pods
|
|
|
|
pattern:
|
|
|
|
spec:
|
|
|
|
containers:
|
|
|
|
- resources:
|
|
|
|
limits:
|
2023-09-18 00:24:26 +02:00
|
|
|
cpu: ?*
|
|
|
|
memory: ?*
|
|
|
|
requests:
|
|
|
|
cpu: ?*
|
|
|
|
memory: ?*
|
|
|
|
validationFailureAction: Audit
|