From 32d507d11c6e1862d05783166da2aa3118fca0f6 Mon Sep 17 00:00:00 2001 From: Jeffrey Lewis <6392628+jlewis42lines@users.noreply.github.com> Date: Sun, 6 Dec 2020 09:11:46 -0800 Subject: [PATCH] Add toleration to all DaemonSets (#23) * Add toleration to all DaemonSets By default, add a blanket toleration to the filebeat and metricbeat DaemonSets, with the opertion to remove the toleration and accept all taints (for backward compatibility). * Update filebeat/values.yaml Co-authored-by: Miri <37478344+mirii1994@users.noreply.github.com> * Update metricbeat/README.md Co-authored-by: Miri <37478344+mirii1994@users.noreply.github.com> * Update filebeat/README.md Co-authored-by: Miri <37478344+mirii1994@users.noreply.github.com> * Update metricbeat/values.yaml Co-authored-by: Miri <37478344+mirii1994@users.noreply.github.com> * Update docs * Bumped charts versions, added changelog Co-authored-by: Miri <37478344+mirii1994@users.noreply.github.com> Co-authored-by: mirii1994 --- filebeat/Chart.yaml | 2 +- filebeat/README.md | 3 +++ filebeat/templates/daemonset.yaml | 4 ++++ filebeat/values.yaml | 3 ++- metricbeat/Chart.yaml | 2 +- metricbeat/README.md | 5 ++++- metricbeat/templates/daemonset.yaml | 4 ++++ metricbeat/values.yaml | 1 + 8 files changed, 20 insertions(+), 4 deletions(-) diff --git a/filebeat/Chart.yaml b/filebeat/Chart.yaml index 8a9200f2..15d4851e 100644 --- a/filebeat/Chart.yaml +++ b/filebeat/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v1 name: logzio-k8s-logs description: A Helm chart for shipping k8s logs to logz.io via Filebeat. -version: 0.0.1 +version: 0.0.2 appVersion: 7.8.1 diff --git a/filebeat/README.md b/filebeat/README.md index b257f157..60f6fe47 100644 --- a/filebeat/README.md +++ b/filebeat/README.md @@ -146,6 +146,7 @@ Give your logs some time to get from your system to ours, and then open [Logz.io | `daemonset.fieldsUnderRoot` | If this option is set to true, the custom fields are stored as top-level fields in the output document instead of being grouped under a `fields` sub-dictionary. | `"true"` | | `daemonset.securityContext` | Configurable [securityContext](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) for Filebeat DaemonSet pod execution environment. | See [values.yaml](https://github.com/logzio/logzio-helm/blob/master/filebeat/values.yaml) | | `daemonset.resources` | Allows you to set the resources for Filebeat Daemonset. | See [values.yaml](https://github.com/logzio/logzio-helm/blob/master/filebeat/values.yaml) | +| `daemonset.tolerations` | Set [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) for all DaemonSet pods. | `{}` | | `daemonset.volumes` | Templatable string of additional `volumes` to be passed to the DaemonSet. | See [values.yaml](https://github.com/logzio/logzio-helm/blob/master/filebeat/values.yaml) | | `daemonset.volumeMounts` | Templatable string of additional `volumeMounts` to be passed to the DaemonSet. | See [values.yaml](https://github.com/logzio/logzio-helm/blob/master/filebeat/values.yaml) | | `secrets.logzioShippingToken`| Secret with your [logzio shipping token](https://app.logz.io/#/dashboard/settings/general). | `""` | @@ -172,5 +173,7 @@ helm uninstall --namespace=kube-system logzio-k8s-logs ## Change log + - **0.0.2**: + - Added option to set tolerations for daemonset (Thanks [jlewis42lines](https://github.com/jlewis42lines)!). - **0.0.1**: - Initial release. diff --git a/filebeat/templates/daemonset.yaml b/filebeat/templates/daemonset.yaml index 3a4cb4be..c38b0199 100644 --- a/filebeat/templates/daemonset.yaml +++ b/filebeat/templates/daemonset.yaml @@ -70,6 +70,10 @@ spec: readOnly: {{ .readOnly }} subPath: {{ .subPath }} {{- end }} + {{- if .Values.daemonset.tolerations }} + tolerations: +{{ toYaml .Values.daemonset.tolerations | indent 6 }} + {{- end }} volumes: - name: varlibdockercontainers hostPath: diff --git a/filebeat/values.yaml b/filebeat/values.yaml index 0fe99c81..b8683705 100644 --- a/filebeat/values.yaml +++ b/filebeat/values.yaml @@ -143,6 +143,7 @@ daemonset: requests: cpu: 100m memory: 100Mi + tolerations: {} volumes: - name: cert configMap: @@ -165,4 +166,4 @@ daemonset: secrets: logzioShippingToken: "" logzioRegion: " " - clusterName: "" \ No newline at end of file + clusterName: "" diff --git a/metricbeat/Chart.yaml b/metricbeat/Chart.yaml index 4f3986c8..f6267efd 100644 --- a/metricbeat/Chart.yaml +++ b/metricbeat/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v1 name: logzio-k8s-metrics description: A Helm chart for shipping k8s metrics to logzio.io -version: 0.0.5 +version: 0.0.6 appVersion: 7.9.1 diff --git a/metricbeat/README.md b/metricbeat/README.md index ccde5642..ae1553e4 100644 --- a/metricbeat/README.md +++ b/metricbeat/README.md @@ -193,6 +193,7 @@ Give your metrics some time to get from your system to ours, and then open [Logz | `daemonset.resources` | Allows you to set the resources for Metricbeat Deployment. | See [values.yaml](https://github.com/logzio/logzio-helm/blob/master/metricbeat/values.yaml). | | `daemonset.secretMounts` | Allows you to easily mount a secret as a file inside the DaemonSet. Useful for mounting certificates and other secrets. | See [values.yaml](https://github.com/logzio/logzio-helm/blob/master/metricbeat/values.yaml). | | `daemonset.sslVerificationMode` | Set the ssl verification mode for Metricbeat | `"none"` | +| `daemonset.tolerations` | Set [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) for all DaemonSet pods. | `{}` | | `deployment.leanConfig` | When set to `true`, sets the Deployment's Metricbeat modules to the minimal configuration required to populate Logz.io's dashboards. | See [values.yaml](https://github.com/logzio/logzio-helm/blob/master/metricbeat/values.yaml). | | `deployment.extraVolumeMounts` | Templatable string of additional volumeMounts to be passed to the Deployment. | See [values.yaml](https://github.com/logzio/logzio-helm/blob/master/metricbeat/values.yaml). | | `deployment.extraVolumes` | Templatable string of additional `volumes` to be passed to the Deployment. | See [values.yaml](https://github.com/logzio/logzio-helm/blob/master/metricbeat/values.yaml). | @@ -233,8 +234,10 @@ helm uninstall --namespace=kube-system logzio-k8s-metrics ## Change log + - **0.0.6**: + - Added option to set tolerations for daemonset (Thanks [jlewis42lines](https://github.com/jlewis42lines)!). - **0.0.5**: - - Mangage Logz.io metrics related secrets in helm + - Mangage Logz.io metrics related secrets in helm. - **0.0.4**: - Support lean configuration for modules in Deployment and Daemonset to match build-in dashboards in Logz.io. - Support custom configuration for modules in Deployment and Daemonset. diff --git a/metricbeat/templates/daemonset.yaml b/metricbeat/templates/daemonset.yaml index 96d0e49c..da803389 100644 --- a/metricbeat/templates/daemonset.yaml +++ b/metricbeat/templates/daemonset.yaml @@ -99,6 +99,10 @@ spec: {{- if .Values.extraVolumeMounts | default .Values.daemonset.extraVolumeMounts }} {{ toYaml ( .Values.extraVolumeMounts | default .Values.daemonset.extraVolumeMounts ) | indent 8 }} {{- end }} + {{- if .Values.daemonset.tolerations }} + tolerations: +{{ toYaml .Values.daemonset.tolerations | indent 6 }} + {{- end }} volumes: {{- range .Values.secretMounts | default .Values.daemonset.secretMounts }} - name: {{ .name }} diff --git a/metricbeat/values.yaml b/metricbeat/values.yaml index 3fdee521..b965edce 100644 --- a/metricbeat/values.yaml +++ b/metricbeat/values.yaml @@ -176,6 +176,7 @@ daemonset: requests: cpu: 100m memory: 100Mi + tolerations: {} secretMounts: - name: cert secretName: logzio-cert