diff --git a/docs/values.md b/docs/values.md index 726395af2a70df5c38de06ea53efc58f4ca710ab..0a9209d8362cf9ce9a67085c7438b80337b15982 100644 --- a/docs/values.md +++ b/docs/values.md @@ -3,6 +3,9 @@ This file contains the markdown version of the default values that this chart ta | Key | Type | Default | Description | |-----|------|---------|-------------| +| fluentbit.image.repository | string | `registry.cern.ch/monit/cern-it-monitoring-fluent-bit` | image repository applied to all Fluent Bit instances | +| fluentbit.image.tag | string | `3.2.6` | image tag applied to all Fluent Bit instances | +| fluentbit.image.imagePullPolicy | string | `IfNotPresent` | image pull policy applied to all Fluent Bit instances | | kubernetes.clusterName | string | - | name of the kubernetes cluster to monitor. This value will be appended to every metric and log via k8s_cluster_name label | | logs.enabled | bool | `false` | indicates if logs components should be enabled or not. If set to false no logs component will be installed nor configured | | logs.fluentbit.customParsers | string | `""` | | @@ -10,6 +13,9 @@ This file contains the markdown version of the default values that this chart ta | logs.fluentbit.extraVolumeMounts | list | `[]` | | | logs.fluentbit.extraVolumes | list | `[]` | | | logs.fluentbit.filters | string | Kubernetes filter. See `values.yaml` file. | fluentbit filters as a yaml list in a multiline string | +| logs.fluentbit.image.repository | string | `""` | image repository applied to Fluent Bit for logs if no global is set | +| logs.fluentbit.image.tag | string | `""` | image tag applied to Fluent Bit for logs if no global is set | +| logs.fluentbit.image.imagePullPolicy | string | `""` | image pull policy applied to Fluent Bit for logs if no global is set | | logs.fluentbit.inputs | string | Tail plugin over `/var/log/containers/*.log` files. See `values.yaml` file. | | logs.fluentbit.outputs | string | OpenTelemetry plugin using `otlp.endpoint`, `otlp.port`, `tenant.username` and `tenant.password`. See `values.yaml`. | fluentbit outputs as a yaml list in a multiline string | | logs.fluentbit.resources.limits.cpu | string | `"20m"` | | @@ -27,6 +33,9 @@ This file contains the markdown version of the default values that this chart ta | metrics.fluentbit.extraVolumes | list | `[]` | | | metrics.fluentbit.filters | string | `"nil"` | fluentbit filters as a yaml list in a multiline string | | metrics.fluentbit.inputs | string | Configuration to scrape local prometheus. See `values.yaml`. | fluentbit inputs as a yaml list in a multiline string | +| metrics.fluentbit.image.repository | string | `""` | image repository applied to Fluent Bit for metrics if no global is set | +| metrics.fluentbit.image.tag | string | `""` | image tag applied to Fluent Bit for metrics if no global is set | +| metrics.fluentbit.image.imagePullPolicy | string | `""` | image pull policy applied to Fluent Bit for metrics if no global is set | | metrics.fluentbit.matchQuery | string | `"match[]={job!=\"\"}"` | Query parameter to apply to the federate Prometheus URL, use this to filter and send only specific metrics | | metrics.fluentbit.prometheusScrapeBufferMaxSize | string | `"100M"` | fluentbit buffer size. The more metrics to send the bigger needs to be | | metrics.fluentbit.prometheusScrapeInterval | string | `"60s"` | interval used by fluentbit to scrape metrics from prometheus | diff --git a/templates/fluentbit-logs/daemonset.yaml b/templates/fluentbit-logs/daemonset.yaml index 017c9d67f349cb80dcf001ef334342da101de417..31a10c655801dcc53ead38ccdfc6af6d2aff0474 100644 --- a/templates/fluentbit-logs/daemonset.yaml +++ b/templates/fluentbit-logs/daemonset.yaml @@ -18,7 +18,8 @@ spec: serviceAccountName: it-monit-logs-collector-fluentbit containers: - name: it-monit-logs-collector-fluentbit - image: registry.cern.ch/monit/cern-it-monitoring-fluent-bit:3.1.8 # Not valid for windows nodes. T.B.E. (To Be Explored) + image: {{ default .Values.fluentbit.image.repository .Values.logs.fluentbit.image.repository }}:{{ default .Values.fluentbit.image.tag .Values.logs.fluentbit.image.tag }} + imagePullPolicy: {{ default .Values.fluentbit.image.imagePullPolicy .Values.logs.fluentbit.image.imagePullPolicy }} command: [ "/fluent-bit/bin/fluent-bit" ] args: - --workdir=/fluent-bit/etc diff --git a/templates/fluentbit-metrics/statefulset.yaml b/templates/fluentbit-metrics/statefulset.yaml index a967d7695be004ccb48084c1502388b0b7734bb0..066c2362115d41cc8531f8a614500a4512a4e6fa 100644 --- a/templates/fluentbit-metrics/statefulset.yaml +++ b/templates/fluentbit-metrics/statefulset.yaml @@ -18,7 +18,8 @@ spec: spec: containers: - name: it-monit-metrics-collector-fluentbit - image: registry.cern.ch/monit/cern-it-monitoring-fluent-bit:3.2.6 # Not valid for windows nodes. T.B.E. (To Be Explored) + image: {{ default .Values.fluentbit.image.repository .Values.metrics.fluentbit.image.repository }}:{{ default .Values.fluentbit.image.tag .Values.metrics.fluentbit.image.tag }} + imagePullPolicy: {{ default .Values.fluentbit.image.imagePullPolicy .Values.metrics.fluentbit.image.imagePullPolicy }} command: [ "/fluent-bit/bin/fluent-bit" ] args: - --workdir=/fluent-bit/etc diff --git a/tests/fluentbit-logs/daemonset.yaml b/tests/fluentbit-logs/daemonset.yaml index e493ee1e23964d2ed7203783b13f9894130ee77a..1c91aaa2a343a901cd7c2714b0aa138f7687b600 100644 --- a/tests/fluentbit-logs/daemonset.yaml +++ b/tests/fluentbit-logs/daemonset.yaml @@ -59,3 +59,28 @@ tests: name: test configMap: name: test-configmap + - it: should deploy by default with an image served by registry.cern.ch/monit and semver + set: + logs.enabled: true + logs.fluentbit.enabled: true + asserts: + - matchRegex: + path: spec.template.spec.containers[0].image + pattern: ^registry\.cern\.ch/monit/cern-it-monitoring-fluent-bit:\d+\.\d+\.\d+$ + - equal: + path: spec.template.spec.containers[0].imagePullPolicy + value: IfNotPresent + - it: the image repository and tag can be overridden at component level + set: + logs.enabled: true + logs.fluentbit.enabled: true + logs.fluentbit.image.repository: registry.cern/test + logs.fluentbit.image.tag: 1 + logs.fluentbit.image.imagePullPolicy: Always + asserts: + - equal: + path: spec.template.spec.containers[0].image + value: registry.cern/test:1 + - equal: + path: spec.template.spec.containers[0].imagePullPolicy + value: Always diff --git a/tests/fluentbit-metrics/statefulset.yaml b/tests/fluentbit-metrics/statefulset.yaml index b5fdafd300ab7b6202e1e556fcf46204724e09e8..814904700c8721a8fda1b4292f2093d27e6783c9 100644 --- a/tests/fluentbit-metrics/statefulset.yaml +++ b/tests/fluentbit-metrics/statefulset.yaml @@ -50,3 +50,28 @@ tests: name: test configMap: name: test-configmap + - it: should deploy by default with an image served by registry.cern.ch/monit and semver + set: + metrics.enabled: true + metrics.fluentbit.enabled: true + asserts: + - matchRegex: + path: spec.template.spec.containers[0].image + pattern: ^registry\.cern\.ch/monit/cern-it-monitoring-fluent-bit:\d+\.\d+\.\d+$ + - equal: + path: spec.template.spec.containers[0].imagePullPolicy + value: IfNotPresent + - it: the image repository, tag and pull policy can be overridden at component level + set: + metrics.enabled: true + metrics.fluentbit.enabled: true + metrics.fluentbit.image.repository: registry.cern/test + metrics.fluentbit.image.tag: 1 + metrics.fluentbit.image.imagePullPolicy: Always + asserts: + - equal: + path: spec.template.spec.containers[0].image + value: registry.cern/test:1 + - equal: + path: spec.template.spec.containers[0].imagePullPolicy + value: Always diff --git a/values.yaml b/values.yaml index 9e9af9c3bac4de3c9fc0e47868f8dac07229270e..0a7ebcbc9b0e89a97b87608bbf66542106bfff66 100644 --- a/values.yaml +++ b/values.yaml @@ -22,6 +22,16 @@ otlp: # -- name of the kubernetes cluster to monitor. This value will be appended to very metric and log via k8sClusterName label. This bit is required if fluentbit is enabled (default) # clusterName: nil +fluentbit: + # Default image used by all Fluent Bit instances + image: + # -- If defined, a repository applied to all Fluent Bit instances + repository: registry.cern.ch/monit/cern-it-monitoring-fluent-bit + # -- If defined, a tag applied to all Fluent Bit instances + tag: 3.2.6 + # -- If defined, an image pull policy applied to all Fluent Bit instances + imagePullPolicy: IfNotPresent + # The metrics section includes all the components meant to produce, scrape, # collect or forward metrics. You can configure all components independently. metrics: @@ -141,6 +151,17 @@ metrics: fluentbit: # -- if true fluentbit metrics forwarder will be installed enabled: true + ## Fluent Bit for metrics image + image: + # -- Repository to use for Fluent Bit (metrics) + # @default -- `""` (defaults to fluentbit.image.repository) + repository: "" + # -- Tag to use for Fluent Bit (metrics) + # @default -- `""` (defaults to fluentbit.image.tag) + tag: "" + # -- Image pull policy for Fluent Bit (metrics) + # @default -- `""` (defaults to fluentbit.image.imagePullPolicy) + imagePullPolicy: "" replicas: 2 # If set it will override the metrics.defaultNodeSelector. nodeSelector: {} @@ -315,7 +336,17 @@ logs: fluentbit: # -- indicates if fluentbit logs component should be installed or not enabled: false - + ## Fluent Bit for logs image + image: + # -- Repository to use for Fluent Bit (logs) + # @default -- `""` (defaults to fluentbit.image.repository) + repository: "" + # -- Tag to use for Fluent Bit (logs) + # @default -- `""` (defaults to fluentbit.image.tag) + tag: "" + # -- Image pull policy for Fluent Bit (logs) + # @default -- `""` (defaults to fluentbit.image.imagePullPolicy) + imagePullPolicy: "" # -- interval used by the local prometheus (if installed) to scrape metrics from logs fluentbits scrapeInterval: "15s" resources: