Skip to content

CONSOLE-2892: Allow dynamic plugins to proxy to services on the cluster#603

Merged
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
jhadvig:CONSOLE-2892
Nov 5, 2021
Merged

CONSOLE-2892: Allow dynamic plugins to proxy to services on the cluster#603
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
jhadvig:CONSOLE-2892

Conversation

@jhadvig
Copy link
Copy Markdown
Member

@jhadvig jhadvig commented Oct 12, 2021

Console changes for story https://issues.redhat.com/browse/CONSOLE-2892

Console-operator will now check for spec.proxy.services of the enabled ConsolePlugins and manifest those services to the console-config.yaml ConfigMap, which will trigger redeploy the console pod to pick up the updates

eg:

apiVersion: console.openshift.io/v1alpha1
kind: ConsolePlugin
metadata:
  name: console-demo-plugin
spec:
  displayName: 'OpenShift Console Demo Plugin'
  service:
    name: console-demo-plugin
    namespace: console-demo-plugin
    port: 9001
    basePath: '/'
  proxy:
    services:
    - name: thanos-querier
      namespace: openshift-monitoring
      port: 9091
      authorize: true

in the console browser window following query should be able to proxy the request to thanos and return 200:

await fetch('/api/proxy/namespace/openshift-monitoring/service/thanos-querier:9091/api/v1/rules')

/assign @spadgett @TheRealJon @florkbr

@openshift-ci openshift-ci Bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 12, 2021
@openshift-ci openshift-ci Bot requested review from bparees and spadgett October 12, 2021 07:21
@jhadvig jhadvig changed the title [WIP] CONSOLE-2892: Allow dynamic plugins to proxy to services on the cluster CONSOLE-2892: Allow dynamic plugins to proxy to services on the cluster Oct 12, 2021
@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 Oct 12, 2021
Namespace: service.Namespace,
Endpoint: getProxyServiceHostname(&service),
CACertificate: service.CACertificate,
Authorize: service.Authorize,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Wondering if this is necessary and we shouldn't always proxy the Authorization header

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We don't want to pass the user's token around unless the service really needs it. Even if we trust the service, it's an exposure. The token could get accidentally logged, etc. It's much better to only add the Authorization header when we know we have to.

@jhadvig
Copy link
Copy Markdown
Member Author

jhadvig commented Oct 26, 2021

/retest

@jhadvig
Copy link
Copy Markdown
Member Author

jhadvig commented Nov 1, 2021

PR is ready for final review.

QE Approver:
/assign @yapei

Docs Approver:
/assign @opayne1

PX Approver:
/assign @RickJWagner

Console Approver:
/assign @spadgett

@jhadvig
Copy link
Copy Markdown
Member Author

jhadvig commented Nov 2, 2021

/retest

@RickJWagner
Copy link
Copy Markdown

/label px-approved

@openshift-ci openshift-ci Bot added the px-approved Signifies that Product Support has signed off on this PR label Nov 2, 2021
@opayne1
Copy link
Copy Markdown
Contributor

opayne1 commented Nov 2, 2021

/label docs-approved

@openshift-ci openshift-ci Bot added the docs-approved Signifies that Docs has signed off on this PR label Nov 2, 2021
Copy link
Copy Markdown
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

Looks good to me, just one nit on a function name

return fmt.Sprintf("%snamespace/%s/service/%s/", pluginProxyEndpoint, service.Namespace, fmt.Sprintf("%s:%d", service.Name, service.Port))
}

func getProxyServiceHostname(service *v1alpha1.ConsolePluginProxyService) string {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is returning a URL, not a hostname.

@yapei
Copy link
Copy Markdown
Contributor

yapei commented Nov 4, 2021

verified the changes locally and works
/label qe-approved

@openshift-ci openshift-ci Bot added the qe-approved Signifies that QE has signed off on this PR label Nov 4, 2021
@jhadvig
Copy link
Copy Markdown
Member Author

jhadvig commented Nov 4, 2021

@spadgett comments addressed in a new commit. PTAL

@jhadvig
Copy link
Copy Markdown
Member Author

jhadvig commented Nov 4, 2021

/retest

Copy link
Copy Markdown
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

/lgtm

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

/retest-required

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

1 similar comment
@openshift-bot
Copy link
Copy Markdown
Contributor

/retest-required

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

@jhadvig
Copy link
Copy Markdown
Member Author

jhadvig commented Nov 4, 2021

We need to get openshift/client-go#199 in and update the go deps. accordingly.
/hold

@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Nov 4, 2021
@jhadvig
Copy link
Copy Markdown
Member Author

jhadvig commented Nov 4, 2021

GO deps have been updated. @spadgett please could you retag the PR. Thank you

/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 Nov 4, 2021
Copy link
Copy Markdown
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Nov 4, 2021
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Nov 4, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jhadvig, spadgett

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

The pull request process is described here

Details 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

@spadgett
Copy link
Copy Markdown
Member

spadgett commented Nov 4, 2021

/retest

@openshift-bot
Copy link
Copy Markdown
Contributor

/retest-required

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

14 similar comments
@openshift-bot
Copy link
Copy Markdown
Contributor

/retest-required

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

@openshift-bot
Copy link
Copy Markdown
Contributor

/retest-required

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

@openshift-bot
Copy link
Copy Markdown
Contributor

/retest-required

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

@openshift-bot
Copy link
Copy Markdown
Contributor

/retest-required

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

@openshift-bot
Copy link
Copy Markdown
Contributor

/retest-required

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

@openshift-bot
Copy link
Copy Markdown
Contributor

/retest-required

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

@openshift-bot
Copy link
Copy Markdown
Contributor

/retest-required

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

@openshift-bot
Copy link
Copy Markdown
Contributor

/retest-required

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

@openshift-bot
Copy link
Copy Markdown
Contributor

/retest-required

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

@openshift-bot
Copy link
Copy Markdown
Contributor

/retest-required

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

@openshift-bot
Copy link
Copy Markdown
Contributor

/retest-required

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

@openshift-bot
Copy link
Copy Markdown
Contributor

/retest-required

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

@openshift-bot
Copy link
Copy Markdown
Contributor

/retest-required

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

@openshift-bot
Copy link
Copy Markdown
Contributor

/retest-required

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

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Nov 4, 2021

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

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-single-node fc1df9b link false /test e2e-aws-single-node

Full PR test history. Your PR dashboard.

Details

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
Copy Markdown
Contributor

/retest-required

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

5 similar comments
@openshift-bot
Copy link
Copy Markdown
Contributor

/retest-required

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

@openshift-bot
Copy link
Copy Markdown
Contributor

/retest-required

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

@openshift-bot
Copy link
Copy Markdown
Contributor

/retest-required

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

@openshift-bot
Copy link
Copy Markdown
Contributor

/retest-required

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

@openshift-bot
Copy link
Copy Markdown
Contributor

/retest-required

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

@openshift-merge-robot openshift-merge-robot merged commit 4583855 into openshift:master Nov 5, 2021
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.

7 participants