Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: add disableAutomountServiceAccountToken field #1265

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

f41gh7
Copy link
Collaborator

@f41gh7 f41gh7 commented Mar 9, 2025

This setting improves application security and simplifies it's
configuration.

Security rules for cloud provides may forbid implicit serviceAccount
token mounting into the Pod. Such as AKS see the following example: VictoriaMetrics/helm-charts#2006 (comment)

This commit allows to disable default behavior by changing Statefulset and Deployment spec.template.spec.automountServiceAccountToken setting. It prevents token volume mount by controller-manager.

In addition, operator explicitly adds Kubernetes API access to the
following objects:

  • VMAgent vmagent and config-reloader containers.
  • VMAuth config-reloader and init-config containers - if useVMConfigReloader: true is set.
  • VMAlertmanager config-reloader and init-config - if useVMConfigReloader: true is set.

Operator adds volume with name kube-api-access and volumeMount with
path /var/run/secrets/kubernetes.io/serviceaccount.

Related issue:
#1255

  This setting improves application security and simplifies it's
configuration.

  Security rules for cloud provides may forbid implicit serviceAccount
token mounting into the Pod. Such as AKS see the following example:
VictoriaMetrics/helm-charts#2006 (comment)

 This commit allows to disable default behavior by changing `Statefulset` and `Deployment` `spec.template.spec.automountServiceAccountToken` setting. It prevents token volume mount by controller-manager.

 In addition, operator explicitly adds Kubernetes API access to the
following objects:
* VMAgent vmagent and config-reloader containers.
* VMAuth config-reloader and init-config containers - if useVMConfigReloader: true is set.
* VMAlertmanager config-reloader and init-config - if useVMConfigReloader: true is set.

 Operator adds volume with name `kube-api-access` and volumeMount with
 path `/var/run/secrets/kubernetes.io/serviceaccount`.

Related issue:
#1255
@f41gh7 f41gh7 removed the request for review from AndrewChubatiuk March 9, 2025 22:20
Copy link
Contributor

@AndrewChubatiuk AndrewChubatiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

3 participants