Skip to content

Commit

Permalink
Fix CI for fluentd test (#441)
Browse files Browse the repository at this point in the history
* Don't wait for elastic to be up
* Add metrics port definition so probes can work
* Wait a bit for fluentd to be up (time-out after 5 min)

Signed-off-by: Paulo E. Castro <pecastro@wormholenet.com>
  • Loading branch information
pecastro committed Feb 27, 2024
1 parent b26c332 commit 300f3aa
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/fluentd/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: fluentd
description: A Helm chart for Kubernetes
# type: application
version: 0.5.0
version: 0.5.1
appVersion: v1.16.2
icon: https://www.fluentd.org/images/miscellany/fluentd-logo_2x.png
home: https://www.fluentd.org/
Expand Down
18 changes: 16 additions & 2 deletions charts/fluentd/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{{/*
Target the very simple case where
fluentd is deployed with the default values
If the fluentd config is overriden and the metrics server removed
this will fail.
*/}}
{{ if empty .Values.service.ports }}
apiVersion: v1
kind: Pod
metadata:
Expand All @@ -10,6 +17,13 @@ spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "fluentd.fullname" . }}:{{ .Values.service.port }}']
command:
- sh
- -c
- |
set -e
# Give fluentd some time to start up
while :; do nc -vz {{ include "fluentd.fullname" . }}:24231 && break; sleep 1; done
wget '{{ include "fluentd.fullname" . }}:24231/metrics'
restartPolicy: Never
{{ end }}
10 changes: 10 additions & 0 deletions charts/fluentd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,14 @@ fileConfigs:
emit_unmatched_lines true
</source>
# expose metrics in prometheus format
<source>
@type prometheus
bind 0.0.0.0
port 24231
metrics_path /metrics
</source>
02_filters.conf: |-
<label @KUBERNETES>
<match kubernetes.var.log.containers.fluentd**>
Expand Down Expand Up @@ -375,6 +383,8 @@ fileConfigs:
path ""
user elastic
password changeme
# Don't wait for elastic to start up.
verify_es_version_at_startup false
</match>
</label>
Expand Down

0 comments on commit 300f3aa

Please sign in to comment.