GPU-Live/template/prd/istio-1.23.1/manifests/charts/ztunnel/templates/rbac.yaml

70 lines
1.9 KiB
YAML

apiVersion: v1
kind: ServiceAccount
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- range . }}
- name: {{ . }}
{{- end }}
{{- end }}
metadata:
name: ztunnel
namespace: {{ .Release.Namespace }}
labels:
{{- template "istio-labels" -}}
{{ with .Values.labels -}}{{ toYaml . | nindent 4}}{{ end }}
annotations:
{{- if .Values.revision }}
{{- $annos := set $.Values.annotations "istio.io/rev" .Values.revision }}
{{- toYaml $annos | nindent 4}}
{{- else }}
{{- .Values.annotations | toYaml | nindent 4 }}
{{- end }}
---
{{- if (eq .Values.platform "openshift") }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: ztunnel
labels:
app: ztunnel
release: {{ .Release.Name }}
install.operator.istio.io/owning-resource: {{ .Values.ownerName | default "unknown" }}
annotations:
{{- if .Values.revision }}
{{- $annos := set $.Values.annotations "istio.io/rev" .Values.revision }}
{{- toYaml $annos | nindent 4}}
{{- else }}
{{- .Values.annotations | toYaml | nindent 4 }}
{{- end }}
rules:
- apiGroups: ["security.openshift.io"]
resources: ["securitycontextconstraints"]
resourceNames: ["privileged"]
verbs: ["use"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: ztunnel
labels:
app: ztunnel
release: {{ .Release.Name }}
install.operator.istio.io/owning-resource: {{ .Values.ownerName | default "unknown" }}
annotations:
{{- if .Values.revision }}
{{- $annos := set $.Values.annotations "istio.io/rev" .Values.revision }}
{{- toYaml $annos | nindent 4}}
{{- else }}
{{- .Values.annotations | toYaml | nindent 4 }}
{{- end }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: ztunnel
subjects:
- kind: ServiceAccount
name: ztunnel
namespace: {{ .Release.Namespace }}
{{- end }}
---