Skip to content

Conversation

@svenska-primekey
Copy link

Changes Made

  1. values.yaml:42-50

Added configuration options:

  • serviceAccount.automountServiceAccountToken: false (default)
  • serviceAccount.projectedTokenVolume.expirationSeconds: 3607
  • serviceAccount.projectedTokenVolume.defaultMode: 0444
  1. serviceaccount.yaml:15

Added automountServiceAccountToken field that respects the values.yaml setting

  1. deployment.yaml:31-40

Added conditional projected volume for service account token when automountServiceAccountToken is false

  1. deployment.yaml:70-75

Added conditional volumeMount to mount the projected token at the standard location

How It Works

When serviceAccount.automountServiceAccountToken is set to false:

  • The ServiceAccount explicitly disables automatic token mounting
  • A projected volume is created with a time-bound service account token
  • The token is mounted at /var/run/secrets/kubernetes.io/serviceaccount (standard location)
  • The token expires after 3607 seconds and is automatically rotated by Kubernetes

This approach provides better security by:

  • Using short-lived tokens instead of permanent ones
  • Maintaining compatibility with applications expecting tokens at the standard path
  • Supporting the automountServiceAccountToken: false security requirement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants