From 81b75dd24fce36309abcd06f8e3c13bf713f251f Mon Sep 17 00:00:00 2001 From: vladchit <39710989+vladchit@users.noreply.github.com> Date: Tue, 19 Oct 2021 10:24:30 +0300 Subject: [PATCH] Possibility to add extra ENV variables to K8s Deployment POD (#33) * Posiability to add extra ENV variables to K8s Deployment POD * readme update via helm-docs Co-authored-by: Benjamin Buetikofer --- charts/imaginary/Chart.yaml | 4 ++-- charts/imaginary/README.md | 3 ++- charts/imaginary/templates/deployment.yaml | 6 ++++++ charts/imaginary/values.yaml | 2 ++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/charts/imaginary/Chart.yaml b/charts/imaginary/Chart.yaml index c3c8f00..ae9cc5f 100644 --- a/charts/imaginary/Chart.yaml +++ b/charts/imaginary/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: "1.2.4" description: Deploy imaginary to process pictures on the fly name: imaginary -version: 0.1.5 +version: 0.1.6 home: https://github.com/h2non/imaginary sources: - https://github.com/ricardo-ch/helm-charts/tree/main/charts/imaginary @@ -15,7 +15,7 @@ keywords: - h2non annotations: artifacthub.io/changes: | - - Removing default value for Istio CPU limit + - Add env-vars to deployment artifacthub.io/images: | - name: imaginary image: h2non/imaginary:1.2.4 diff --git a/charts/imaginary/README.md b/charts/imaginary/README.md index 67cc1fe..017df13 100644 --- a/charts/imaginary/README.md +++ b/charts/imaginary/README.md @@ -1,6 +1,6 @@ # Imaginary -![Version: 0.1.5](https://img.shields.io/badge/Version-0.1.5-informational?style=flat-square) ![AppVersion: 1.2.4](https://img.shields.io/badge/AppVersion-1.2.4-informational?style=flat-square) ![Release Status](https://github.com/ricardo-ch/helm-charts/workflows/Release%20Charts/badge.svg) [![License](https://img.shields.io/github/license/ricardo-ch/helm-charts)](https://github.com/ricardo-ch/helm-charts/blob/main/LICENSE) +![Version: 0.1.6](https://img.shields.io/badge/Version-0.1.6-informational?style=flat-square) ![AppVersion: 1.2.4](https://img.shields.io/badge/AppVersion-1.2.4-informational?style=flat-square) ![Release Status](https://github.com/ricardo-ch/helm-charts/workflows/Release%20Charts/badge.svg) [![License](https://img.shields.io/github/license/ricardo-ch/helm-charts)](https://github.com/ricardo-ch/helm-charts/blob/main/LICENSE) This chart installs [Imaginary](https://github.com/h2non/imaginary). @@ -28,6 +28,7 @@ Simply add this Chart repository to Helm: | additionalLabels | object | `{}` | append labels to both the deployment, pdb, hpa and the pods label list | | apikey | string | `""` | Define API key for authorization | | config | object | `{}` | Imaginary arguments. use the same hyphen separated synthax for the key. use strings for the value or you might get a bad formatting. | +| env | object | `{}` | | | gracefulShutdownDelaySeconds | int | `10` | estimated time to propagate the information the pod is not part of the service anymore | | hpa | object | `{"maxReplicas":2,"minReplicas":2}` | Horizontal pod autoscaling configuration | | httpPort | int | `8080` | Which port should Imaginary and its Kubernetes service listen | diff --git a/charts/imaginary/templates/deployment.yaml b/charts/imaginary/templates/deployment.yaml index d7041eb..423f558 100644 --- a/charts/imaginary/templates/deployment.yaml +++ b/charts/imaginary/templates/deployment.yaml @@ -49,6 +49,12 @@ spec: env: - name: PORT value: {{ .Values.httpPort | quote }} + {{- if .Values.env -}} + {{- range $name, $value := .Values.env }} + - name: {{ $name }} + value: {{ $value | quote }} + {{- end }} + {{- end }} {{- if .Values.apiKey }} - name: API_KEY valueFrom: diff --git a/charts/imaginary/values.yaml b/charts/imaginary/values.yaml index 740e7d3..5655751 100644 --- a/charts/imaginary/values.yaml +++ b/charts/imaginary/values.yaml @@ -45,6 +45,8 @@ livenessProbe: config: {} # example # path-prefix: "/nya" +env: {} + # MALLOC_ARENA_MAX: 2 tls: # -- Base64 encoded private key file for TLS certificate.