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

Fix EK stack deployment on kubernetes #33167

Closed
wants to merge 1 commit into from

Conversation

juanluisvaladas
Copy link

What does this PR do?

This PR fixes the EK stack deployment on kubernetes by changing kibana's username from elastic to kibana_system.

This was broken in elastic/kibana#122722 and it provoked kibana not to start with error:

$ k logs -p kibana-76f54554c9-8rsbq
[2022-09-22T10:48:41.271+00:00][INFO ][plugins-service] Plugin "metricsEntities" is disabled.
[2022-09-22T10:48:41.307+00:00][FATAL][root] Error: [config validation of [elasticsearch].username]: value of "elastic" is forbidden. This is a superuser account that cannot write to system indices that Kibana needs to function. Use a service account token instead. Learn more: https://www.elastic.co/guide/en/elasticsearch/reference/8.0/service-accounts.html
    at ensureValidConfiguration (/usr/share/kibana/src/core/server/config/ensure_valid_configuration.js:25:11)
    at Server.preboot (/usr/share/kibana/src/core/server/server.js:160:5)
    at Root.preboot (/usr/share/kibana/src/core/server/root/index.js:48:14)
    at bootstrap (/usr/share/kibana/src/core/server/bootstrap.js:99:9)
    at Command.<anonymous> (/usr/share/kibana/src/cli/serve/serve.js:216:5)

 FATAL  Error: [config validation of [elasticsearch].username]: value of "elastic" is forbidden. This is a superuser account that cannot write to system indices that Kibana needs to function. Use a service account token instead. Learn more: https://www.elastic.co/guide/en/elasticsearch/reference/8.0/service-accounts.html

How to test this PR locally

1- Make sure that you have pulled the latest docker.elastic.co/kibana/kibana:8.0.0-SNAPSHOT. Most certainly this tag used to point to a different image which used to work before.
2- Follow the instructions of https://github.com/elastic/beats/blob/main/metricbeat/module/kubernetes/_meta/test/docs/README.md.
The only changes are in one file so running kubectl apply -f metricbeat/module/kubernetes/_meta/test/docs/01_playground/ek_stack.yaml before and after will show the difference.

Related issues

elastic/kibana#123113
elastic/kibana#122722

Kibana doesn't allow to run using the elastic user anymore. This commit
replaces the elastic user for the kibana_system user.
@juanluisvaladas juanluisvaladas requested a review from a team as a code owner September 22, 2022 15:37
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 22, 2022
@cla-checker-service
Copy link

cla-checker-service bot commented Sep 22, 2022

💚 CLA has been signed

@botelastic
Copy link

botelastic bot commented Sep 22, 2022

This pull request doesn't have a Team:<team> label.

@mergify
Copy link
Contributor

mergify bot commented Sep 22, 2022

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @juanluisvaladas? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

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

@elasticmachine
Copy link
Collaborator

❕ Build Aborted

The PR is not allowed to run in the CI yet

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

  • Start Time: 2022-09-22T15:37:53.514+0000

  • Duration: 5 min 47 sec

Steps errors 2

Expand to view the steps failures

Load a resource file from a library
  • Took 0 min 0 sec . View more details here
  • Description: approval-list/elastic/beats.yml
Error signal
  • Took 0 min 0 sec . View more details here
  • Description: githubApiCall: The REST API call https://api.github.com/orgs/elastic/members/juanluisvaladas return the message : java.lang.Exception: httpRequest: Failure connecting to the service https://api.github.com/orgs/elastic/members/juanluisvaladas : httpRequest: Failure connecting to the service https://api.github.com/orgs/elastic/members/juanluisvaladas : Code: 404Error: {"message":"User does not exist or is not a member of the organization","documentation_url":"https://docs.github.com/rest/reference/orgs#check-organization-membership-for-a-user"}

🤖 GitHub comments

Expand to view the 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!)

@juanluisvaladas
Copy link
Author

juanluisvaladas commented Sep 22, 2022

Hi approvers, I don't think I have permissions to add labels so I guess you'll need to do it for me.

Finally at this point it would probably be a good idea to update the version to 8.4. Can I bump it in another commit of this PR or should I make a new one?

@juanluisvaladas juanluisvaladas deleted the fix-ek-stack branch November 9, 2022 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants