Comments (10)
Reading this: https://github.com/fabric8io/fluent-plugin-kubernetes_metadata_filter#environment-variables-for-kubernetes
I think it makes sense in general to expose the nodeName as K8S_NODE_NAME
to the fluentd process (if only as an optimisation).
I just thought that could also be used to annotate the systemd unit logs.
from kube-fluentd-operator.
So this sort of works:
- command:
- /bin/config-reloader
...
- --meta-key=metadata
- --meta-values=node=$(NODE_NAME)
env:
- name: NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
from kube-fluentd-operator.
Hi @databus23,
Information about kubernetes is nested under the "kubernetes" key - it's a core feature of the fluent-plugin-kubernetes_metadata_filter
plugin.
For example, a log event would look like this and what you need is kubernetes.host
:
{
"kubernetes": {
"container_image_id": "docker-pullable://.......",
"container_name": "...",
"host": "ip-XXXXX.us-west-2.compute.internal",
"pod_id": "3772c64f-7e0b-11e8-ae9f-06dea036ca4c",
"container_image": "xxxx",
"namespace_name": "xxxxx",
"pod_name": "xxxxx-998d48b69-skbhg",
"labels": {
"app": "test",
"environment": "hello"
}
}
}
from kube-fluentd-operator.
@jvassev But this is not available for logs from system units. How can I know which kubelet.service
(which node) a log line comes from?
from kube-fluentd-operator.
You're right, I didn't consider systemd at all. I think 58d1869 should fix it.
from kube-fluentd-operator.
I've just published the image jvassev/kube-fluentd-operator:v1.4.0-5-g58d1869
with the change applied. Can you try with it by upgrading the daemonset?
from kube-fluentd-operator.
@jvassev No it doesn't. I tried that, _HOSTNAME
just contains localhost
from kube-fluentd-operator.
Are you sure the machines have their hostname configured properly? I've checked on several debian hosts and it looks good.
You can try journalctl -o json-pretty
and see the raw data before it reaches fluentd.
from kube-fluentd-operator.
d819652 enables the K8S_NODE_NAME, thanks for the suggestion!
The chart version is bumped to 0.2.2.
from kube-fluentd-operator.
@jvassev Ok, you got me. My cloud VMs had a metadata problem and default to localhost
for the hostname...
from kube-fluentd-operator.
Related Issues (20)
- Support for image.registry within log-router helm chart
- Deleted files not released under extreme load HOT 2
- Exception thrown when `detect_exceptions` filter is not being used HOT 2
- Add InstanceID in the ENV for fluentd helm charts HOT 1
- Opensearch plugin support
- More of a question HOT 1
- docs(README.md): missing documentation on admins-ns HOT 1
- docs(FluentdConfig): instructions for installing without helm produce decoding error HOT 1
- docs(releases): Release documentation v1.16.5 missing enhancement
- install fluent-plugin-dynatrace in base-image
- Failed to make build-image HOT 1
- Could somebody show the link of video `meetup-2018-11-22`, i googled for a long time, not found any. HOT 1
- We are seeing log delay/missing on KFO HOT 2
- Wrong helm values processing in secret.yaml template
- Huge increase in docker image size HOT 4
- v1.17.5 log level setting debug will trigger a crash HOT 3
- Namespace Selector Flag Based on Namespace Labels
- Support for injecting podLabels to the daemonset when deploying using the helm-chart HOT 2
- fluent-plugin-verticajson v0.0.6 Incompatible with Ruby 3.x
- Release 1.8.2 is missing `log-router-0.4.0.tgz` artifact HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kube-fluentd-operator.