Skip to content

[rancher-logging 4.10.0-rancher.24] add node info for rke2 rancher-logging chart#255

Open
rmoioliveira wants to merge 2 commits into
rancher:mainfrom
rmoioliveira:sure-10735-2
Open

[rancher-logging 4.10.0-rancher.24] add node info for rke2 rancher-logging chart#255
rmoioliveira wants to merge 2 commits into
rancher:mainfrom
rmoioliveira:sure-10735-2

Conversation

@rmoioliveira

@rmoioliveira rmoioliveira commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

The rancher-logging default configuration collects and forwards kubelet and journald logs, eliminating the need for additional HostTailers configuration. However, as currently deployed, these logs lack the node or hostname reference, which is inconvenient for users who expect that information to be present. To address this issue, we are including the node information that is currently missing from the rke2 system-level logs.

Closes SURE-10735

Signed-off-by: Rodolfo Mói de Oliveira rodolfo.oliveira@suse.com

Signed-off-by: Rodolfo Mói de Oliveira <rodolfo.oliveira@suse.com>
The rancher-logging default configuration collects and forwards kubelet
and journald logs, eliminating the need for additional HostTailers
configuration. However, as currently deployed, these logs lack the node
or hostname reference, which is inconvenient for users who expect that
information to be present. To address this issue, we are including the
node information that is currently missing from the rke2 system-level
logs.

Closes SURE-10735

Signed-off-by: Rodolfo Mói de Oliveira <rodolfo.oliveira@suse.com>
@rmoioliveira rmoioliveira changed the title [rancher-logging/4.10] add node_name field to rke2 default logs [rancher-logging/4.10] add node info for rke2 rancher-logging chart Jun 8, 2026
@rmoioliveira rmoioliveira marked this pull request as ready for review June 8, 2026 20:00
@rmoioliveira rmoioliveira changed the title [rancher-logging/4.10] add node info for rke2 rancher-logging chart [rancher-logging 4.10.0-rancher.24] add node info for rke2 rancher-logging chart Jun 8, 2026
@rmoioliveira

rmoioliveira commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

For QA testing

To test the addition of the node information that is currently missing from the rke2 system-level logs, follow the steps below:

  1. Provision a Rancher v2.14.2 instance with a single all role node RKE2 custom cluster v1.35.4+rke2r1.
  2. Add the ClusterRepo with the new rancher-logging chart:
apiVersion: catalog.cattle.io/v1
kind: ClusterRepo
metadata:
  name: rmoioliveira-sure-10735-2
spec:
  gitBranch: sure-10735-2
  gitRepo: https://github.com/rmoioliveira/ob-team-charts
  1. Install rancher-logging 109.0.0+up4.10.0-rancher.24 via Apps -> Charts with all default options, observe that Rancher automatically sets additionalLoggingSources.rke2.enabled: true.

  2. Create ClusterFlow and ClusterOutput to capture the kubelet logs scraped by rancher-logging-rke2-journald-aggregator:

---
apiVersion: logging.banzaicloud.io/v1beta1
kind: ClusterFlow
metadata:
  name: kubelet-cluster-flow
  namespace: cattle-logging-system
spec:
  globalOutputRefs:
    - kubelet-cluster-output
  match:
    - select: {}
---
apiVersion: logging.banzaicloud.io/v1beta1
kind: ClusterOutput
metadata:
  name: kubelet-cluster-output
  namespace: cattle-logging-system
spec:
 file:
    path: /tmp/logs/${tag}/%Y/%m/%d/%H.%M
    buffer:
      timekey: 1m
      timekey_wait: 10s
      timekey_use_utc: true
  1. Execute a shell on the rancher-logging-root-fluentd-0 Pod in the cattle-logging-system namespace and look at the kubelet logs in the /tmp directory. Note a node identifier is now present in the logs.
kubectl -n cattle-logging-system \
  exec -it rancher-logging-root-fluentd-0 \
  --container fluentd \
  -- /bin/sh -c 'find /tmp/logs/ -name "*.log" -type f | xargs cat' | grep -E '\{.+\}' -o |
  sed -E 's@^ +@@g' |
  jq

@Jono-SUSE-Rancher

Copy link
Copy Markdown
Collaborator

Fixes #257

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants