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

[ws-proxy] use ide-proxy to serve blobserve #10514

Merged
merged 1 commit into from
Jun 9, 2022
Merged

[ws-proxy] use ide-proxy to serve blobserve #10514

merged 1 commit into from
Jun 9, 2022

Conversation

iQQBot
Copy link
Contributor

@iQQBot iQQBot commented Jun 8, 2022

Description

This PR is 2st part of move blobserve behind ide proxy #7986

Related Issue(s)

Relate #7986

How to test

  1. Open a workspace in preview environment, quick link, check everything is works, include simple webview and vim extension

  2. open chrome dev-tool, check non file from blobserve.ws.pd-move-blob2.preview.gitpod-dev.com, every blob file should be serve by ide.pd-move-blob2.preview.gitpod-dev.com/blobserve
    image

  3. in this preview environment, I manual remove network ingress policy for ws-proxy to blobserve, now it's only allow ide-proxy access. ignore proxy component, I am not sure why it need

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: blobserve
  namespace: default
  labels:
    app: gitpod
    component: blobserve
spec:
  podSelector:
    matchLabels:
      app: gitpod
      component: blobserve
  ingress:
    - ports:
        - protocol: TCP
          port: 32224
      from:
        - podSelector:
            matchLabels:
              component: proxy
        # - podSelector:
        #     matchLabels:
        #       component: ws-proxy
        - podSelector:
            matchLabels:
              component: ide-proxy
  policyTypes:
    - Ingress

Release Notes

use `ide.gitpod.io/blobserve` to serve blobfile

Documentation

@@ -44,8 +44,9 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
MaxIdleConnsPerHost: 100,
},
BlobServer: &proxy.BlobServerConfig{
Scheme: "http",
Host: fmt.Sprintf("blobserve.%s.svc.cluster.local:%d", ctx.Namespace, common.BlobServeServicePort),
Scheme: "https",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can add a determination of the installation method here, and if it is full mode, use the internal svc method of communication

director := func(req *http.Request) {
req.URL.Scheme = target.Scheme
req.URL.Host = target.Host
req.Host = target.Host
Copy link
Contributor Author

@iQQBot iQQBot Jun 8, 2022

Choose a reason for hiding this comment

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

this part is copy from httputil.NewSingleHostReverseProxy the only different is add req.Host = target.Host this line, because we care about host header

Copy link
Member

Choose a reason for hiding this comment

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

It would be good to add this comment as a comment in the source code itself 🙏

Base automatically changed from pd/move-blob to main June 8, 2022 10:44
@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-pd-move-blob-2.16 because the annotations in the pull request description changed
(with .werft/ from main)

@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-pd-move-blob-2.18 because the annotations in the pull request description changed
(with .werft/ from main)

@iQQBot iQQBot marked this pull request as ready for review June 9, 2022 09:15
@iQQBot iQQBot requested a review from a team June 9, 2022 09:15
@github-actions github-actions bot added the team: workspace Issue belongs to the Workspace team label Jun 9, 2022
Copy link
Contributor

@sagor999 sagor999 left a comment

Choose a reason for hiding this comment

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

LGTM, also tested standalone ssh connection.

@roboquat roboquat merged commit c879463 into main Jun 9, 2022
@roboquat roboquat deleted the pd/move-blob-2 branch June 9, 2022 21:17
@roboquat roboquat added deployed: workspace Workspace team change is running in production deployed Change is completely running in production labels Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: workspace Workspace team change is running in production deployed Change is completely running in production release-note size/L team: workspace Issue belongs to the Workspace team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants