Skip to content

feat(helm): optionally enable config map and use all values #3265

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

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

Conversation

contrun
Copy link
Contributor

@contrun contrun commented Aug 23, 2025

  • Make mounting the configmap optionally. Since our tensorzero image has already contained the tensorzero.toml etc, we don't need to mount configmap any more. I made the mounting optional.
  • I prefer to set all the tensorzero runtime environment from a single secret as I don't need to update both the secret itself and the helm values options. So I added an option to export all the variables in a secret.

Originally part of #3042 . I think it is sensible to make config map improvements in a single PR.


Important

Makes config map mounting optional and allows using all environment variables from a secret in Helm charts.

  • ConfigMap:
    • Makes mounting the configMap optional in configmap.yaml, gateway.yaml, and ui.yaml.
    • Controlled by configMap.enabled in values.yaml.
  • Environment Variables:
    • Adds option to use all environment variables from a secret in gateway.yaml and ui.yaml.
    • Controlled by additionalEnv.secretName and additionalEnv.keys in values.yaml.

This description was created by Ellipsis for edc28e1. You can customize this summary. It will automatically update as commits are pushed.

feat(helm): optionally use all environment variables from secret

chore(helm): fixup wrong value reference in ui
@Copilot Copilot AI review requested due to automatic review settings August 23, 2025 07:07
Copy link
Contributor

@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.

Pull Request Overview

This PR enhances the Helm chart configuration by making the ConfigMap optional and adding support for using all environment variables from a secret. This provides more flexibility for deployments where the TensorZero configuration is already baked into the container image or when all environment variables should be sourced from a single secret.

  • Added configMap.enabled flag to conditionally create and mount the ConfigMap
  • Added ability to use all environment variables from a secret when keys list is empty
  • Updated deployment templates to handle conditional ConfigMap mounting

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
values.yaml Added configMap.enabled flag and documentation for new secret usage pattern
templates/configmap.yaml Wrapped ConfigMap creation with enabled condition
templates/gateway.yaml Added conditional ConfigMap mounting and envFrom support for all secret variables
templates/ui.yaml Added conditional ConfigMap mounting and envFrom support for all secret variables

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 67 to 77
volumes:
{{- if .Values.configMap.enabled }}
- name: config-volume
configMap:
name: {{ include "tensorzero.fullname" . }}
{{- end }}
{{- if .Values.persistence.enabled }}
- name: storage-volume
persistentVolumeClaim:
claimName: {{ include "tensorzero.fullname" . }}-storage
{{- end }}
Copy link
Preview

Copilot AI Aug 23, 2025

Choose a reason for hiding this comment

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

The volumes section should be conditionally rendered only when at least one volume is needed. However, the current logic will render an empty volumes array when both configMap.enabled and persistence.enabled are false. Consider using a more explicit condition or restructuring to avoid empty volumes sections.

Suggested change
volumes:
{{- if .Values.configMap.enabled }}
- name: config-volume
configMap:
name: {{ include "tensorzero.fullname" . }}
{{- end }}
{{- if .Values.persistence.enabled }}
- name: storage-volume
persistentVolumeClaim:
claimName: {{ include "tensorzero.fullname" . }}-storage
{{- end }}
volumes:
{{- if .Values.configMap.enabled }}
- name: config-volume
configMap:
name: {{ include "tensorzero.fullname" . }}
{{- end }}
{{- if .Values.persistence.enabled }}
- name: storage-volume
persistentVolumeClaim:
claimName: {{ include "tensorzero.fullname" . }}-storage
{{- end }}

Copilot uses AI. Check for mistakes.

Comment on lines 55 to 61
resources:
{{- toYaml .Values.ui.resources | nindent 12 }}
{{- if .Values.configMap.enabled }}
volumes:
- name: config-volume
configMap:
name: {{ include "tensorzero.fullname" . }}
Copy link
Preview

Copilot AI Aug 23, 2025

Choose a reason for hiding this comment

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

The volumes section in the UI template is inconsistent with the gateway template. The UI template only conditionally renders volumes when configMap is enabled, but the gateway template considers both configMap and persistence. This inconsistency could cause confusion and maintenance issues.

Suggested change
resources:
{{- toYaml .Values.ui.resources | nindent 12 }}
{{- if .Values.configMap.enabled }}
volumes:
- name: config-volume
configMap:
name: {{ include "tensorzero.fullname" . }}
{{- if .Values.ui.persistence.enabled }}
- name: ui-persistent-storage
mountPath: {{ .Values.ui.persistence.mountPath | default "/app/data" }}
{{- end }}
resources:
{{- toYaml .Values.ui.resources | nindent 12 }}
{{- if or .Values.configMap.enabled .Values.ui.persistence.enabled }}
volumes:
{{- if .Values.configMap.enabled }}
- name: config-volume
configMap:
name: {{ include "tensorzero.fullname" . }}
{{- end }}
{{- if .Values.ui.persistence.enabled }}
- name: ui-persistent-storage
persistentVolumeClaim:
claimName: {{ .Values.ui.persistence.existingClaim | default (printf "%s-ui-pvc" (include "tensorzero.fullname" .)) }}
{{- end }}

Copilot uses AI. Check for mistakes.

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.

1 participant