From 8f8669bb97f88be62e181665f922e58fbff3a367 Mon Sep 17 00:00:00 2001 From: Anurag Rajawat Date: Thu, 11 Jul 2024 20:16:51 +0530 Subject: [PATCH] fix: Update relay clusterrole to watch pods Signed-off-by: Anurag Rajawat --- deployments/get/objects.go | 5 +++-- deployments/helm/KubeArmor/templates/RBAC/roles.yaml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/deployments/get/objects.go b/deployments/get/objects.go index c7c5a44b2..5a072cb61 100644 --- a/deployments/get/objects.go +++ b/deployments/get/objects.go @@ -6,7 +6,6 @@ package deployments import ( "strconv" - cfg "github.com/kubearmor/KubeArmor/KubeArmor/config" admissionregistrationv1 "k8s.io/api/admissionregistration/v1" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" @@ -14,6 +13,8 @@ import ( "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" + + cfg "github.com/kubearmor/KubeArmor/KubeArmor/config" ) // GetServiceAccount Function @@ -220,7 +221,7 @@ func GetRelayClusterRole() *rbacv1.ClusterRole { { APIGroups: []string{""}, Resources: []string{"pods"}, - Verbs: []string{"get", "list"}, + Verbs: []string{"list", "watch"}, }, }, } diff --git a/deployments/helm/KubeArmor/templates/RBAC/roles.yaml b/deployments/helm/KubeArmor/templates/RBAC/roles.yaml index 9d2a2b4e9..f2489e013 100644 --- a/deployments/helm/KubeArmor/templates/RBAC/roles.yaml +++ b/deployments/helm/KubeArmor/templates/RBAC/roles.yaml @@ -70,8 +70,8 @@ rules: resources: - pods verbs: - - get - list + - watch --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole