{{- if and .Values.agent (not .Values.preflight.enabled) .Values.serviceAccounts.cilium.create .Values.ingressController.enabled .Values.ingressController.secretsNamespace.name }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: cilium-secrets
  namespace: {{ .Values.ingressController.secretsNamespace.name | quote }}
rules:
- apiGroups:
  - ""
  resources:
  - secrets
  verbs:
  - get
  - list
  - watch
{{- end }}
