Skip to content

Commit 2e845a8

Browse files
committed
chore(k8s/magiclove/fluent-bit): include k8s host
1 parent f9a8390 commit 2e845a8

File tree

2 files changed

+27
-17
lines changed

2 files changed

+27
-17
lines changed

k8s/magiclove/fluent_bit/config_map_list.cue

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package fluent_bit
22

33
import (
44
"encoding/yaml"
5+
"strings"
56

67
"k8s.io/api/core/v1"
78
)
@@ -37,7 +38,7 @@ import (
3738
daemon: "off"
3839
flush: 1
3940
daemon: "off"
40-
log_level: "warn"
41+
log_level: "info"
4142
parsers_file: "/fluent-bit/etc/conf/custom_parsers.conf"
4243
http_server: "on"
4344
http_listen: "0.0.0.0"
@@ -73,30 +74,31 @@ import (
7374
merge_log: "on"
7475
"k8s-logging.parser": "on"
7576
"k8s-logging.exclude": "on"
76-
namespace_labels: "on"
7777
}, {
7878
name: "modify"
7979
match: "kubernetes.*"
8080
add: "source kubernetes"
8181
remove: "logtag"
82-
}, {
83-
name: "nest"
84-
match: "*"
85-
wildcard: "pod_name"
86-
operation: "lift"
87-
nested_under: "kubernetes"
88-
add_prefix: "kubernetes_"
8982
}]
9083
outputs: [{
91-
name: "http"
92-
match: "*"
93-
host: "victoria-logs.victoria-logs"
94-
port: 80
95-
compress: "gzip"
96-
uri: "/insert/jsonline?_stream_fields=stream,source,kubernetes_namespace_name,kubernetes_pod_name,kubernetes_container_name&_msg_field=log&_time_field=date"
84+
name: "http"
85+
match: "*"
86+
host: "victoria-logs.victoria-logs"
87+
port: 80
88+
compress: "gzip"
89+
90+
let _stream_fields = strings.Join([
91+
"stream",
92+
"source",
93+
"kubernetes.host",
94+
"kubernetes.namespace_name",
95+
"kubernetes.pod_name",
96+
"kubernetes.container_name",
97+
], ",")
98+
99+
uri: "/insert/jsonline?_stream_fields=\(_stream_fields)&_msg_field=log&_time_field=date"
97100
format: "json_lines"
98101
json_date_format: "iso8601"
99-
header: ["AccountID 0", "ProjectID 0"]
100102
}]
101103
}
102104
})

k8s/magiclove/fluent_bit/daemon_set_list.cue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ import (
1818
spec: {
1919
selector: matchLabels: "app.kubernetes.io/name": #Name
2020
template: {
21-
metadata: labels: "app.kubernetes.io/name": #Name
21+
metadata: {
22+
annotations: "fluentbit.io/exclude": "true"
23+
labels: "app.kubernetes.io/name": #Name
24+
}
2225
spec: {
2326
volumes: [{
2427
name: "config"
@@ -85,6 +88,11 @@ import (
8588
// fsGroup: 2000
8689
// seccompProfile: type: v1.#SeccompProfileTypeRuntimeDefault
8790
// }
91+
tolerations: [{
92+
key: "node-role.kubernetes.io/control-plane"
93+
operator: v1.#TolerationOpExists
94+
effect: v1.#TaintEffectNoSchedule
95+
}]
8896
}
8997
}
9098
}

0 commit comments

Comments
 (0)