Skip to content

Conversation

@fank
Copy link
Member

@fank fank commented Jun 6, 2025

…deployment

This pull request introduces significant updates to the Helm chart for the api-deployment, improving its flexibility and maintainability. Key changes include the introduction of configurable environment variables, secrets, and configMaps, as well as the removal of hardcoded GCP-specific configurations. These updates enable better customization and support for broader deployment scenarios.

Helm Chart Version Update:

  • Updated version in Chart.yaml from 0.3.1 to 0.4.0 to reflect the new changes.

Enhanced Environment Variable and Secret Management:

  • Replaced hardcoded environment variables (e.g., GOOGLE_APPLICATION_CREDENTIALS and GOOGLE_CLOUD_PROJECT) with a dynamic env and envFrom structure in deployment.yaml, allowing users to define environment variables and load them from secrets or configMaps.
  • Added support for mounting secrets and configMaps dynamically in deployment.yaml via .Values.secrets and .Values.configMaps, enabling flexible configuration. [1] [2]

Example and Default Values:

  • Introduced an example values-example.yaml file demonstrating how to configure secrets, environment variables, and configMaps, including static values and references to external resources.
  • Updated values.yaml to include placeholders for env, envFrom, secrets, and configMaps, providing a template for users to define their configurations.

These changes make the api-deployment chart more modular and adaptable, catering to a broader range of deployment environments.

@fank fank self-assigned this Jun 6, 2025
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.

Hello @fank, 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!

Summary of Changes

Hello team, gemini-code-assist here to provide a summary of this pull request by @fank.

This PR focuses on enhancing the flexibility and maintainability of the api-deployment Helm chart. The primary goal is to move away from hardcoded configurations, particularly those specific to GCP, and introduce more dynamic ways to manage environment variables, secrets, and configMaps. This makes the chart more adaptable to different deployment environments and configurations.

Highlights

  • Dynamic Volume Mounting: Users can now specify secrets and configMaps in the values.yaml file, and the chart will automatically create the necessary volume mounts and volume definitions in the deployment manifest. This allows for flexible mounting of configuration files and credentials.
  • GCP Decoupling: Hardcoded GCP-specific environment variables and volume mounts have been removed from the deployment template, making the chart more generic and less tied to a specific cloud provider.
  • Improved Documentation/Examples: A new values-example.yaml file has been added to demonstrate how to utilize the new env, envFrom, secrets, and configMaps options. The main values.yaml file has also been updated with commented-out examples.
  • Chart Version Bump: The Helm chart version in Chart.yaml has been incremented from 0.3.0 to 0.4.0 to reflect these significant changes.

Changelog

Click here to see the changelog
  • charts/api-deployment/Chart.yaml
    • Updated chart version from 0.3.0 to 0.4.0.
  • charts/api-deployment/templates/deployment.yaml
    • Replaced hardcoded env entries for GOOGLE_APPLICATION_CREDENTIALS and GOOGLE_CLOUD_PROJECT with dynamic generation from .Values.env and .Values.envFrom using toYaml and nindent (around lines 45-52).
    • Removed the hardcoded gcp-service-account volume mount (line 76 was removed).
    • Added a range loop to dynamically create volume mounts based on .Values.secrets (around lines 79-83).
    • Added a range loop to dynamically create volume mounts based on .Values.configMaps (around lines 84-88).
    • Removed the hardcoded gcp-service-account volume definition (lines 99-101 were removed).
    • Added a range loop to dynamically create volume definitions based on .Values.secrets (around lines 114-119).
    • Added a range loop to dynamically create volume definitions based on .Values.configMaps (around lines 120-125).
  • charts/api-deployment/values-example.yaml
    • Added a new example file demonstrating configuration for secrets, env, envFrom, and configMaps.
  • charts/api-deployment/values.yaml
    • Removed the gcp section.
    • Added empty lists env: [], envFrom: [], secrets: [], and configMaps: [] with commented-out examples for user guidance.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 is currently in preview and 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 to provide feedback.

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.

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.

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 enhances the Helm chart for api-deployment by introducing configurable environment variables, secrets, and configMaps, and removing hardcoded GCP-specific configurations. The changes improve the chart's flexibility and maintainability. Overall, the changes look good, but there are a few areas that could be improved.

Merge Readiness

The pull request introduces significant improvements to the Helm chart, enhancing its flexibility and maintainability. The changes related to environment variables, secrets, and configMaps are well-structured and provide a good level of customization. However, I would recommend addressing the comments above before merging. I am unable to directly approve this pull request, and recommend that others review and approve this code before merging.

@fank fank merged commit af1e5e6 into main Jun 6, 2025
3 checks passed
@fank fank deleted the feature/NX-13810 branch June 6, 2025 14:06
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.

2 participants