Skip to content

Feat/helm extra env from #40173

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

Conversation

fbuchmeier-abi
Copy link

@fbuchmeier-abi fbuchmeier-abi commented Apr 8, 2025

Description

This PR adds two additional options to allow additional environment variables (with env and envFrom) to be added to the appsmith container.

We use this to add additional secrets generated by our controllers (e.g. crossplane aws-provider) as environment variables into the appsmith container.

An example values.yaml could look like this:

extraEnv:
- name: APPSMITH_MAIL_USERNAME
  valueFrom:
    secretKeyRef:
      name: smtp-credentials
      key: username
- name: APPSMITH_MAIL_PASSWORD
  valueFrom:
    secretKeyRef:
      name: smtp-credentials
      key: password

If you have any suggestions or questions please let me know.

Best regards,
Florian.

Summary by CodeRabbit

  • New Features
    • Enhanced deployment customization with additional options for update strategies.
    • Introduced flexible settings allowing users to add extra volumes, volume mounts, environment variables, and additional configuration sources to tailor deployments.

…appsmith pods

Signed-off-by: Florian Buchmeier <florian.buchmeier@audi.de>
…s and volume mounts for the appsmith pods

Merge in OSSC/appsmith from feat/helm-extra-volume-mounts to release

* commit 'b8fa527e4350ea098cc4c2a3acac1658f9f27934':
  feat: add option to specifiy extra volumes and volume mounts for the appsmith pods
Signed-off-by: Florian Buchmeier <florian.buchmeier@audi.de>
… 'kind: Deployment'

Merge in OSSC/appsmith from feat/helm-extra-volume-mounts to release

* commit '5a115c381237558330e630fe44ade17573b5f67e':
  fix: broken extraVolumes indentation with  'kind: Deployment'
…n strategy is 'Recreate'

Signed-off-by: Florian Buchmeier <florian.buchmeier@audi.de>
…en: may not be specified when strategy is 'Recreate'

Merge in OSSC/appsmith from feat/helm-strategytype-recreate to release

* commit '80a0209821a8cc6343ade6e8e26c02a3cda1ee72':
  fix: spec.strategy.rollingUpdate: Forbidden: may not be specified when strategy  is 'Recreate'
…ontainer

Signed-off-by: Florian Buchmeier <florian.buchmeier@audi.de>
Copy link
Contributor

coderabbitai bot commented Apr 8, 2025

Walkthrough

This pull request enhances the Helm chart deployment template by introducing conditional logic to include additional configuration options. The deployment template now conditionally adds rolling update parameters if the strategy type is set to "RollingUpdate". In addition, the container configuration is extended to conditionally include extra volumes, volume mounts, environment variables, and environment variable sources. The accompanying values.yaml file is updated to introduce new parameters to support these additional settings.

Changes

File(s) Summary
deploy/helm/templates/.../deployment.yaml Added conditional blocks for the strategy section to include rolling update parameters and for the container spec to conditionally render extra volume mounts, environment variables, and environment variable sources. Also updated the volumes section to include extraVolumes if specified.
deploy/helm/values.yaml Introduced new configuration options (extraVolumes, extraVolumeMounts, extraEnv, and extraEnvFrom) initialized as empty lists for more flexible deployment configurations.

Sequence Diagram(s)

sequenceDiagram
    participant Helm
    participant DeploymentTemplate
    participant Values
    Helm->>Values: Load configuration from values.yaml
    Values-->>Helm: Return strategy, extraVolumes, extraEnv, etc.
    Helm->>DeploymentTemplate: Evaluate strategyType condition
    alt RollingUpdate
        DeploymentTemplate->>DeploymentTemplate: Add rollingUpdate (maxSurge, maxUnavailable)
    else Default
        DeploymentTemplate->>DeploymentTemplate: Proceed with default strategy
    end
    DeploymentTemplate->>DeploymentTemplate: Conditionally add extraVolumes, extraVolumeMounts, extraEnv, extraEnvFrom
    DeploymentTemplate-->>Helm: Generate final deployment manifest
Loading

Poem

In YAML's realm the settings sing,
Conditional paths make the bells ring.
Extra volumes and env blend with cheer,
Rolling updates whisper, "Change is here!"
Our Helm chart dances with code so clear.
🚀✨


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@fbuchmeier-abi
Copy link
Author

Any updates or change requests?

Copy link

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

@github-actions github-actions bot added the Stale label Apr 29, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (5)
deploy/helm/values.yaml (4)

387-391: extraVolumes parameter
Introduces an empty list for users to add custom Kubernetes volumes. Consider documenting this field in the chart README to guide users.


392-397: extraVolumeMounts parameter
Allows mounting those extra volumes into the container. Please add usage examples to the chart documentation for clarity.


460-469: extraEnv parameter
Enables injection of additional environment variables. Recommend updating README to include this new option and its schema.


470-474: extraEnvFrom parameter
Supports referencing entire ConfigMaps or Secrets as envFrom sources. Don't forget to document this in the chart's README.

deploy/helm/templates/deployment.yaml (1)

21-25: Conditional rollingUpdate block
Properly includes rollingUpdate only when strategyType is "RollingUpdate". To complete this feature, consider adding an updateStrategy section in values.yaml for users to configure maxSurge/maxUnavailable.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 988537f and c9d6728.

📒 Files selected for processing (2)
  • deploy/helm/templates/deployment.yaml (4 hunks)
  • deploy/helm/values.yaml (3 hunks)
🔇 Additional comments (4)
deploy/helm/templates/deployment.yaml (4)

132-134: Inject extraVolumeMounts
Correctly renders additional volume mounts in the pod spec.


152-154: Inject extraEnv
Appears to correctly merge user-defined environment variables into the container.


170-172: Inject extraEnvFrom
Properly appends envFrom entries for ConfigMaps/Secrets.


178-180: Inject extraVolumes
Correctly adds user-specified volumes to the pod.

Copy link

github-actions bot commented May 7, 2025

This PR has been closed because of inactivity.

@github-actions github-actions bot closed this May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant