diff --git a/charts/portainer-agent/templates/deployment.yaml b/charts/portainer-agent/templates/deployment.yaml index c5b4e7e..eca995a 100644 --- a/charts/portainer-agent/templates/deployment.yaml +++ b/charts/portainer-agent/templates/deployment.yaml @@ -22,7 +22,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "portainer-agent.fullname" . }} + serviceAccountName: {{ include "portainer-agent.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: diff --git a/charts/portainer-agent/templates/rbac.yaml b/charts/portainer-agent/templates/rbac.yaml index d8174c9..b4ef421 100644 --- a/charts/portainer-agent/templates/rbac.yaml +++ b/charts/portainer-agent/templates/rbac.yaml @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: {{ include "portainer-agent.fullname" . }} + name: {{ include "portainer-agent.serviceAccountName" . }}-crb labels: {{- include "portainer-agent.labels" . | nindent 4 }} roleRef: @@ -11,6 +11,6 @@ roleRef: name: cluster-admin subjects: - kind: ServiceAccount - name: {{ include "portainer-agent.fullname" . }} + name: {{ include "portainer-agent.serviceAccountName" . }} namespace: {{ .Release.Namespace }} {{- end }} \ No newline at end of file diff --git a/charts/portainer-agent/templates/serviceaccount.yaml b/charts/portainer-agent/templates/serviceaccount.yaml index adf6ad9..ba32dcb 100644 --- a/charts/portainer-agent/templates/serviceaccount.yaml +++ b/charts/portainer-agent/templates/serviceaccount.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: {{ include "portainer-agent.fullname" . }} + name: {{ include "portainer-agent.serviceAccountName" . }} labels: {{- include "portainer-agent.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} diff --git a/charts/portainer-agent/values.yaml b/charts/portainer-agent/values.yaml index f309a6a..255ef5a 100644 --- a/charts/portainer-agent/values.yaml +++ b/charts/portainer-agent/values.yaml @@ -89,7 +89,7 @@ serviceAccount: annotations: {} # Name of the service account to use # If not set, a name is generated using the fullname template - name: "" + name: portainer-sa-clusteradmin # Pod security context podSecurityContext: {}