From 6143bff4d752b0c462ee0b104c3714371c0eba6e Mon Sep 17 00:00:00 2001 From: Gregory Bloquel Date: Wed, 9 Apr 2025 14:04:26 +0200 Subject: [PATCH] feat(helm): add option to disable rbac creation --- .../fluent-operator/templates/fluent-operator-clusterRole.yaml | 2 +- .../templates/fluent-operator-clusterRoleBinding.yaml | 2 +- charts/fluent-operator/values.yaml | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/charts/fluent-operator/templates/fluent-operator-clusterRole.yaml b/charts/fluent-operator/templates/fluent-operator-clusterRole.yaml index 8b610e98..dafe3fe6 100644 --- a/charts/fluent-operator/templates/fluent-operator-clusterRole.yaml +++ b/charts/fluent-operator/templates/fluent-operator-clusterRole.yaml @@ -1,4 +1,4 @@ -{{- if .Values.operator.enable }} +{{- if and .Values.operator.enable .Values.operator.rbac.create}} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: diff --git a/charts/fluent-operator/templates/fluent-operator-clusterRoleBinding.yaml b/charts/fluent-operator/templates/fluent-operator-clusterRoleBinding.yaml index e346ade2..0a44ae36 100644 --- a/charts/fluent-operator/templates/fluent-operator-clusterRoleBinding.yaml +++ b/charts/fluent-operator/templates/fluent-operator-clusterRoleBinding.yaml @@ -1,4 +1,4 @@ -{{- if .Values.operator.enable }} +{{- if and .Values.operator.enable .Values.operator.rbac.create}} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: diff --git a/charts/fluent-operator/values.yaml b/charts/fluent-operator/values.yaml index 093a7860..714b3b39 100644 --- a/charts/fluent-operator/values.yaml +++ b/charts/fluent-operator/values.yaml @@ -38,6 +38,9 @@ operator: priorityClassName: "" # Pod security context for Fluent Operator. Ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ podSecurityContext: {} + rbac: + # -- Specifies whether to create the ClusterRole and ClusterRoleBinding. + create: true # Container security context for Fluent Operator container. Ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ securityContext: {} # Fluent Operator resources. Usually user needn't to adjust these.