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

Add SASL/SCRAM support to the Kafka test container #28971

Merged
merged 5 commits into from
Nov 16, 2021

Conversation

faec
Copy link
Contributor

@faec faec commented Nov 15, 2021

What does this PR do?

Expands the configuration of the Kafka test container so that it adds a new external port 9093 that uses SASL/SCRAM authentication.

Why is it important?

As part of making SASL/SCRAM on Kafka GA, we want to include it in the automated tests, so our Kafka test container needs to support it (and include the certificates necessary for the client to connect).

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.next.asciidoc or CHANGELOG-developer.next.asciidoc.

How to test this PR locally

Create and start the container:

docker build -t kafkatest testing/environments/docker/kafka
docker run -p 127.0.0.1:9092:9092/tcp -p 127.0.0.1:9093:9093/tcp --rm --name kafkacontainer -d kafkatest

Point kafka at localhost (this is only needed to access the kafka broker from the host system, not another container, since on the Docker network the broker identifies itself by that name): edit /etc/hosts to add the line 127.0.0.1 kafka.

The server can now be accessed by beats on the host system, e.g. with this output configuration:

output.kafka:
  hosts: ["127.0.0.1:9093"]
  topic: "hello"
  protocol: "https"

  ssl.certificate_authorities: ["testing/environments/docker/kafka/certs/ca-cert"]
  sasl.mechanism: "SCRAM-SHA-512"

  username: "beats"
  password: "KafkaTest"

(the path in certificate_authorities should be modified if necessary to point at ca-cert in the test container directory).

@faec faec added cleanup Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team labels Nov 15, 2021
@faec faec requested a review from kvch November 15, 2021 16:08
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Nov 15, 2021
@mergify
Copy link
Contributor

mergify bot commented Nov 15, 2021

This pull request does not have a backport label. Could you fix it @faec? 🙏
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 7./d branch. /d is the digit

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

@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Nov 15, 2021
@elasticmachine
Copy link
Collaborator

elasticmachine commented Nov 15, 2021

💚 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 preview

Expand to view the summary

Build stats

  • Start Time: 2021-11-16T21:01:43.049+0000

  • Duration: 101 min 5 sec

  • Commit: efb736f

Test stats 🧪

Test Results
Failed 0
Passed 54253
Skipped 5345
Total 59598

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@faec faec added backport-v7.16.0 Automated backport with mergify backport-v8.0.0 Automated backport with mergify labels Nov 15, 2021
@mergify mergify bot removed the backport-skip Skip notification from the automated backport with mergify label Nov 15, 2021
Copy link
Contributor

@kvch kvch left a comment

Choose a reason for hiding this comment

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

You are a superhero! WFG.

@faec faec merged commit e69573a into elastic:master Nov 16, 2021
@faec faec deleted the kafka-test-container branch November 16, 2021 23:56
mergify bot pushed a commit that referenced this pull request Nov 16, 2021
mergify bot pushed a commit that referenced this pull request Nov 16, 2021
faec added a commit that referenced this pull request Nov 22, 2021
faec added a commit that referenced this pull request Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v7.16.0 Automated backport with mergify backport-v8.0.0 Automated backport with mergify cleanup Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants