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

[k8s] add kubernetes hints integration tests #6360

Merged

Conversation

pkoutsovasilis
Copy link
Contributor

What does this PR do?

This is the last part (I promise) of the PR series to add support for Kubernetes hints and integration tests for Redis. It introduces:

  • Additional test cases to validate agent Kubernetes hints functionality using Redis as the hints-enabled workload:
    • When hints-enabled workloads pre-exist the agent deployment.
    • When hints-enabled workloads are deployed after the agent is already running.

Why is it important?

This PR completes the Kubernetes hints-based testing and it ensures that that Kubernetes hints functionality is thoroughly tested.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an integration test or an E2E test

Disruptive User Impact

There is no expected disruption for users as this PR only extends k8s integration tests.

How to test this PR locally

mage integration:auth
PLATFORMS=linux/arm64 EXTERNAL=true SNAPSHOT=true PACKAGES=docker mage -v package 
INSTANCE_PROVISIONER=kind STACK_PROVISIONER=stateful K8S_VERSION=v1.31.1 SNAPSHOT=true mage integration:kubernetes

Related issues

@pkoutsovasilis pkoutsovasilis added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Testing backport-8.x Automated backport to the 8.x branch with mergify backport-8.16 Automated backport with mergify backport-8.17 Automated backport with mergify labels Dec 17, 2024
@pkoutsovasilis pkoutsovasilis self-assigned this Dec 17, 2024
@pkoutsovasilis pkoutsovasilis marked this pull request as ready for review December 17, 2024 17:42
@pkoutsovasilis pkoutsovasilis requested a review from a team as a code owner December 17, 2024 17:42
@elasticmachine
Copy link
Contributor

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

Copy link
Contributor

@swiatekm swiatekm 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 to me, nice work! These tests look much cleaner than what I expected we'd end up with. Left two nitpick comments, but they shouldn't block merging.

testing/integration/testdata/k8s.hints.redis.yaml Outdated Show resolved Hide resolved
testing/integration/kubernetes_agent_standalone_test.go Outdated Show resolved Hide resolved
Copy link

@pkoutsovasilis pkoutsovasilis merged commit c7c5ba4 into elastic:main Dec 18, 2024
13 checks passed
@pkoutsovasilis pkoutsovasilis deleted the pkoutsovasilis/k8s_hints_tests_pt3 branch December 18, 2024 16:56
mergify bot pushed a commit that referenced this pull request Dec 18, 2024
* feat: add kubernetes hints test

* feat: utilise labelselector for checking redis pods

* feat: check redis pods for correct hint annotations

(cherry picked from commit c7c5ba4)
mergify bot pushed a commit that referenced this pull request Dec 18, 2024
* feat: add kubernetes hints test

* feat: utilise labelselector for checking redis pods

* feat: check redis pods for correct hint annotations

(cherry picked from commit c7c5ba4)
mergify bot pushed a commit that referenced this pull request Dec 18, 2024
* feat: add kubernetes hints test

* feat: utilise labelselector for checking redis pods

* feat: check redis pods for correct hint annotations

(cherry picked from commit c7c5ba4)

# Conflicts:
#	testing/integration/kubernetes_agent_standalone_test.go
pkoutsovasilis added a commit that referenced this pull request Dec 18, 2024
* feat: add kubernetes hints test

* feat: utilise labelselector for checking redis pods

* feat: check redis pods for correct hint annotations

(cherry picked from commit c7c5ba4)

Co-authored-by: Panos Koutsovasilis <[email protected]>
pkoutsovasilis added a commit that referenced this pull request Dec 18, 2024
* feat: add kubernetes hints test

* feat: utilise labelselector for checking redis pods

* feat: check redis pods for correct hint annotations

(cherry picked from commit c7c5ba4)

Co-authored-by: Panos Koutsovasilis <[email protected]>
pkoutsovasilis added a commit that referenced this pull request Dec 19, 2024
* feat: add kubernetes hints test

* feat: utilise labelselector for checking redis pods

* feat: check redis pods for correct hint annotations

(cherry picked from commit c7c5ba4)

# Conflicts:
#	testing/integration/kubernetes_agent_standalone_test.go
pkoutsovasilis added a commit that referenced this pull request Dec 20, 2024
* feat: add kubernetes hints test

* feat: utilise labelselector for checking redis pods

* feat: check redis pods for correct hint annotations

(cherry picked from commit c7c5ba4)

# Conflicts:
#	testing/integration/kubernetes_agent_standalone_test.go

Co-authored-by: Panos Koutsovasilis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.x Automated backport to the 8.x branch with mergify backport-8.16 Automated backport with mergify backport-8.17 Automated backport with mergify skip-changelog Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include hints autodiscovery configuration inside integration tests for k8s
3 participants