workflow-test/charts/azure-agent/templates/rolebindings.yaml

20 lines
560 B
YAML
Raw Permalink Normal View History

2024-10-15 08:11:11 +00:00
{{- $sa_namespace := .Release.Namespace -}}
{{- $object_name := include "az-agent.serviceAccountName" . -}}
{{- $labels := include "az-agent.labels" . | nindent 4 -}}
{{- range .Values.build.namespaces }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ $object_name }}
namespace: {{ . }}
labels: {{ $labels }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: {{ $object_name }}
namespace: {{ $sa_namespace }}
{{ end }}