From 89f19001bff86a9e8ef96ddc83c24477970c2583 Mon Sep 17 00:00:00 2001 From: AnchorArray Date: Tue, 15 Oct 2024 12:24:18 -0700 Subject: [PATCH] making envFrom optional --- charts/guardrails/CHANGELOG.md | 7 +++++++ charts/guardrails/Chart.yaml | 2 +- charts/guardrails/README.md | 9 +++++---- charts/guardrails/templates/deployment.yaml | 11 +++++++---- charts/guardrails/values.yaml | 11 +++++++++++ 5 files changed, 31 insertions(+), 9 deletions(-) diff --git a/charts/guardrails/CHANGELOG.md b/charts/guardrails/CHANGELOG.md index dd7f604..e824256 100644 --- a/charts/guardrails/CHANGELOG.md +++ b/charts/guardrails/CHANGELOG.md @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning] (https://semver.org/spec/v2.0.0.html). +## [0.3.0] - 2024-10-15 + +### Updated + +- Removed default `envFrom` secrets from `deployment.yaml` template for cases + where secrets are managed via other methods. + ## [0.2.2] - 2024-09-04 ### Updated diff --git a/charts/guardrails/Chart.yaml b/charts/guardrails/Chart.yaml index 2db9859..e2ed022 100644 --- a/charts/guardrails/Chart.yaml +++ b/charts/guardrails/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: guardrails description: A Helm chart for WhyLabs Guardrails type: application -version: 0.2.2 +version: 0.3.0 appVersion: "2.0.1" diff --git a/charts/guardrails/README.md b/charts/guardrails/README.md index 5ca092f..db25064 100644 --- a/charts/guardrails/README.md +++ b/charts/guardrails/README.md @@ -1,6 +1,6 @@ # guardrails -![Version: 0.2.2](https://img.shields.io/badge/Version-0.2.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.0.1](https://img.shields.io/badge/AppVersion-2.0.1-informational?style=flat-square) +![Version: 0.3.0](https://img.shields.io/badge/Version-0.3.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.0.1](https://img.shields.io/badge/AppVersion-2.0.1-informational?style=flat-square) A Helm chart for WhyLabs Guardrails @@ -75,14 +75,14 @@ release_name="" # the working directory or --destination path helm pull \ oci://ghcr.io/whylabs/guardrails \ - --version 0.2.2 + --version 0.3.0 # Requires the helm-diff plugin to be installed: # helm plugin install https://github.com/databus23/helm-diff helm diff upgrade \ --allow-unreleased \ --namespace "${target_namespace}" \ - "${release_name}" guardrails-0.2.2.tgz + "${release_name}" guardrails-0.3.0.tgz ``` After you've installed the repo you can install the chart. @@ -91,7 +91,7 @@ After you've installed the repo you can install the chart. helm upgrade --install \ --create-namespace \ --namespace "${target_namespace}" \ - "${release_name}" guardrails-0.2.2.tgz + "${release_name}" guardrails-0.3.0.tgz ``` ## Exposing Guardrails Outside Kubernetes @@ -163,6 +163,7 @@ utilization. | autoscaling | object | `{"enabled":false,"maxReplicas":100,"minReplicas":1,"targetCPUUtilizationPercentage":70}` | [Horizontal Pod Autoscaler](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) configuration for the `guardrails` container. | | commonLabels | object | `{}` | Labels to add to all chart resources. | | env | object | `{}` | [Environment variables](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/) for the `guardrails` container. | +| envFrom | object | `{}` | | | extraVolumeMounts | list | `[]` | Extra [volume mounts](https://kubernetes.io/docs/concepts/storage/volumes/) for the `guardrails` container. | | extraVolumes | list | `[]` | Extra [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) for the `Pod`. | | fullnameOverride | string | `""` | Override the full name of the chart. | diff --git a/charts/guardrails/templates/deployment.yaml b/charts/guardrails/templates/deployment.yaml index c213e8a..c5d1373 100644 --- a/charts/guardrails/templates/deployment.yaml +++ b/charts/guardrails/templates/deployment.yaml @@ -50,11 +50,14 @@ spec: value: {{ $value | quote }} {{- end }} {{- end }} + {{- if .Values.envFrom }} envFrom: - - secretRef: - name: whylabs-{{ .Release.Name }}-api-key - - secretRef: - name: whylabs-{{ .Release.Name }}-api-secret + {{- range $key, $value := .Values.envFrom }} + - {{ $value.type }}: + name: {{ $key }} + optional: {{ $value.optional | default false }} + {{- end }} + {{- end }} ports: - name: http containerPort: {{ .Values.service.targetPort }} diff --git a/charts/guardrails/values.yaml b/charts/guardrails/values.yaml index 5d79d7e..731f717 100644 --- a/charts/guardrails/values.yaml +++ b/charts/guardrails/values.yaml @@ -30,6 +30,17 @@ commonLabels: {} env: {} # MY_ENV_VAR: "my env var value" +envFrom: {} + # whylabs-guardrails-api-key: + # type: secretRef + # optional: false + # whylabs-guardrails-api-secret: + # type: secretRef + # optional: false + # custom-config: + # type: configMapRef + # optional: true + serviceAccount: # -- If `true`, create a new `ServiceAccount`. create: true