Skip to content
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

making envFrom optional #35

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions charts/guardrails/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion charts/guardrails/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
9 changes: 5 additions & 4 deletions charts/guardrails/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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. |
Expand Down
11 changes: 7 additions & 4 deletions charts/guardrails/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
11 changes: 11 additions & 0 deletions charts/guardrails/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading