Skip to content

Commit

Permalink
Add service account token secret
Browse files Browse the repository at this point in the history
Signed-off-by: usimd <[email protected]>
  • Loading branch information
usimd committed Apr 28, 2024
1 parent 6bb4ca8 commit ff16805
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions charts/core-dump-handler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,3 +326,7 @@ Daemonset
* envFrom: Array of [EnvFromSource](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#envfromsource-v1-core) to inject into main container.
* sidecarContainers: Array of [Container](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#container-v1-core) to define as part of the pod.
* updateStrategy: [DaemonsetUpdateStrategy](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#daemonsetupdatestrategy-v1-apps) is a struct used to control the update strategy for the DaemonSet.
Service account:
* useToken: automatically create a service account token secret
* tokenSecretName: name of the service account token secret to create if `serviceAccount.useToken` is `true` (Default: "core-dump-service-account-token")
9 changes: 9 additions & 0 deletions charts/core-dump-handler/templates/sa-token-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{- if .Values.serviceAccount.useToken }}
apiVersion: v1
kind: Secret
metadata:
name: {{ default "core-dump-service-account-token" .Values.serviceAccount.tokenSecretName }}
annotations:
kubernetes.io/service-account.name: {{ include "core-dump-handler.serviceAccountName" . }}
type: kubernetes.io/service-account-token
{{- end }}
3 changes: 3 additions & 0 deletions charts/core-dump-handler/values.aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
daemonset:
includeCrioExe: true
vendor: rhel7 # EKS EC2 images have an old libc=2.26

serviceAccount:
useToken: true
2 changes: 2 additions & 0 deletions charts/core-dump-handler/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ serviceAccount:
name: "core-dump-admin"
# annotations:
# eks.amazonaws.com/role-arn: arn:aws:iam::123456789000:role/iam-role-name-here
useToken: false
tokenSecretName: core-dump-service-account-token

# OpenShift specific for SecurityContextConstraints
scc:
Expand Down

0 comments on commit ff16805

Please sign in to comment.