cluster-api-provider-vsphere icon indicating copy to clipboard operation
cluster-api-provider-vsphere copied to clipboard

Do not reuse the default ServiceAccount

Open sathieu opened this issue 6 months ago • 2 comments
trafficstars

/kind feature

Describe the solution you'd like

Currently the provider uses the default k8s ServiceAccount.

Please create a specific one, and:

  • use it in the Deployment
  • use it in the capv-leader-election-rolebinding RoleBinding`
  • use it in the capv-manager-rolebinding ClusterRoleBinding

This will allow the provider to work when automountServiceAccountToken is set to false in the default ServiceAccount and in the created pods.

Anything else you would like to add:

Some references :

  • https://kubeops.net/kubernetes-security-library/measures/36-best-practices-for-deactivating-auto-mount-and-managing-serviceaccounts
  • https://github.com/open-policy-agent/gatekeeper-library/issues/192#issuecomment-1109271416

Environment:

  • Cluster-api-provider-vsphere version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

sathieu avatar Apr 29 '25 11:04 sathieu

Sounds reasonable. I assume core CAPI already does that?

sbueringer avatar May 08 '25 05:05 sbueringer

Yes. It has serviceAccountName: manager (ref, ref2, ref3).

sathieu avatar May 10 '25 09:05 sathieu

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Aug 10 '25 08:08 k8s-triage-robot

/remove-lifecycle stale

sathieu avatar Sep 02 '25 20:09 sathieu

/help

sbueringer avatar Sep 03 '25 06:09 sbueringer

@sbueringer: This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed by commenting with the /remove-help command.

In response to this:

/help

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

k8s-ci-robot avatar Sep 03 '25 06:09 k8s-ci-robot