From f5953fc85235e8e681feffd86ed9816a30410153 Mon Sep 17 00:00:00 2001 From: CR Drost Date: Tue, 5 Dec 2023 10:12:25 -0800 Subject: [PATCH 1/3] aws-for-fluent-bit: Add extraLabels parameter This adds an "extraLabels" parameter to add labels to an internal helper that maintains the labels for the various resources. Also bumps the chart version accordingly. --- stable/aws-for-fluent-bit/Chart.yaml | 2 +- stable/aws-for-fluent-bit/README.md | 1 + stable/aws-for-fluent-bit/templates/_helpers.tpl | 3 +++ stable/aws-for-fluent-bit/values.yaml | 3 ++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/stable/aws-for-fluent-bit/Chart.yaml b/stable/aws-for-fluent-bit/Chart.yaml index 69868c9f0..8df324955 100644 --- a/stable/aws-for-fluent-bit/Chart.yaml +++ b/stable/aws-for-fluent-bit/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: aws-for-fluent-bit description: A Helm chart to deploy aws-for-fluent-bit project -version: 0.1.32 +version: 0.1.33 appVersion: 2.31.12.20231011 home: https://github.com/aws/eks-charts icon: https://raw.githubusercontent.com/aws/eks-charts/master/docs/logo/aws.png diff --git a/stable/aws-for-fluent-bit/README.md b/stable/aws-for-fluent-bit/README.md index cc256b7ba..e640c2712 100755 --- a/stable/aws-for-fluent-bit/README.md +++ b/stable/aws-for-fluent-bit/README.md @@ -49,6 +49,7 @@ helm delete aws-for-fluent-bit --namespace kube-system | `input.memBufLimit` | Limit the [buffer memory](https://github.com/aws-samples/amazon-ecs-firelens-examples/tree/mainline/examples/fluent-bit/oomkill-prevention) used by the tail input. | `5MB` | | `input.skipLongLines` | `On` means that long lines will be skipped [instead of the entire log file](https://github.com/aws/aws-for-fluent-bit/blob/mainline/troubleshooting/debugging.md#tail-input-skipping-file) | `On` | | `input.refreshInterval` | The interval to refresh the list of watched files in seconds. | `10` | +| `extraLabels` | Dict of Kubernetes labels to add to the defaults shipped by this chart | `{}` | | `extraInputs` | Append to existing input with this value | `""` | | `additionalInputs` | Adding more inputs with this value | `""` | | `filter.*` | Values for kubernetes filter | | diff --git a/stable/aws-for-fluent-bit/templates/_helpers.tpl b/stable/aws-for-fluent-bit/templates/_helpers.tpl index edd3514a4..727f8f921 100644 --- a/stable/aws-for-fluent-bit/templates/_helpers.tpl +++ b/stable/aws-for-fluent-bit/templates/_helpers.tpl @@ -41,6 +41,9 @@ helm.sh/chart: {{ include "aws-for-fluent-bit.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.extraLabels }} +{{ toYaml .Values.extraLabels }} +{{- end }} {{- end -}} {{/* diff --git a/stable/aws-for-fluent-bit/values.yaml b/stable/aws-for-fluent-bit/values.yaml index 8d41adaf5..8b5945f30 100644 --- a/stable/aws-for-fluent-bit/values.yaml +++ b/stable/aws-for-fluent-bit/values.yaml @@ -10,6 +10,7 @@ image: imagePullSecrets: [] nameOverride: "" fullnameOverride: "" +extraLabels: {} podSecurityContext: {} # runAsUser: 1000 @@ -388,4 +389,4 @@ serviceMonitor: # path: /metrics # interval: 30s # scrapeTimeout: 10s - # scheme: http \ No newline at end of file + # scheme: http From 6e90cf649503b9bce8da4199c24a6ae9c3f2fd7c Mon Sep 17 00:00:00 2001 From: CR Drost Date: Fri, 8 Dec 2023 03:14:24 +0000 Subject: [PATCH 2/3] aws-for-fluent-bit: Fix ServiceMonitor ns selector This commit fixes a namespace selector in the Prometheus Operator's ServiceMonitor definition. If you deploy the Helm release into, say, the default namespace, but use a namespaceOverride to put Fluent Bit into the "fluent-bit" or "cloudwatch" namespace, then this will look in the wrong Kubernetes namespace for your service and you won't get metrics. --- stable/aws-for-fluent-bit/templates/servicemonitor.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stable/aws-for-fluent-bit/templates/servicemonitor.yaml b/stable/aws-for-fluent-bit/templates/servicemonitor.yaml index 388476caa..19caad38c 100644 --- a/stable/aws-for-fluent-bit/templates/servicemonitor.yaml +++ b/stable/aws-for-fluent-bit/templates/servicemonitor.yaml @@ -36,7 +36,7 @@ spec: jobLabel: {{ default "app.kubernetes.io/instance" .Values.serviceMonitor.jobLabel }} namespaceSelector: matchNames: - - {{ .Release.Namespace }} + - {{ include "aws-for-fluent-bit.namespace" . }} selector: matchLabels: {{- include "aws-for-fluent-bit.selectorLabels" . | nindent 6 }} From c202cb825ef0b42c164f6223b78cd20c8803c77c Mon Sep 17 00:00:00 2001 From: CR Drost Date: Wed, 13 Dec 2023 18:40:52 +0000 Subject: [PATCH 3/3] Add full labels to DaemonSet Custom labeling should be applied to the DaemonSet too, and this is possible only if we use the full labels instead of just the selectorLabels. --- stable/aws-for-fluent-bit/templates/daemonset.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stable/aws-for-fluent-bit/templates/daemonset.yaml b/stable/aws-for-fluent-bit/templates/daemonset.yaml index 23e551da0..d72708a57 100755 --- a/stable/aws-for-fluent-bit/templates/daemonset.yaml +++ b/stable/aws-for-fluent-bit/templates/daemonset.yaml @@ -19,7 +19,7 @@ spec: {{- toYaml .Values.annotations | nindent 8 }} {{- end }} labels: - {{- include "aws-for-fluent-bit.selectorLabels" . | nindent 8 }} + {{- include "aws-for-fluent-bit.labels" . | nindent 8 }} spec: {{- if .Values.imagePullSecrets }} imagePullSecrets: