Skip to content

[helm-charts] add tpl to serviceAccount.annotations #2392

@denzhel

Description

@denzhel

Is your feature request related to a problem?
We're using Argo ApplicationSet to manage our infra while having a structure of global config and environment config that overrides.
Since fields in ALL charts does not include the tpl/template function, we cannot have a global config for each controller:

apigateway:
  aws:
    region: {{ .Values.global.region }}
  serviceAccount:
    annotations:
      eks.amazonaws.com/role-arn: arn:aws:iam::{{ .Values.global.accountId }}:role/{{ .Values.global.env }}-ack-apigateway-controller

rather repeat the code and change the cluster's name, region and account for each cluster.

Describe the solution you'd like
I'd like to template the serviceAccount.annotations field in all ACK helm charts by changing the

  annotations:
  {{- range $key, $value := .Values.serviceAccount.annotations }}
    {{ $key }}: {{ $value | quote }}

block to

{{- with .Values.serviceAccount.annotations }}
  annotations:
{{ tpl (toYaml .) $ | indent 4 }}

Describe alternatives you've considered
Not a very good one - repeating the code :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/helmIssues or PRs related to Helm chartskind/featureCategorizes issue or PR as related to a new feature.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions