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

[FEATURE] [HELM] Add support to setup a custom serviceAccount #1179

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

marinoborges
Copy link

Fixes #1174 with backward compatibility so this should be a minor change.

Copy link

copy-pr-bot bot commented Feb 25, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Copy link
Collaborator

@ArangoGutierrez ArangoGutierrez left a comment

Choose a reason for hiding this comment

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

Hey @marinoborges thanks for the PR! a nice addition for sure, happy to review

@@ -52,9 +52,13 @@ spec:
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- if $useServiceAccount }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure about this, it could introduce a breaking change , we need to find a way that won't break existing users scripts that may rely on this existing HELM setup

Copy link
Author

Choose a reason for hiding this comment

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

It's not a breaking change because the existing logic is respected. It replaces this if with another one but still considering $useServiceAccount.

Copy link
Author

Choose a reason for hiding this comment

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

@ArangoGutierrez did you check what I mentioned?

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

PR Overview

This PR adds support for setting up a custom serviceAccount for the NVIDIA device plugin, ensuring backward compatibility. Key changes include adding new conditional checks in multiple templates to use a custom service account if specified, introducing new configuration values in values.yaml, and updating the service account creation logic across all relevant manifests.

Reviewed Changes

File Description
deployments/helm/nvidia-device-plugin/templates/service-account.yml Updated the service account creation logic to conditionally use a custom name and annotations if provided.
deployments/helm/nvidia-device-plugin/templates/daemonset-gfd.yml Modified the condition for including serviceAccountName to support a custom service account.
deployments/helm/nvidia-device-plugin/templates/daemonset-mps-control-daemon.yml Adjusted the service account condition and variable assignment to align with custom service account usage.
deployments/helm/nvidia-device-plugin/values.yaml Added new configuration options to control service account creation and custom naming.
deployments/helm/nvidia-device-plugin/templates/daemonset-device-plugin.yml Applied similar changes as in other daemonset manifests for custom service account support.

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

@@ -14,6 +14,7 @@
{{- if .Values.devicePlugin.enabled }}
---
{{- $options := (include "nvidia-device-plugin.options" . | fromJson) }}
{{- $useServiceAccount := $options.hasConfigMap }}
Copy link
Preview

Copilot AI Mar 3, 2025

Choose a reason for hiding this comment

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

The variable $useServiceAccount is assigned solely from $options.hasConfigMap, which may lead to inconsistent service account creation behavior compared to other templates that consider .Values.serviceAccount.create. Consider updating this assignment to include .Values.serviceAccount.create for consistency.

Suggested change
{{- $useServiceAccount := $options.hasConfigMap }}
{{- $useServiceAccount := or $options.hasConfigMap .Values.serviceAccount.create }}

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
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.

Helm Chart Unable to Specify Custom Service Account
2 participants