Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Kubernetes Provider] Fix namespace filter on pod and service watchers #4975

Merged
merged 2 commits into from
Jun 26, 2024

Conversation

constanca-m
Copy link
Contributor

What does this PR do?

The watchers now take into account the namespace specified by the user.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool
  • I have added an integration test or an E2E test

How to test this PR locally

  1. Create setup:
> kind create cluster
> elastic-package stack up -d -v --version=8.15.0-SNAPSHOT
> docker network connect elastic-package-stack_default kind-control-plane
  1. Build elastic-agent:
> EXTERNAL=true DEV=true PLATFORMS=linux/amd64 SNAPSHOT=TRUE PACKAGES=docker mage package
  1. Build docker image:
> cd build/package/elastic-agent/elastic-agent-linux-amd64.docker/docker-build
> docker build -t custom-agent-image .
  1. Load this image in your kind cluster:
> kind load docker-image custom-agent-image:latest
  1. Deploy elastic agent managed with that image, associate it to a policy with Kubernetes integration with pod data stream enabled. Filter by namespace.

Related issues

Relates elastic/beats#38978.

@constanca-m constanca-m added the Team:Cloudnative-Monitoring Label for the Cloud Native Monitoring team label Jun 21, 2024
@constanca-m constanca-m self-assigned this Jun 21, 2024
@constanca-m constanca-m requested review from a team as code owners June 21, 2024 07:13
Copy link
Contributor

mergify bot commented Jun 21, 2024

This pull request does not have a backport label. Could you fix it @constanca-m? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 8./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@pierrehilbert pierrehilbert requested review from blakerouse and removed request for rdner June 24, 2024 07:49
@constanca-m
Copy link
Contributor Author

/test

@michalpristas
Copy link
Contributor

should this be backported to 8.14.2?

@constanca-m
Copy link
Contributor Author

should this be backported to 8.14.2?

The fix is only applied on beats for 8.15 (PR here) @michalpristas, so I am trying to fix it in the same version everywhere @michalpristas

Copy link
Contributor

@blakerouse blakerouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

We really need to get integration testing for kubernetes.

@michalpristas
Copy link
Contributor

@blakerouse you know if we have some backing issue for adding it?

@pierrehilbert
Copy link
Contributor

@michalpristas #4984 would be a first good progress here!

@constanca-m constanca-m merged commit bd1aba8 into elastic:main Jun 26, 2024
16 checks passed
@constanca-m constanca-m deleted the provider-namespace branch June 26, 2024 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip Team:Cloudnative-Monitoring Label for the Cloud Native Monitoring team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants