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

Bug 1956879: pkg/operator/metriccontroller: read etcd-operator SA token rather than using prometheus #650

Merged
merged 1 commit into from Aug 27, 2021

Conversation

s-urbaniak
Copy link
Contributor

Currently, etcd-operator extracts the openshift-monitoring/prometheus-k8s service account token
to use it as a bearer token to execute requests against the prometheus API (via thanos).

Two issues were found:

  1. The service account token extraction does not filter tokens annoted with
    "kubernetes.io/created-by: openshift.io/create-dockercfg-secrets".

This causes randomly the wrong service account token to be picked up.

  1. It impersonates requests against the prometheus API using the prometheus SA token
    rather than using it owns.

This fixes it by reading the service account token directly from the pod file system.

/cc @lilic @hexfusion

…n using prometheus

Currently, etcd-operator extracts the openshift-monitoring/prometheus-k8s service account token
to use it as a bearer token to execute requests against the prometheus API (via thanos).

Two issues were found:

1. The service account token extraction does not filter tokens annoted with
"kubernetes.io/created-by: openshift.io/create-dockercfg-secrets".

This causes randomly the wrong service account token to be picked up.

2. It impersonates requests against the prometheus API using the prometheus SA token
rather than using it owns.

This fixes it by reading the service account token directly from the pod file system.
@openshift-ci openshift-ci bot requested review from hexfusion and lilic August 26, 2021 07:17
@openshift-ci openshift-ci bot added bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Aug 26, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 26, 2021

@s-urbaniak: This pull request references Bugzilla bug 1956879, which is invalid:

  • expected the bug to target the "4.9.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1956879: pkg/operator/metriccontroller: read etcd-operator SA token rather than using prometheus

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@s-urbaniak
Copy link
Contributor Author

/bugzilla refresh

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 26, 2021

@s-urbaniak: This pull request references Bugzilla bug 1956879, which is invalid:

  • expected the bug to target the "4.9.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@s-urbaniak
Copy link
Contributor Author

/bugzilla refresh

@openshift-ci openshift-ci bot added bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Aug 26, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 26, 2021

@s-urbaniak: This pull request references Bugzilla bug 1956879, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.9.0) matches configured target release for branch (4.9.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @geliu2016

In response to this:

/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot requested a review from geliu2016 August 26, 2021 07:34
@stlaz
Copy link
Member

stlaz commented Aug 26, 2021

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 26, 2021
Copy link
Contributor

@lilic lilic left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve
Thanks!

/hold
for Sam to have a look.

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 26, 2021
@lilic
Copy link
Contributor

lilic commented Aug 26, 2021

ci/prow/e2e-gcp-five-control-plane-replicas — Job failed.                    

is a known failure

@lilic
Copy link
Contributor

lilic commented Aug 26, 2021

/retest

@hexfusion
Copy link
Contributor

/approve

@hexfusion
Copy link
Contributor

/override ci/prow/e2e-gcp-five-control-plane-replicas

/retest
/hold cancel

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 26, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hexfusion, lilic, s-urbaniak, stlaz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 26, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 26, 2021

@hexfusion: Overrode contexts on behalf of hexfusion: ci/prow/e2e-gcp-five-control-plane-replicas

In response to this:

/override ci/prow/e2e-gcp-five-control-plane-replicas

/retest
/hold cancel

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@hexfusion
Copy link
Contributor

/retest

@hexfusion
Copy link
Contributor

/refresh
/retest
/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 26, 2021
@openshift-ci-robot
Copy link

@s-urbaniak: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-agnostic-upgrade 02ba5d5 link /test e2e-agnostic-upgrade
ci/prow/e2e-gcp-five-control-plane-replicas 02ba5d5 link /test e2e-gcp-five-control-plane-replicas

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

20 similar comments
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@hexfusion
Copy link
Contributor

/override ci/prow/e2e-gcp-five-control-plane-replicas

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 27, 2021

@hexfusion: Overrode contexts on behalf of hexfusion: ci/prow/e2e-gcp-five-control-plane-replicas

In response to this:

/override ci/prow/e2e-gcp-five-control-plane-replicas

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@hexfusion
Copy link
Contributor

/override ci/prow/e2e-gcp-five-control-plane-replicas

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 27, 2021

@hexfusion: Overrode contexts on behalf of hexfusion: ci/prow/e2e-gcp-five-control-plane-replicas

In response to this:

/override ci/prow/e2e-gcp-five-control-plane-replicas

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-merge-robot openshift-merge-robot merged commit b5ad00a into openshift:master Aug 27, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 27, 2021

@s-urbaniak: All pull requests linked via external trackers have merged:

Bugzilla bug 1956879 has been moved to the MODIFIED state.

In response to this:

Bug 1956879: pkg/operator/metriccontroller: read etcd-operator SA token rather than using prometheus

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@hexfusion
Copy link
Contributor

/cherry-pick release-4.8

@openshift-cherrypick-robot

@hexfusion: new pull request created: #665

In response to this:

/cherry-pick release-4.8

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants