From d0514e491d984698ea8eac96b223eae1f77d71ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=9Awi=C4=99cicki?= Date: Wed, 24 Jul 2019 16:55:40 +0200 Subject: [PATCH] Add support for passing environment variables --- chart/kube-resource-report/Chart.yaml | 2 +- chart/kube-resource-report/templates/deployment.yaml | 8 ++++++++ chart/kube-resource-report/values.yaml | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/chart/kube-resource-report/Chart.yaml b/chart/kube-resource-report/Chart.yaml index f6ce15b..8ba68ae 100644 --- a/chart/kube-resource-report/Chart.yaml +++ b/chart/kube-resource-report/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v1 appVersion: "0.14.1" description: Report Kubernetes cluster and pod resource requests vs usage and generate static HTML name: kube-resource-report -version: 0.2.1 +version: 0.2.2 home: https://github.com/hjacobs/kube-resource-report.git diff --git a/chart/kube-resource-report/templates/deployment.yaml b/chart/kube-resource-report/templates/deployment.yaml index 0b570c5..1b79f93 100644 --- a/chart/kube-resource-report/templates/deployment.yaml +++ b/chart/kube-resource-report/templates/deployment.yaml @@ -24,6 +24,14 @@ spec: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + # environment variables + {{- if .Values.env }} + env: + {{- end }} + {{- range $key, $value := .Values.env }} + - name: {{ $key }} + value: {{ tpl $value $ | quote }} + {{- end }} args: - --update-interval-minutes={{ .Values.updateInterval }} {{- if .Values.addtionalCostPerCluster }} diff --git a/chart/kube-resource-report/values.yaml b/chart/kube-resource-report/values.yaml index ec38539..c90f028 100644 --- a/chart/kube-resource-report/values.yaml +++ b/chart/kube-resource-report/values.yaml @@ -79,3 +79,9 @@ nodeSelector: {} tolerations: [] affinity: {} + +# e.g. +# env: +# NODE_LABEL_SPOT: "a.com/spot" +# OBJECT_LABEL_APPLICATION: "app,chart" +env: {}