rancher-partner-charts/charts/kubecost/cost-analyzer/templates/network-costs-role.template...

25 lines
745 B
YAML

{{- if .Values.networkCosts }}
{{- if .Values.networkCosts.enabled }}
{{- if .Values.networkCosts.podSecurityPolicy }}
{{- if .Values.networkCosts.podSecurityPolicy.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ template "cost-analyzer.fullname" . }}-network-costs
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
annotations:
{{- if .Values.networkCosts.podSecurityPolicy.annotations }}
{{ toYaml .Values.networkCosts.podSecurityPolicy.annotations | indent 4 }}
{{- end }}
rules:
- apiGroups: ['extensions']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames:
- {{ template "cost-analyzer.fullname" . }}-network-costs
{{- end }}
{{- end }}
{{- end }}
{{- end }}