Add missing RBAC to k8s

Missing RBAC for service accounts
This commit is contained in:
Maidul Islam
2024-06-14 10:57:08 -04:00
parent fb1b816be6
commit 56506b5a47
4 changed files with 18 additions and 2 deletions

View File

@@ -27,6 +27,14 @@ rules:
- list
- update
- watch
- apiGroups:
- ""
resources:
- serviceaccounts
verbs:
- get
- list
- watch
- apiGroups:
- apps
resources:

View File

@@ -12,7 +12,7 @@ spec:
authentication:
# Native Kubernetes Auth
kubernetesAuth:
identityId: <>
identityId: 8c0c9823-7249-4043-b292-a861fb9b1b50
serviceAccountRef:
name: infisical-auth
namespace: default

View File

@@ -28,6 +28,7 @@ type InfisicalSecretReconciler struct {
//+kubebuilder:rbac:groups="",resources=secrets,verbs=get;list;watch;create;update;delete
//+kubebuilder:rbac:groups="",resources=configmaps,verbs=get;list;watch;create;update;delete
//+kubebuilder:rbac:groups=apps,resources=deployments,verbs=list;watch;get;update
//+kubebuilder:rbac:groups="",resources=serviceaccounts,verbs=get;list;watch
// Reconcile is part of the main kubernetes reconciliation loop which aims to
// move the current state of the cluster closer to the desired state.
@@ -75,7 +76,6 @@ func (r *InfisicalSecretReconciler) Reconcile(ctx context.Context, req ctrl.Requ
err := r.Get(ctx, req.NamespacedName, &infisicalSecretCR)
if err != nil {
if errors.IsNotFound(err) {
fmt.Printf("\nInfisical Secret CRD not found [err=%v]", err)
return ctrl.Result{
Requeue: false,
}, nil