--- apiVersion: kyverno.io/v1 kind: ClusterPolicy metadata: name: require-certain-labels spec: admission: true background: true rules: - match: any: - resources: kinds: - Pod name: validate-certain-labels validate: anyPattern: - metadata: labels: app.kubernetes.io/name: ?* - metadata: labels: app.kubernetes.io/component: ?* message: The label `app.kubernetes.io/name` or `app.kubernetes.io/component` is required. validationFailureAction: Audit