From b5e442d92b67c60091e6d17665089a30a6877d88 Mon Sep 17 00:00:00 2001 From: Danijel Simeunovic Date: Thu, 23 Apr 2026 21:25:11 +0200 Subject: [PATCH] policy --- cluster-resources/policies/label-checker.yaml | 41 ------------------- infra/values/base/keycloak-values.yaml | 14 +++---- 2 files changed, 7 insertions(+), 48 deletions(-) delete mode 100644 cluster-resources/policies/label-checker.yaml diff --git a/cluster-resources/policies/label-checker.yaml b/cluster-resources/policies/label-checker.yaml deleted file mode 100644 index 8a8efd3..0000000 --- a/cluster-resources/policies/label-checker.yaml +++ /dev/null @@ -1,41 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: require-labels - annotations: - policies.kyverno.io/title: Require Labels - policies.kyverno.io/category: Best Practices - policies.kyverno.io/minversion: 1.6.0 - policies.kyverno.io/severity: medium - policies.kyverno.io/subject: Pod, Label - policies.kyverno.io/description: Define and use labels that identify semantic attributes of your application or Deployment. A common set of labels allows tools to work collaboratively, describing objects in a common manner that all tools can understand. The recommended labels describe applications in a way that can be queried. This policy validates that the label `app.kubernetes.io/name` is specified with some value. -spec: - validationFailureAction: Audit - background: true - rules: - - name: check-for-labels - skipBackgroundRequests: true - exclude: - any: - - resources: - namespaces: - - kube-system - - istio-system - - argocd - - cert-manager - - monitoring - - secrets - - kyverno - - trivy-system - match: - any: - - resources: - kinds: - - Pod - validate: - message: The label `app.kubernetes.io/name` is required. - allowExistingViolations: true - pattern: - metadata: - labels: - app.kubernetes.io/name: "?*" diff --git a/infra/values/base/keycloak-values.yaml b/infra/values/base/keycloak-values.yaml index 7599515..18d8b37 100644 --- a/infra/values/base/keycloak-values.yaml +++ b/infra/values/base/keycloak-values.yaml @@ -116,12 +116,12 @@ extraDeploy: metadata: name: keycloak-client-registrar rules: - - apiGroups: [""] - resources: ["secrets"] - verbs: ["get", "list", "create", "update", "patch"] - - apiGroups: [""] - resources: ["namespaces"] - verbs: ["get", "list"] + - apiGroups: [ "" ] + resources: [ "secrets" ] + verbs: [ "get", "list", "create", "update", "patch" ] + - apiGroups: [ "" ] + resources: [ "namespaces" ] + verbs: [ "get", "list" ] # -- ClusterRoleBinding for the registrar ServiceAccount - apiVersion: rbac.authorization.k8s.io/v1 @@ -158,7 +158,7 @@ extraDeploy: containers: - name: registrar image: alpine:3.20 - command: ["/bin/sh", "-c"] + command: [ "/bin/sh", "-c" ] args: - | set -e