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

Keep 'orchestrator.cluster.name' if 'kubeconfig' is not returned in GKE metadata #33418

Conversation

tetianakravchenko
Copy link
Contributor

@tetianakravchenko tetianakravchenko commented Oct 20, 2022

Signed-off-by: Tetiana Kravchenko [email protected]

What does this PR do?

Keep the orchestrator.cluster.name in add_cloud_metadata processor if kubeconfig is not returned in GKE metadata.

Why is it important?

For some GKE configurations, kubeconfig is not returned in GKE metadata. In this case we were dropping all orchestrator object from the metadata and orchestrator.cluster.name were not populated.

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.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Oct 20, 2022
@mergify
Copy link
Contributor

mergify bot commented Oct 20, 2022

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @tetianakravchenko? 🙏.
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

Signed-off-by: Tetiana Kravchenko <[email protected]>
@elasticmachine
Copy link
Collaborator

elasticmachine commented Oct 20, 2022

💚 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: 2022-10-20T16:40:29.291+0000

  • Duration: 81 min 12 sec

Test stats 🧪

Test Results
Failed 0
Passed 23669
Skipped 1950
Total 25619

💚 Flaky test report

Tests succeeded.

🤖 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!)

Signed-off-by: Tetiana Kravchenko <[email protected]>
@tetianakravchenko tetianakravchenko force-pushed the gke-identifier-keep-cluster-name branch from 5a2d7bc to 95e535e Compare October 20, 2022 09:42
@tetianakravchenko tetianakravchenko requested a review from a team October 20, 2022 18:40
@tetianakravchenko tetianakravchenko marked this pull request as ready for review October 24, 2022 07:55
@tetianakravchenko tetianakravchenko requested a review from a team as a code owner October 24, 2022 07:55
@tetianakravchenko tetianakravchenko requested review from cmacknz and fearful-symmetry and removed request for a team October 24, 2022 07:55
@tetianakravchenko tetianakravchenko added Team:Cloudnative-Monitoring Label for the Cloud Native Monitoring team and removed needs_team Indicates that the issue/PR needs a Team:* label labels Oct 24, 2022
@MichaelKatsoulis
Copy link
Contributor

@tetianakravchenko is this (missing kubeconfig in metadata but present cluster name) something that you noticed that happens? And under which circumstances ?

@tetianakravchenko
Copy link
Contributor Author

@tetianakravchenko is this (missing kubeconfig in metadata but present cluster name) something that you noticed that happens? And under which circumstances ?

@MichaelKatsoulis
After some playing around with the GKE configuration I think it is mainly related to the Security > Shielded GKE nodes setting. The main difference: for clusters that do provide kubeconfig - CREATE_BOOTSTRAP_KUBECONFIG is set to false (CREATE_BOOTSTRAP_KUBECONFIG is a part of kube-env of custom metadata), for clusters that does not contain kubeconfig: CREATE_BOOTSTRAP_KUBECONFIG: "true" and KUBELET_ARGS contains --bootstrap-kubeconfig=/var/lib/kubelet/bootstrap-kubeconfig, that is needed for the bootstrap initialization process https://kubernetes.io/docs/reference/access-authn-authz/kubelet-tls-bootstrapping/#bootstrap-initialization

@tetianakravchenko tetianakravchenko added backport-v8.4.0 Automated backport with mergify backport-v8.5.0 Automated backport with mergify labels Oct 24, 2022
@tetianakravchenko
Copy link
Contributor Author

/package

@tetianakravchenko tetianakravchenko merged commit 6c01bc6 into elastic:main Nov 2, 2022
mergify bot pushed a commit that referenced this pull request Nov 2, 2022
…KE metadata (#33418)

* keep   if  is not returned in GKE metadata

Signed-off-by: Tetiana Kravchenko <[email protected]>

* add PR number

Signed-off-by: Tetiana Kravchenko <[email protected]>

* keep   if  is not returned in GKE metadata

Signed-off-by: Tetiana Kravchenko <[email protected]>

* add PR number

Signed-off-by: Tetiana Kravchenko <[email protected]>

* remove orchestrator if cluster name is mepty

Signed-off-by: Tetiana Kravchenko <[email protected]>

* changes needed to pass golangci-lint

Signed-off-by: Tetiana Kravchenko <[email protected]>

Signed-off-by: Tetiana Kravchenko <[email protected]>
(cherry picked from commit 6c01bc6)
mergify bot pushed a commit that referenced this pull request Nov 2, 2022
…KE metadata (#33418)

* keep   if  is not returned in GKE metadata

Signed-off-by: Tetiana Kravchenko <[email protected]>

* add PR number

Signed-off-by: Tetiana Kravchenko <[email protected]>

* keep   if  is not returned in GKE metadata

Signed-off-by: Tetiana Kravchenko <[email protected]>

* add PR number

Signed-off-by: Tetiana Kravchenko <[email protected]>

* remove orchestrator if cluster name is mepty

Signed-off-by: Tetiana Kravchenko <[email protected]>

* changes needed to pass golangci-lint

Signed-off-by: Tetiana Kravchenko <[email protected]>

Signed-off-by: Tetiana Kravchenko <[email protected]>
(cherry picked from commit 6c01bc6)
rdner added a commit that referenced this pull request Nov 3, 2022
…g' is not returned in GKE metadata (#33558)

* Keep 'orchestrator.cluster.name'  if 'kubeconfig' is not returned in GKE metadata (#33418)

* keep   if  is not returned in GKE metadata

Signed-off-by: Tetiana Kravchenko <[email protected]>

* add PR number

Signed-off-by: Tetiana Kravchenko <[email protected]>

* keep   if  is not returned in GKE metadata

Signed-off-by: Tetiana Kravchenko <[email protected]>

* add PR number

Signed-off-by: Tetiana Kravchenko <[email protected]>

* remove orchestrator if cluster name is mepty

Signed-off-by: Tetiana Kravchenko <[email protected]>

* changes needed to pass golangci-lint

Signed-off-by: Tetiana Kravchenko <[email protected]>

Signed-off-by: Tetiana Kravchenko <[email protected]>
(cherry picked from commit 6c01bc6)

* Fix the changelog

Co-authored-by: Tetiana Kravchenko <[email protected]>
Co-authored-by: Denis <[email protected]>
tetianakravchenko added a commit that referenced this pull request Nov 10, 2022
…g' is not returned in GKE metadata (#33557)

* Keep 'orchestrator.cluster.name'  if 'kubeconfig' is not returned in GKE metadata (#33418)

* keep   if  is not returned in GKE metadata

Signed-off-by: Tetiana Kravchenko <[email protected]>

* add PR number

Signed-off-by: Tetiana Kravchenko <[email protected]>

* keep   if  is not returned in GKE metadata

Signed-off-by: Tetiana Kravchenko <[email protected]>

* add PR number

Signed-off-by: Tetiana Kravchenko <[email protected]>

* remove orchestrator if cluster name is mepty

Signed-off-by: Tetiana Kravchenko <[email protected]>

* changes needed to pass golangci-lint

Signed-off-by: Tetiana Kravchenko <[email protected]>

Signed-off-by: Tetiana Kravchenko <[email protected]>
(cherry picked from commit 6c01bc6)

* Update CHANGELOG.next.asciidoc

Co-authored-by: Tetiana Kravchenko <[email protected]>
chrisberkhout pushed a commit that referenced this pull request Jun 1, 2023
…KE metadata (#33418)

* keep   if  is not returned in GKE metadata

Signed-off-by: Tetiana Kravchenko <[email protected]>

* add PR number

Signed-off-by: Tetiana Kravchenko <[email protected]>

* keep   if  is not returned in GKE metadata

Signed-off-by: Tetiana Kravchenko <[email protected]>

* add PR number

Signed-off-by: Tetiana Kravchenko <[email protected]>

* remove orchestrator if cluster name is mepty

Signed-off-by: Tetiana Kravchenko <[email protected]>

* changes needed to pass golangci-lint

Signed-off-by: Tetiana Kravchenko <[email protected]>

Signed-off-by: Tetiana Kravchenko <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.4.0 Automated backport with mergify backport-v8.5.0 Automated backport with mergify Team:Cloudnative-Monitoring Label for the Cloud Native Monitoring team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants