Skip to content

[BUG]AutomountServiceAccountToken is hard-coded to false, breaking in-cluster Kubernetes API access from sidecars even when a ServiceAccount is explicitly configured #758

Open

Description

@Yao-MR

Describe the bug

Currently pod.Spec() hard-codes AutomountServiceAccountToken: false for every FE / BE / CN / FeProxy pod, regardless of whether the user has set spec.<role>.serviceAccount in the CR. This unconditionally prevents the ServiceAccount token from being projected to /var/run/secrets/kubernetes.io/serviceaccount/, so any in-cluster client (e.g. client-go rest.InClusterConfig()) running in the main container or a sidecar fails with:

Make the field conditional on whether a ServiceAccount was explicitly configured:

To Reproduce

Steps to reproduce the behavior:

in-cluster client (e.g. client-go rest.InClusterConfig()) running in the main container or a sidecar will fails

Expected behavior

The operator should respect the Kubernetes contract for automountServiceAccountToken:
User configuration
Expected automountServiceAccountToken on the pod
Rationale
spec..serviceAccount is empty / unset
Explicitly false
Preserve the intent of #184 — never auto-mount the namespace's default ServiceAccount token onto database pods.
spec..serviceAccount is explicitly set by the user
Leave it unset (nil), letting Kubernetes default to true
The user has opted in to a custom ServiceAccount and almost certainly wants its token projected to /var/run/secrets/kubernetes.io/serviceaccount/. Otherwise the field is useless.

Please complete the following information

  • Operator Version: [main]
  • Chart Name: [no]
  • Chart Version [no]

Activity

  1. added
    bug
    on May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions