Skip to content

Cherry-pick #22189 to 7.x: Kubernetes metadata enhancements#22536

Merged
ChrsMark merged 1 commit intoelastic:7.xfrom
ChrsMark:backport_22189_7.x
Nov 12, 2020
Merged

Cherry-pick #22189 to 7.x: Kubernetes metadata enhancements#22536
ChrsMark merged 1 commit intoelastic:7.xfrom
ChrsMark:backport_22189_7.x

Conversation

@ChrsMark
Copy link
Copy Markdown
Member

Cherry-pick of PR #22189 to 7.x branch. Original message:

What does this PR do?

  1. adds kubernetes.host.hostname on node metadata,
  2. attach node metadata on pod metadata by default (without add_resource_metadata required to enabled) for both events coming from autodiscovered pods but also for events enriched by add_kubernetes_metadata
  3. attach namespace metadata on pod metadata by default (without add_resource_metadata required to enabled) for both events coming from autodiscovered pods but also for events enriched by add_kubernetes_metadata
  4. Enables always add_resource_metadata section for autodiscover and add_kubernetes_metadata.

Why is it important?

This information is useful in various ways. See more on the respective issue: #20434

How to test this PR manually

  1. Use autodiscover config like:

Test with autodiscover provider

filebeat.autodiscover:
  providers:
    - type: kubernetes
      node: ${NODE_NAME}
      hints.enabled: true
      hints.default_config:
        type: container
        paths:
          - /var/log/containers/*${data.kubernetes.container.id}.log
  1. Make sure that Redis module is enabled and that kubernetes.node.hostname field is populated.

Test with add_kubernetes_metadata processor

filebeat.inputs:
- type: container
  paths:
    - /var/log/containers/*.log
  processors:
    - add_kubernetes_metadata:
        host: ${NODE_NAME}
        matchers:
        - logs_path:
            logs_path: "/var/log/containers/"
  1. Make sure that kubernetes.node.hostname field is populated as well as kubernetes.node.* and kubernetes.namespace.*.

Related issues

Screenshots

Filebeat & add_kubernetes_metadata:

Screenshot 2020-11-04 at 12 58 08

Autodiscover:

Screenshot 2020-11-04 at 13 07 30

@ChrsMark ChrsMark requested a review from a team as a code owner November 11, 2020 07:12
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Nov 11, 2020
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/integrations-platforms (Team:Platforms)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Nov 11, 2020
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Nov 11, 2020

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 16368
Skipped 1368
Total 17736

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Nov 11, 2020

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Started by user Chris Mark, Replayed #1]

  • Start Time: 2020-11-12T09:33:31.225+0000

  • Duration: 70 min 0 sec

Test stats 🧪

Test Results
Failed 0
Passed 16368
Skipped 1368
Total 17736

@ChrsMark ChrsMark requested a review from jsoriano November 12, 2020 08:24
@ChrsMark ChrsMark merged commit e9df1af into elastic:7.x Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Team:Platforms Label for the Integrations - Platforms team [zube]: In Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants