Skip to content

Conversation

@lx1036
Copy link

@lx1036 lx1036 commented Nov 20, 2025

What type of PR is this?

/kind enhancement

What this PR does / why we need it:

Add imagePullSecrets in helm chart, so we can helm install like:

helm upgrade --install kthena .. --namespace kthena-system --create-namespace --version 1.0.0 --set global.imagePullSecrets[0].name=docker-login

@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign lizhencheng9527 for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gemini-code-assist
Copy link

Summary of Changes

Hello @lx1036, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the Helm chart for the kthena application by integrating support for imagePullSecrets. This allows users to provide credentials for pulling container images from private registries, ensuring that components like the kthena-router and kthena-controller-manager can be deployed successfully in environments that require authenticated access to image repositories.

Highlights

  • Helm Chart Enhancement: Introduced the capability to specify imagePullSecrets within the Helm chart, allowing for authenticated image pulls from private registries.
  • Deployment Configuration: Modified the deployment configurations for both kthena-router and kthena-controller-manager to conditionally include imagePullSecrets based on global chart values.
  • Default Values: Added imagePullSecrets as an empty array to the global section of values.yaml, providing a default and enabling its configuration via helm upgrade --set.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


Secrets to pull images, Helm chart now knows the way, Pods start up with ease.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@volcano-sh-bot
Copy link
Contributor

Welcome @lx1036! It looks like this is your first PR to volcano-sh/kthena 🎉

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for imagePullSecrets, which is a great enhancement. My review provides feedback to improve the implementation based on Helm chart best practices. The main suggestions are to associate imagePullSecrets with ServiceAccounts for better maintainability, and to add the corresponding schema definition in values.schema.json for robust validation. These changes will make the chart more robust and easier to use.

Comment on lines +136 to +143
{{- with .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}

Choose a reason for hiding this comment

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

high

While adding imagePullSecrets directly to the Deployment works, a more robust and maintainable approach in Helm charts is to associate them with the ServiceAccount. This ensures that any Pod using this ServiceAccount automatically gets the imagePullSecrets, reducing duplication and potential for errors if new workloads are added.

I recommend removing this logic from the Deployment and adding it to the kthena-router ServiceAccount template instead.

Here's an example of how you could modify the ServiceAccount template:

apiVersion: v1
kind: ServiceAccount
metadata:
  name: kthena-router
  # ... other metadata
{{- with .Values.global.imagePullSecrets }}
imagePullSecrets:
  {{- toYaml . | nindent 2 }}
{{- end }}

Comment on lines +62 to +65
{{- with .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}

Choose a reason for hiding this comment

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

high

Similar to the feedback on the kthena-router deployment, it's better to associate imagePullSecrets with the kthena-controller-manager ServiceAccount. This centralizes the configuration and improves chart maintainability. Please remove this block and update the corresponding ServiceAccount template.

# This is ONLY required when certManagementMode is set to "manual".
# You can generate it with: cat /path/to/your/ca.crt | base64 | tr -d '\n'
caBundle: ""
imagePullSecrets: []

Choose a reason for hiding this comment

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

high

A schema definition for this new global.imagePullSecrets value is missing in charts/kthena/values.schema.json. Adding it is important for validating user-provided values and preventing misconfigurations. Please add the corresponding schema definition.

Example for values.schema.json:

...
"global": {
  "type": "object",
  "properties": {
    // ... existing properties
    "imagePullSecrets": {
      "type": "array",
      "description": "Secrets for pulling images from a private registry.",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the image pull secret."
          }
        },
        "required": ["name"]
      }
    }
  }
}
...

# This is ONLY required when certManagementMode is set to "manual".
# You can generate it with: cat /path/to/your/ca.crt | base64 | tr -d '\n'
caBundle: ""
imagePullSecrets: []
Copy link
Member

Choose a reason for hiding this comment

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

It is not clear how to sepcify secrets Can you add a comment

Copy link
Member

Choose a reason for hiding this comment

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

@lx1036 would you please update

@hzxuzhonghu hzxuzhonghu force-pushed the feature/add-imagepullsecrets branch from e1acd4b to 7bc5fd8 Compare December 15, 2025 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement New feature or request size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants