Skip to content

MON-2212: Expose the /federate endpoint of UWM Prometheus as a service #1601

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

Merged

Conversation

arajkumar
Copy link
Contributor

Signed-off-by: Arunprasad Rajkumar [email protected]

  • I added CHANGELOG entry for this change.
  • No user facing changes, so no entry in CHANGELOG was needed.

@openshift-ci openshift-ci bot requested review from raptorsun and slashpai March 21, 2022 07:49
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 21, 2022
@arajkumar arajkumar force-pushed the expose-uwm-federate-endpoint branch from e245913 to 3edadfd Compare March 21, 2022 07:49
@arajkumar arajkumar marked this pull request as draft March 21, 2022 12:55
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 21, 2022
@arajkumar arajkumar force-pushed the expose-uwm-federate-endpoint branch from 3edadfd to 06fff51 Compare March 21, 2022 14:59
@arajkumar
Copy link
Contributor Author

/retest

@arajkumar
Copy link
Contributor Author

/test

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 21, 2022

@arajkumar: The /test command needs one or more targets.
The following commands are available to trigger required jobs:

  • /test e2e-agnostic
  • /test e2e-agnostic-operator
  • /test e2e-agnostic-upgrade
  • /test generate
  • /test go-fmt
  • /test images
  • /test jsonnet-fmt
  • /test rules
  • /test shellcheck
  • /test unit
  • /test vendor
  • /test verify

The following commands are available to trigger optional jobs:

  • /test e2e-aws-single-node
  • /test versions

Use /test all to run all jobs.

In response to this:

/test

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.

@arajkumar
Copy link
Contributor Author

/test all

1 similar comment
@arajkumar
Copy link
Contributor Author

/test all

@arajkumar arajkumar force-pushed the expose-uwm-federate-endpoint branch from 06fff51 to 3dbee1d Compare March 22, 2022 07:57
@arajkumar
Copy link
Contributor Author

/retest

@arajkumar arajkumar force-pushed the expose-uwm-federate-endpoint branch from 3dbee1d to e190bbe Compare March 23, 2022 07:49
@arajkumar arajkumar marked this pull request as ready for review March 23, 2022 07:50
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 23, 2022
@openshift-ci openshift-ci bot requested a review from bison March 23, 2022 07:53
@arajkumar
Copy link
Contributor Author

arajkumar commented Mar 23, 2022

Procedure to test

  1. Launch a OCP cluster
  2. Enable UWM and deploy an example app
oc apply -f https://gist.githubusercontent.com/arajkumar/7b3eaa8c21e6d74e8e0d7eaa7962af75/raw/8ff9dc4be8567183437e02170a245a1ee7a774ec/ocp-uwm.yaml
  1. Bind cluster-monitoring-view RBAC to any service account or user to access /federate endpoint
oc apply -f https://gist.githubusercontent.com/arajkumar/605abfe388336b549b1555e82a6ba3f8/raw/56418ba20ee197b026048d0b887aeb77730c1279/federate-rbac.yaml
  1. Access /federate endpoint
# get token
export TOKEN=$(oc sa get-token default -n ns1)

# port-forward
oc -n openshift-user-workload-monitoring port-forward service/prometheus-user-workload 9092:9092

curl -G -v -s -k -H "Authorization: Bearer ${TOKEN}" https://localhost:9092/federate --data-urlencode 'match[]=up'

@arajkumar
Copy link
Contributor Author

/retest
/skip

@arajkumar
Copy link
Contributor Author

/retest
/skip

Ping @juzhao for qe approval.
Ping @sferich888 for px approval.

@arajkumar arajkumar force-pushed the expose-uwm-federate-endpoint branch 2 times, most recently from 68b95f4 to a7bd931 Compare March 28, 2022 13:00
@raptorsun
Copy link
Contributor

Is it possible to share the same port & kube-rbac-proxy for metric and federate endpoints?
A suggestion:

  • We change the --allow-path argument to --allow-path=/metrics,federate
  • We include both RBAC settings in the config for kube-rbact-proxy as
"authorization":
  "resourceAttributes":
    "apiVersion": "v1"
    "resource": "namespaces"
    "verb": "get"
  "static":
    - "path": "/metrics"
      "resourceRequest": false
      "user":
        "name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
      "verb": "get"

@arajkumar
Copy link
Contributor Author

Is it possible to share the same port & kube-rbac-proxy for metric and federate endpoints?

I don't think this would be good choice as the nature of access will be totally different. /metrics endpoint is meant for internal usage but /federate called from outside the cluster by providing oauth token.

@simonpasquier @jan--f need you input on this. Thanks.

@jan--f
Copy link
Contributor

jan--f commented Mar 30, 2022

Is it possible to share the same port & kube-rbac-proxy for metric and federate endpoints?

I don't think this would be good choice as the nature of access will be totally different. /metrics endpoint is meant for internal usage but /federate called from outside the cluster by providing oauth token.

@simonpasquier @jan--f need you input on this. Thanks.

Yes I agree with you @arajkumar. No user should be interested in the metrics the UWM prometheus exports.

@arajkumar arajkumar force-pushed the expose-uwm-federate-endpoint branch from a7bd931 to f380a2a Compare March 31, 2022 07:38
Copy link
Contributor

@jan--f jan--f left a comment

Choose a reason for hiding this comment

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

/lgtm

Comment on lines +1811 to +1822
switch container.Name {
case "kube-rbac-proxy-metrics", "kube-rbac-proxy-federate", "kube-rbac-proxy-thanos":
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice :)

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 31, 2022
@openshift-ci openshift-ci bot added the docs-approved Signifies that Docs has signed off on this PR label Mar 31, 2022
@juzhao
Copy link
Contributor

juzhao commented Apr 2, 2022

@lihongyan1 please help to review

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 2, 2022
@arajkumar arajkumar force-pushed the expose-uwm-federate-endpoint branch from f380a2a to f1863aa Compare April 6, 2022 05:39
@openshift-ci openshift-ci bot removed lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Apr 6, 2022
@arajkumar
Copy link
Contributor Author

Ping @Senthamilarasu-STA (for px-approval)

@Senthamilarasu-STA
Copy link

/label px-approved

@openshift-ci openshift-ci bot added the px-approved Signifies that Product Support has signed off on this PR label Apr 6, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 6, 2022

@arajkumar: all tests passed!

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.

@lihongyan1
Copy link

/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Apr 7, 2022
@jan--f
Copy link
Contributor

jan--f commented Apr 7, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 7, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 7, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: arajkumar, jan--f

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-merge-robot openshift-merge-robot merged commit d7ba4ed into openshift:master Apr 7, 2022
arajkumar added a commit to arajkumar/cluster-monitoring-operator that referenced this pull request Apr 12, 2022
Successor of openshift#1601 to expose UWM federate service as a Openshift Route.

Signed-off-by: Arunprasad Rajkumar <[email protected]>
arajkumar added a commit to arajkumar/cluster-monitoring-operator that referenced this pull request Apr 12, 2022
Successor of openshift#1601 to expose UWM federate service as a Openshift Route.

Signed-off-by: Arunprasad Rajkumar <[email protected]>
arajkumar added a commit to arajkumar/cluster-monitoring-operator that referenced this pull request Apr 12, 2022
Successor of openshift#1601 to expose UWM federate service as a Openshift Route.

Signed-off-by: Arunprasad Rajkumar <[email protected]>
arajkumar added a commit to arajkumar/cluster-monitoring-operator that referenced this pull request Apr 19, 2022
Successor of openshift#1601 to expose UWM federate service as a Openshift Route.

Signed-off-by: Arunprasad Rajkumar <[email protected]>
arajkumar added a commit to arajkumar/cluster-monitoring-operator that referenced this pull request Apr 19, 2022
Successor of openshift#1601 to expose UWM federate service as a Openshift Route.

Signed-off-by: Arunprasad Rajkumar <[email protected]>
arajkumar added a commit to arajkumar/cluster-monitoring-operator that referenced this pull request Apr 20, 2022
Successor of openshift#1601 to expose UWM federate service as a Openshift Route.

Signed-off-by: Arunprasad Rajkumar <[email protected]>
arajkumar added a commit to arajkumar/cluster-monitoring-operator that referenced this pull request Apr 20, 2022
Successor of openshift#1601 to expose UWM federate service as a Openshift Route.

Signed-off-by: Arunprasad Rajkumar <[email protected]>
arajkumar added a commit to arajkumar/cluster-monitoring-operator that referenced this pull request May 4, 2022
Successor of openshift#1601 to expose UWM federate service as a Openshift Route.

Signed-off-by: Arunprasad Rajkumar <[email protected]>
(cherry picked from commit b647559)
arajkumar added a commit to arajkumar/cluster-monitoring-operator that referenced this pull request May 4, 2022
Successor of openshift#1601 to expose UWM federate service as a Openshift Route.

Signed-off-by: Arunprasad Rajkumar <[email protected]>
(cherry picked from commit b647559)
arajkumar added a commit to arajkumar/cluster-monitoring-operator that referenced this pull request May 5, 2022
Successor of openshift#1601 to expose UWM federate service as a Openshift Route.

Signed-off-by: Arunprasad Rajkumar <[email protected]>
(cherry picked from commit b647559)
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. docs-approved Signifies that Docs has signed off on this PR lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants