-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow to override sidecar configuration (#551)
* feat(operator): expose sidecar configuration Signed-off-by: Dominik Rosiek <[email protected]> * feat(helm): expose sidecar configuration Signed-off-by: Dominik Rosiek <[email protected]> * tests(operator): add e2e tests Signed-off-by: Dominik Rosiek <[email protected]> * chore: set default mountPath Signed-off-by: Dominik Rosiek <[email protected]> * tests(e2e): fix test with custom configuration Signed-off-by: Dominik Rosiek <[email protected]> * refactor: use const for volume mount name Signed-off-by: Dominik Rosiek <[email protected]> * docs: add information how to override sidecar configuration Signed-off-by: Dominik Rosiek <[email protected]> * feat: use configMap as exemplar for all namespaces Signed-off-by: Dominik Rosiek <[email protected]> * fix: fix rebase Signed-off-by: Dominik Rosiek <[email protected]> * refactor: move configmap to values * tests: fix e2e Signed-off-by: Dominik Rosiek <[email protected]> * chor: install kuttl in vagrant Signed-off-by: Dominik Rosiek <[email protected]> * refactor(operator): move deletion logic to new function Signed-off-by: Dominik Rosiek <[email protected]> * tests: adjust e2e test for custom configuration Signed-off-by: Dominik Rosiek <[email protected]> * feat(helm): update clusterRole to support configmaps management Signed-off-by: Dominik Rosiek <[email protected]> * tests: fix sidecar test for custom configuration test Signed-off-by: Dominik Rosiek <[email protected]> * tests: remove resource requests Signed-off-by: Dominik Rosiek <[email protected]> * tests: set resources to 0 Signed-off-by: Dominik Rosiek <[email protected]> * feat(helm): make sidecar configuration optional Signed-off-by: Dominik Rosiek <[email protected]> * chore(helm): use empty for conditional checks in templates Signed-off-by: Dominik Rosiek <[email protected]> * docs: update overriding tailing sidecar configuration Signed-off-by: Dominik Rosiek <[email protected]> --------- Signed-off-by: Dominik Rosiek <[email protected]>
- Loading branch information
1 parent
f21acb4
commit d0f16a3
Showing
37 changed files
with
951 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
helm/tailing-sidecar-operator/templates/sidecar-configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{{- if not (empty .Values.sidecar.config.content) }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ template "tailing-sidecar.configMap.name" . }} | ||
labels: | ||
{{- include "tailing-sidecar-operator.labels" . | nindent 4 }} | ||
data: | ||
{{- toYaml .Values.sidecar.config.content | nindent 2 }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
operator: | ||
image: | ||
repository: registry.localhost:5000/sumologic/tailing-sidecar-operator | ||
tag: test | ||
|
||
sidecar: | ||
image: | ||
repository: registry.localhost:5000/sumologic/tailing-sidecar | ||
tag: test | ||
|
||
resources: | ||
limits: | ||
cpu: "0" | ||
memory: "0" | ||
requests: | ||
cpu: "0" | ||
memory: "0" | ||
|
||
config: | ||
content: | ||
fluent-bit.conf: | | ||
[SERVICE] | ||
# Flush | ||
# ===== | ||
# set an interval of seconds before to flush records to a destination | ||
flush 1 | ||
# Daemon | ||
# ====== | ||
# instruct Fluent Bit to run in foreground or background mode. | ||
daemon Off | ||
# Log_Level | ||
# ========= | ||
# Set the verbosity level of the service, values can be: | ||
# | ||
# - error | ||
# - warning | ||
# - info | ||
# - debug | ||
# - trace | ||
# | ||
# e.g. when 'info' is set, that means it includes 'error' and 'warning'. | ||
log_level ${LOG_LEVEL} | ||
# Parsers File | ||
# ============ | ||
# specify an optional 'Parsers' configuration file | ||
parsers_file parsers.conf | ||
# Plugins File | ||
# ============ | ||
# specify an optional 'Plugins' configuration file to load external plugins. | ||
plugins_file plugins.conf | ||
# HTTP Server | ||
# =========== | ||
# Enable/Disable the built-in HTTP Server for metrics | ||
http_server Off | ||
http_listen 0.0.0.0 | ||
http_port 2020 | ||
# Storage | ||
# ======= | ||
# Fluent Bit can use memory and filesystem buffering based mechanisms | ||
# | ||
# - https://docs.fluentbit.io/manual/administration/buffering-and-storage | ||
# | ||
# storage metrics | ||
# --------------- | ||
# publish storage pipeline metrics in '/api/v1/storage'. The metrics are | ||
# exported only if the 'http_server' option is enabled. | ||
# | ||
storage.metrics on | ||
# storage.path | ||
# ------------ | ||
# absolute file system path to store filesystem data buffers (chunks). | ||
# | ||
# storage.path /tmp/storage | ||
# storage.sync | ||
# ------------ | ||
# configure the synchronization mode used to store the data into the | ||
# filesystem. It can take the values normal or full. | ||
# | ||
# storage.sync normal | ||
# storage.checksum | ||
# ---------------- | ||
# enable the data integrity check when writing and reading data from the | ||
# filesystem. The storage layer uses the CRC32 algorithm. | ||
# | ||
# storage.checksum off | ||
# storage.backlog.mem_limit | ||
# ------------------------- | ||
# if storage.path is set, Fluent Bit will look for data chunks that were | ||
# not delivered and are still in the storage layer, these are called | ||
# backlog data. This option configure a hint of maximum value of memory | ||
# to use when processing these records. | ||
# | ||
# storage.backlog.mem_limit 5M | ||
[INPUT] | ||
name tail | ||
path ${PATH_TO_TAIL} | ||
Read_from_Head On | ||
Refresh_Interval 1 | ||
Rotate_Wait 60 | ||
Mem_Buf_Limit 5MB | ||
DB /tailing-sidecar/var/fluent-bit-state.db | ||
DB.Sync Normal | ||
[FILTER] | ||
Name modify | ||
Match * | ||
Set log modified | ||
[OUTPUT] | ||
name gstdout | ||
plugins.conf: | | ||
[PLUGINS] | ||
Path /tailing-sidecar/lib/out_gstdout.so | ||
parsers.conf: | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestSuite | ||
artifactsDir: ./tests/_build/artifacts/ | ||
testDirs: | ||
- ./tests/modified/sidecar/ | ||
- ./tests/modified/operator/ | ||
timeout: 150 | ||
parallel: 4 | ||
startKIND: true | ||
kindNodeCache: true | ||
kindContainers: | ||
- registry.localhost:5000/sumologic/tailing-sidecar-operator:test | ||
- registry.localhost:5000/sumologic/tailing-sidecar:test | ||
commands: | ||
- command: helm upgrade --install test-release ./helm/tailing-sidecar-operator -f ./helm/tests/values.withCustomConfiguration.yaml -n tailing-sidecar-system --create-namespace | ||
- command: kubectl wait --for=condition=available --timeout 300s deploy -l app.kubernetes.io/name=tailing-sidecar-operator -n tailing-sidecar-system | ||
- command: kubectl wait --for=condition=ready --timeout 300s pod -l app.kubernetes.io/name=tailing-sidecar-operator -n tailing-sidecar-system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.