fischer-agentkit/deploy/helm/agentkit/templates/serviceaccount.yaml

37 lines
1.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{- /*
ServiceAccount — 当 serviceAccount.create=true 时创建。
workloadIdentity.enabled=true 时:
1) automountServiceAccountToken=false禁用默认 token 投递)
2) 额外创建 type=service-account-token 的 Secretprojected token供 KMS/HSM 使用
*/ -}}
{{- if .Values.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "agentkit.serviceAccountName" . }}
labels:
{{- include "agentkit.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.workloadIdentity.enabled }}
automountServiceAccountToken: false
{{- end }}
{{- end }}
{{- if and .Values.serviceAccount.create .Values.workloadIdentity.enabled }}
---
# ponytail: projected SA token — 限时令牌,供 KMS/HSM workload identity 换取访问凭据。
# 升级路径:云厂商原生 workload identity 注解P1避免手动 token 投递)。
apiVersion: v1
kind: Secret
metadata:
name: {{ include "agentkit.serviceAccountName" . }}-token
namespace: {{ .Release.Namespace }}
labels:
{{- include "agentkit.labels" . | nindent 4 }}
annotations:
kubernetes.io/service-account.name: {{ include "agentkit.serviceAccountName" . }}
type: kubernetes.io/service-account-token
{{- end }}