Skip to content

Commit

Permalink
Allow Windows Daemonset resource to be created conditionally (#413)
Browse files Browse the repository at this point in the history
* Enable configuring whether the Windows Daemonset is enabled or not

 - default for the configuration is true for backwards compatibility
 - wrap the daemonset as optional to allow it to be turned off when not required
 - wrap the exclude paths helper for windows in the same check

* fix template

---------

Co-authored-by: mirii1994 <[email protected]>
  • Loading branch information
chriskurzeja and mirii1994 authored Jan 10, 2024
1 parent 6bf709e commit 7594aad
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/fluentd/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: A Helm chart for shipping Kubernetes logs via Fluentd.
keywords:
- logging
- fluentd
version: 0.28.0
version: 0.28.1
appVersion: 1.5.1
maintainers:
- name: Miri Bar
Expand Down
4 changes: 3 additions & 1 deletion charts/fluentd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ helm install -n monitoring \
| `daemonset.init.containerImage` | Init container image for the fluentd daemonset. | `busybox` |
| `daemonset.priorityClassName` | Set [priorityClassName](https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/) for all DaemonSet pods. | `""` |
| `daemonset.updateStrategy` | Strategy to use when updating the Daemonset. | `{}` |
| `windowsDaemonset.enabled` | Enables Fluentd Daemonset for Windows. | `true` |
| `windowsDaemonset.kubernetesVerifySsl` | Enables to validate SSL certificates (windows). | `true` |
| `windowsDaemonset.auditLogFormat` | Match Fluentd's format for kube-apiserver audit logs. Set to `audit-json` if your audit logs are in json format. (windows) | `audit` |
| `windowsDaemonset.containerdRuntime` | **Deprecated from chart version 0.1.0.** Determines whether to use a configuration for a Containerd runtime. Set to `false` if your cluster doesn't use Containerd as CRI. (windows) | `true` |
Expand Down Expand Up @@ -300,7 +301,8 @@ If needed, the fluentd image can be changed to support windows server 2022 with


## Change log

- **0.28.1**:
- Added `windowsDaemonset.enabled` customization.
- **0.28.0**:
- Added `daemonset.initContainerSecurityContext` customization.
- Added `daemonset.updateStrategy` customization.
Expand Down
2 changes: 2 additions & 0 deletions charts/fluentd/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,14 @@ Builds the list for exclude paths in the tail for the containers
Builds the list for exclude paths in the tail for the containers - windows
*/}}
{{- define "logzio.windowsExcludePath" }}
{{- if .Values.windowsDaemonset.enabled }}
{{- if .Values.windowsDaemonset.extraExclude }}
{{- cat .Values.windowsDaemonset.excludeFluentdPath "," .Values.windowsDaemonset.extraExclude | nospace }}
{{- else }}
{{- print .Values.windowsDaemonset.excludeFluentdPath }}
{{- end -}}
{{- end -}}
{{- end -}}


{{/*
Expand Down
2 changes: 2 additions & 0 deletions charts/fluentd/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ spec:
updateStrategy: {{ toYaml .Values.daemonset.updateStrategy | nindent 4 }}
{{- end }}

{{- if .Values.windowsDaemonset.enabled }}
---
apiVersion: {{ .Values.apiVersions.daemonset }}
kind: DaemonSet
Expand Down Expand Up @@ -314,3 +315,4 @@ spec:
{{- if .Values.windowsDaemonset.updateStrategy }}
updateStrategy: {{ toYaml .Values.windowsDaemonset.updateStrategy | nindent 4 }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/fluentd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ daemonset:
updateStrategy: {}

windowsDaemonset:
# Controls whether the Daemonset is enabled for Windows
enabled: true
# Tolerations for the Daemonset for Windows nodes
tolerations:
- key: node-role.kubernetes.io/master
Expand Down

0 comments on commit 7594aad

Please sign in to comment.