How to debug host service / kernel logging not working? #9931
-
I have tried enabling sendings logs on one of my nodes by following the documentation but I'm having some trouble getting it working with Promtail and unsure how to go about debugging why it isn't working. What I've changed:
What I've confirmed so far:
Is there anything more I can do to debug this and figure out why the logs might not be sending? Can anyone see anything that might be wrong in my setup? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
The only supported protocol (in the docs you referenced) is straight TCP/UDP, so not sure what you mean by You should be able to |
Beta Was this translation helpful? Give feedback.
-
For those interested, I managed to come up with a hacky workaround 😅 I deployed https://github.com/bakins/tcp2stdout as a daemonset on all nodes with: apiVersion: apps/v1
kind: DaemonSet
metadata:
name: tcp2stdout
namespace: monitoring
labels:
app.kubernetes.io/name: tcp2stdout
annotations:
reloader.stakater.com/search: "true"
spec:
selector:
matchLabels:
app.kubernetes.io/name: tcp2stdout
template:
metadata:
labels:
app.kubernetes.io/name: tcp2stdout
annotations:
prometheus.io/scrape: "false"
spec:
hostNetwork: true
containers:
- name: tcp2stdout
image: "quay.io/bakins/tcp2stdout:v0.1.0"
imagePullPolicy: IfNotPresent
args:
- "-addr"
- "0.0.0.0:1313"
ports:
- containerPort: 1313
name: tcplistener
securityContext:
readOnlyRootFilesystem: true
runAsGroup: 1000
runAsUser: 1000
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
operator: Exists
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
operator: Exists
- effect: NoExecute
key: node.kubernetes.io/not-ready
operator: Exists
- effect: NoExecute
key: node.kubernetes.io/unreachable
operator: Exists
- effect: NoSchedule
key: node.kubernetes.io/disk-pressure
operator: Exists
- effect: NoSchedule
key: node.kubernetes.io/memory-pressure
operator: Exists
- effect: NoSchedule
key: node.kubernetes.io/pid-pressure
operator: Exists
- effect: NoSchedule
key: node.kubernetes.io/unschedulable
operator: Exists I then updated my promtail config with the following additional pipeline_stage: - match:
selector: '{app="tcp2stdout"}'
stages:
- json:
expressions:
level: "\"talos-level\""
service: "\"talos-service\""
timestamp: "\"talos-time\""
output: msg
- labels:
level:
service:
timestamp:
- timestamp:
source: timestamp
format: RFC3339
- output:
source: output I then updated my talos machineconfig to point to that tcp2stdout proxy: logging:
destinations:
- endpoint: "tcp://127.0.0.1:1313/"
format: "json_lines" It's not perfect but it at least gives me a way to persist some logs for later debugging. |
Beta Was this translation helpful? Give feedback.
The only supported protocol (in the docs you referenced) is straight TCP/UDP, so not sure what you mean by
/promtail/api/v1/raw/
.You should be able to
echo '{"message": "foo"}' | nc 127.0.0.1 3001