From adde3426f2b35e467f1eff9e6c4eb11f0d2060cf Mon Sep 17 00:00:00 2001 From: Ishan Arya Date: Thu, 13 Apr 2023 12:40:57 +0530 Subject: [PATCH 01/10] feat: add taint/tolerations --- stable/firehose/templates/deployment.yaml | 8 ++++++++ stable/firehose/values.yaml | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/stable/firehose/templates/deployment.yaml b/stable/firehose/templates/deployment.yaml index 675c04f2..3ef5e320 100644 --- a/stable/firehose/templates/deployment.yaml +++ b/stable/firehose/templates/deployment.yaml @@ -85,3 +85,11 @@ spec: - emptyDir: {} name: workdir {{- end }} + {{- if index .Values "taints" "enabled" }} + tolerations: {{- range $key, $value := .Values.taints.list }} + - key: {{ $value.key }} + operator: {{ $value.operator }} + value: {{ $value.value }} + effect: {{ $value.effect }} + {{- end }} + {{- end}} \ No newline at end of file diff --git a/stable/firehose/values.yaml b/stable/firehose/values.yaml index 1f4bc0b6..7c375d83 100644 --- a/stable/firehose/values.yaml +++ b/stable/firehose/values.yaml @@ -38,6 +38,10 @@ firehose: cpu: 200m memory: 512Mi +taints: + enabled: false + list: {} + init-firehose: enabled: false image: From c88d67bfdb3ed9dc8eb618df6b861cd42aca4162 Mon Sep 17 00:00:00 2001 From: Ishan Arya Date: Thu, 13 Apr 2023 12:58:31 +0530 Subject: [PATCH 02/10] chore: taints enabled check --- stable/firehose/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stable/firehose/templates/deployment.yaml b/stable/firehose/templates/deployment.yaml index 3ef5e320..2d7bcdf5 100644 --- a/stable/firehose/templates/deployment.yaml +++ b/stable/firehose/templates/deployment.yaml @@ -85,7 +85,7 @@ spec: - emptyDir: {} name: workdir {{- end }} - {{- if index .Values "taints" "enabled" }} + {{- if index .Values.taints.enabled }} tolerations: {{- range $key, $value := .Values.taints.list }} - key: {{ $value.key }} operator: {{ $value.operator }} From 50766d13bf766994c7b2c7a7085b6419a95e4bb0 Mon Sep 17 00:00:00 2001 From: Ishan Arya Date: Thu, 13 Apr 2023 15:02:09 +0530 Subject: [PATCH 03/10] fix: change name to tolearion and type array --- stable/firehose/templates/deployment.yaml | 4 ++-- stable/firehose/values.yaml | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/stable/firehose/templates/deployment.yaml b/stable/firehose/templates/deployment.yaml index 2d7bcdf5..b8bcf9b0 100644 --- a/stable/firehose/templates/deployment.yaml +++ b/stable/firehose/templates/deployment.yaml @@ -85,8 +85,8 @@ spec: - emptyDir: {} name: workdir {{- end }} - {{- if index .Values.taints.enabled }} - tolerations: {{- range $key, $value := .Values.taints.list }} + {{- if (gt (len .Values.tolerations) 0) }} + tolerations: {{- range $_, $value := .Values.tolerations }} - key: {{ $value.key }} operator: {{ $value.operator }} value: {{ $value.value }} diff --git a/stable/firehose/values.yaml b/stable/firehose/values.yaml index 7c375d83..119078b9 100644 --- a/stable/firehose/values.yaml +++ b/stable/firehose/values.yaml @@ -38,9 +38,7 @@ firehose: cpu: 200m memory: 512Mi -taints: - enabled: false - list: {} +tolerations: [] init-firehose: enabled: false From d76d2f7a85c90adec019ca5ce9e938ce14a2c5e9 Mon Sep 17 00:00:00 2001 From: Ishan Arya Date: Thu, 13 Apr 2023 15:55:43 +0530 Subject: [PATCH 04/10] feat: add affinity --- stable/firehose/templates/deployment.yaml | 25 +++++++++++++++++------ stable/firehose/values.yaml | 2 ++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/stable/firehose/templates/deployment.yaml b/stable/firehose/templates/deployment.yaml index b8bcf9b0..e95683ac 100644 --- a/stable/firehose/templates/deployment.yaml +++ b/stable/firehose/templates/deployment.yaml @@ -86,10 +86,23 @@ spec: name: workdir {{- end }} {{- if (gt (len .Values.tolerations) 0) }} - tolerations: {{- range $_, $value := .Values.tolerations }} - - key: {{ $value.key }} - operator: {{ $value.operator }} - value: {{ $value.value }} - effect: {{ $value.effect }} + tolerations: {{- range $_, $toleration := .Values.tolerations }} + - key: {{ $toleration.key }} + operator: {{ $toleration.operator }} + value: {{ $toleration.value }} + effect: {{ $toleration.effect }} {{- end }} - {{- end}} \ No newline at end of file + {{- end}} + {{- if (gt (len .Values.affinity) 0) }} + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: {{- range $_, $expression := .Values.affinity }} + - key: {{ $expression.key }} + operator: {{ $expression.operator }} + values: {{- range $expression.values }} + - {{ . }} + {{- end}} + {{- end}} + {{- end}} diff --git a/stable/firehose/values.yaml b/stable/firehose/values.yaml index 119078b9..a2a12f18 100644 --- a/stable/firehose/values.yaml +++ b/stable/firehose/values.yaml @@ -40,6 +40,8 @@ firehose: tolerations: [] +affinity: [] + init-firehose: enabled: false image: From d5e43f7004d3e05ed62db155469a8366bc4c0743 Mon Sep 17 00:00:00 2001 From: Ishan Arya Date: Thu, 13 Apr 2023 16:40:57 +0530 Subject: [PATCH 05/10] feat: add both nodeAffinity --- stable/firehose/templates/deployment.yaml | 21 ++++++++++++++++++--- stable/firehose/values.yaml | 4 +++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/stable/firehose/templates/deployment.yaml b/stable/firehose/templates/deployment.yaml index e95683ac..811f0ad8 100644 --- a/stable/firehose/templates/deployment.yaml +++ b/stable/firehose/templates/deployment.yaml @@ -93,16 +93,31 @@ spec: effect: {{ $toleration.effect }} {{- end }} {{- end}} - {{- if (gt (len .Values.affinity) 0) }} + {{- if or (gt (len .Values.nodeAffinitiyMatchExpressions.requiredDuringSchedulingIgnoredDuringExecution) 0) (gt (len .Values.nodeAffinitiyMatchExpressions.preferredDuringSchedulingIgnoredDuringExecution) 0) }} affinity: nodeAffinity: + {{- if (gt (len .Values.nodeAffinitiyMatchExpressions.requiredDuringSchedulingIgnoredDuringExecution) 0) }} requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - - matchExpressions: {{- range $_, $expression := .Values.affinity }} + - matchExpressions: {{- range $_, $expression := .Values.nodeAffinitiyMatchExpressions.requiredDuringSchedulingIgnoredDuringExecution }} - key: {{ $expression.key }} operator: {{ $expression.operator }} values: {{- range $expression.values }} - {{ . }} {{- end}} + {{- end}} + {{- end}} + {{- if (gt (len .Values.nodeAffinitiyMatchExpressions.preferredDuringSchedulingIgnoredDuringExecution) 0) }} + preferredDuringSchedulingIgnoredDuringExecution: {{- range $_, $expression := .Values.nodeAffinitiyMatchExpressions.preferredDuringSchedulingIgnoredDuringExecution }} + - weight: {{ $expression.weight}} + preference: + matchExpressions: {{- range $_, $pref := $expression.preference }} + - key: {{ $pref.key }} + operator: {{ $pref.operator }} + values: {{- range $pref.values }} + - {{ . }} + {{- end}} {{- end}} - {{- end}} + {{- end}} + {{- end}} + {{- end}} \ No newline at end of file diff --git a/stable/firehose/values.yaml b/stable/firehose/values.yaml index a2a12f18..fbc433e6 100644 --- a/stable/firehose/values.yaml +++ b/stable/firehose/values.yaml @@ -40,7 +40,9 @@ firehose: tolerations: [] -affinity: [] +nodeAffinitiyMatchExpressions: + requiredDuringSchedulingIgnoredDuringExecution: [] + preferredDuringSchedulingIgnoredDuringExecution: [] init-firehose: enabled: false From 2c91054cbab4bc92c504ab293d667f993fded6e4 Mon Sep 17 00:00:00 2001 From: Ishan Arya Date: Fri, 14 Apr 2023 15:40:32 +0530 Subject: [PATCH 06/10] feat: add volumes and volumeMounts --- stable/firehose/templates/deployment.yaml | 18 +++++++++++ stable/firehose/values.yaml | 39 +++++++++++++++++++++-- 2 files changed, 54 insertions(+), 3 deletions(-) diff --git a/stable/firehose/templates/deployment.yaml b/stable/firehose/templates/deployment.yaml index 811f0ad8..f21b41b6 100644 --- a/stable/firehose/templates/deployment.yaml +++ b/stable/firehose/templates/deployment.yaml @@ -34,6 +34,12 @@ spec: - mountPath: /work-dir name: workdir {{- end }} + {{- if or (gt (len .Values.volumeMounts) 0) }} + {{- range $_, $volumeMount := .Values.volumeMounts }} + - name: {{ $volumeMount.name}} + mountPath: {{ $volumeMount.mountPath }} + {{- end}} + {{- end}} resources: {{- toYaml .Values.firehose.resources | nindent 12 }} envFrom: @@ -85,6 +91,18 @@ spec: - emptyDir: {} name: workdir {{- end }} + {{- if or (gt (len .Values.volumes) 0) }} + {{- range $_, $volume := .Values.volumes }} + - name: {{ $volume.name}} + secretName: {{ $volume.secretName }} + defaultMode: {{ $volume.defaultMode }} + items: {{- range $_, $item := $volume.items }} + - key: {{ $item.key }} + path: {{ $item.path }} + {{- end}} + {{- end}} + {{- end}} + {{- if (gt (len .Values.tolerations) 0) }} tolerations: {{- range $_, $toleration := .Values.tolerations }} - key: {{ $toleration.key }} diff --git a/stable/firehose/values.yaml b/stable/firehose/values.yaml index fbc433e6..a9d054bb 100644 --- a/stable/firehose/values.yaml +++ b/stable/firehose/values.yaml @@ -40,9 +40,42 @@ firehose: tolerations: [] +volumes: [] + +volumeMounts: [] + nodeAffinitiyMatchExpressions: - requiredDuringSchedulingIgnoredDuringExecution: [] - preferredDuringSchedulingIgnoredDuringExecution: [] + requiredDuringSchedulingIgnoredDuringExecution: + - key: "k1" + operator: "Equal" + values: + - "v11" + - "v12" + - key: "k2" + operator: "Equal" + values: + - "v21" + - "v22" + preferredDuringSchedulingIgnoredDuringExecution: + - weight: "1" + preference: + - key: "k1" + operator: "Equal" + values: + - "v001" + - "v002" + - key: "k2" + operator: "Equal" + values: + - "v003" + - "v004" + - weight: "2" + preference: + - key: "k3" + operator: "Equal" + values: + - "v005" + - "v005" init-firehose: enabled: false @@ -54,7 +87,7 @@ init-firehose: args: [wget -O /work-dir/protos.jar http://proto_jar_url.jar] telegraf: - enabled: false + enabled: true image: repository: telegraf pullPolicy: IfNotPresent From 9a12cdbc77af546dda7893b9e12c29ef04cb7d6f Mon Sep 17 00:00:00 2001 From: Ishan Arya Date: Fri, 14 Apr 2023 15:41:51 +0530 Subject: [PATCH 07/10] fix: values --- stable/firehose/values.yaml | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/stable/firehose/values.yaml b/stable/firehose/values.yaml index a9d054bb..049d0ce8 100644 --- a/stable/firehose/values.yaml +++ b/stable/firehose/values.yaml @@ -45,37 +45,8 @@ volumes: [] volumeMounts: [] nodeAffinitiyMatchExpressions: - requiredDuringSchedulingIgnoredDuringExecution: - - key: "k1" - operator: "Equal" - values: - - "v11" - - "v12" - - key: "k2" - operator: "Equal" - values: - - "v21" - - "v22" - preferredDuringSchedulingIgnoredDuringExecution: - - weight: "1" - preference: - - key: "k1" - operator: "Equal" - values: - - "v001" - - "v002" - - key: "k2" - operator: "Equal" - values: - - "v003" - - "v004" - - weight: "2" - preference: - - key: "k3" - operator: "Equal" - values: - - "v005" - - "v005" + requiredDuringSchedulingIgnoredDuringExecution: [] + preferredDuringSchedulingIgnoredDuringExecution: [] init-firehose: enabled: false @@ -87,7 +58,7 @@ init-firehose: args: [wget -O /work-dir/protos.jar http://proto_jar_url.jar] telegraf: - enabled: true + enabled: false image: repository: telegraf pullPolicy: IfNotPresent From 41d7fc88938ced1fb63eacbe14c26a47a09ca8c7 Mon Sep 17 00:00:00 2001 From: Ishan Arya Date: Fri, 14 Apr 2023 16:32:59 +0530 Subject: [PATCH 08/10] fix: add volume and mounts key only if needed --- stable/firehose/templates/deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stable/firehose/templates/deployment.yaml b/stable/firehose/templates/deployment.yaml index f21b41b6..6a2e14d5 100644 --- a/stable/firehose/templates/deployment.yaml +++ b/stable/firehose/templates/deployment.yaml @@ -29,12 +29,12 @@ spec: name: {{ .Chart.Name }} image: "{{ .Values.firehose.image.repository }}:{{ .Values.firehose.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.firehose.image.pullPolicy }} + {{- if or (index .Values "init-firehose" "enabled") (gt (len .Values.volumeMounts) 0) }} volumeMounts: {{- if index .Values "init-firehose" "enabled" }} - mountPath: /work-dir name: workdir {{- end }} - {{- if or (gt (len .Values.volumeMounts) 0) }} {{- range $_, $volumeMount := .Values.volumeMounts }} - name: {{ $volumeMount.name}} mountPath: {{ $volumeMount.mountPath }} @@ -81,6 +81,7 @@ spec: - mountPath: /work-dir name: workdir {{- end }} + {{if or (index .Values.telegraf.enabled) (index .Values "init-firehose" "enabled") (gt (len .Values.volumes) 0)}} volumes: {{- if index .Values.telegraf.enabled }} - configMap: @@ -91,7 +92,6 @@ spec: - emptyDir: {} name: workdir {{- end }} - {{- if or (gt (len .Values.volumes) 0) }} {{- range $_, $volume := .Values.volumes }} - name: {{ $volume.name}} secretName: {{ $volume.secretName }} From d2324d6710d46c67f88d554fbedfc0882820cd90 Mon Sep 17 00:00:00 2001 From: Ishan Arya Date: Mon, 17 Apr 2023 17:26:25 +0530 Subject: [PATCH 09/10] feat: upgrade version and docs --- stable/firehose/README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/stable/firehose/README.md b/stable/firehose/README.md index 112e9e6c..be884b9f 100644 --- a/stable/firehose/README.md +++ b/stable/firehose/README.md @@ -93,6 +93,30 @@ The following table lists the configurable parameters of Firehose chart and thei | telegraf.resources.limits.memory | string | `"64Mi"` | telegraf container memory limit | | telegraf.resources.requests.cpu | string | `"50m"` | telegraf container cpu requests | | telegraf.resources.requests.memory | string | `"64Mi"` | telegraf container memory requests | +| tolerations | list | - | List of Kubernetes [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) | +| volumes | list | - | List of Kubernetes [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) | +| volumeMounts | list | - | List of Kubernetes [volume mounts](https://kubernetes.io/docs/concepts/storage/volumes/#using-volumes) | +| nodeAffinityMatchExpressions.requiredDuringSchedulingIgnoredDuringExecution | list | - | List of Kubernetes [node affinity match expressions](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity) that are required for the pod to be scheduled on a node | +| nodeAffinityMatchExpressions.preferredDuringSchedulingIgnoredDuringExecution | list | - | List of Kubernetes [preferred node affinity match expressions](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#preferred-during-scheduling-ignoreduringexecution) for the pod scheduling | +| tolerations.key | string | `"key1"` | Key to be mached | +| tolerations.operator | string | `"Equal"` | Operation to be checked | +| tolerations.value | string | `"value1"` | Values against which operation is performed | +| tolerations.effect | string | `"NoSchedule"` | Taint effect | +| volumes.name | string | - | Name of the Kubernetes volume | +| volumes.items.key | string | - | Key of the secret data | +| volumes.items.path | string | - | Path where the secret data will be mounted | +| volumes.secretName | string | - | Name of the Kubernetes secret | +| volumes.defaultMode | integer | - | Default file permissions for the volume | +| volumeMounts.name | string | - | Name of the Kubernetes volume | +| volumeMounts.mountPath | string | - | Path within the container where the volume should be mounted | +| nodeAffinityMatchExpressions.requiredDuringSchedulingIgnoredDuringExecution.key | string | - | Key of the node affinity match expression | +| nodeAffinityMatchExpressions.requiredDuringSchedulingIgnoredDuringExecution.operator | string | - | Operator of the node affinity match expression | +| nodeAffinityMatchExpressions.requiredDuringSchedulingIgnoredDuringExecution.values | list | - | List of values of the node affinity match expression | +| nodeAffinityMatchExpressions.preferredDuringSchedulingIgnoredDuringExecution.weight | integer | - | Weight of the preferred node affinity match expression | +| nodeAffinityMatchExpressions.preferredDuringSchedulingIgnoredDuringExecution.preference.key | string | - | Key of the preferred node affinity match expression | +| nodeAffinityMatchExpressions.preferredDuringSchedulingIgnoredDuringExecution.preference.operator | string | - | Operator of the preferred node affinity match expression | +| nodeAffinityMatchExpressions.preferredDuringSchedulingIgnoredDuringExecution.preference.values | list | - | List of values of the preferred node affinity match expression | + --- Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. From c680e07d8a54c8d7e309b852a704271075b4f3bd Mon Sep 17 00:00:00 2001 From: Ishan Arya Date: Mon, 17 Apr 2023 17:26:55 +0530 Subject: [PATCH 10/10] feat: upgrade version and docs --- stable/firehose/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stable/firehose/Chart.yaml b/stable/firehose/Chart.yaml index 8a4d71ed..5b273f70 100644 --- a/stable/firehose/Chart.yaml +++ b/stable/firehose/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: firehose description: A Helm chart for deploying Firehose on Kubernetes type: application -version: 0.1.3 +version: 0.1.4 appVersion: 0.7.1