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

feat: Traefik plugin #938

Merged
merged 18 commits into from
Jul 21, 2021
Merged

feat: Traefik plugin #938

merged 18 commits into from
Jul 21, 2021

Conversation

sparkoo
Copy link
Member

@sparkoo sparkoo commented Jul 16, 2021

What does this PR do?

updates deployment of nativeUserMode with using traefik plugin to rewrite authorization header

Screenshot/screencast of this PR

What issues does this PR fix or reference?

eclipse-che/che#20070

How to test this PR?

  1. deploy che with devworkspaces enabled, che-operator templates from this PR (need new env value RELATED_IMAGE_single_host_gateway_native_user_mode) and CheCluster patch:
spec:
  auth:
    nativeUserMode: true
  1. check that gateway has no header-rewrite-proxy container, it should have 4 containers
  2. check configmap che-gateway-config-header-rewrite-plugin that should contain headerRewrite.go with plugin code
  3. every route configmap should containe additional middleware configuring this plugin
  4. test starting the devworkspace or whatever. Without the plugin working, you should get 403 on loading the dashboard and kubernetes proxy of che-server won't work as it relies on correct Authorization header

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
@openshift-ci
Copy link

openshift-ci bot commented Jul 16, 2021

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

# Conflicts:
#	Dockerfile
Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
@sparkoo sparkoo changed the title Traefik plugin feat: Traefik plugin Jul 19, 2021
@sparkoo sparkoo marked this pull request as ready for review July 19, 2021 15:52
# Conflicts:
#	bundle/nightly/eclipse-che-preview-kubernetes/manifests/che-operator.clusterserviceversion.yaml
#	bundle/nightly/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml
@sparkoo
Copy link
Member Author

sparkoo commented Jul 19, 2021

/retest

Signed-off-by: Michal Vala <mvala@redhat.com>
# Conflicts:
#	Dockerfile
# Conflicts:
#	bundle/nightly/eclipse-che-preview-kubernetes/manifests/che-operator.clusterserviceversion.yaml
#	bundle/nightly/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml
#	config/manager/manager.yaml
Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
# Conflicts:
#	bundle/nightly/eclipse-che-preview-kubernetes/manifests/che-operator.clusterserviceversion.yaml
#	bundle/nightly/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml
#	config/manager/manager.yaml
@sparkoo
Copy link
Member Author

sparkoo commented Jul 20, 2021

/retest

@tolusha
Copy link
Contributor

tolusha commented Jul 20, 2021

OpenShift tests are not working right now.. until #947 is merged

…atibility

Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
@tolusha
Copy link
Contributor

tolusha commented Jul 21, 2021

/retest

@@ -23,7 +24,8 @@ RUN mkdir -p $GOPATH/restic && \
curl -sSLo- https://api.github.com/repos/restic/restic/tarball/${RESTIC_TAG} | tar --strip-components=1 -xz -C $GOPATH/restic && \
cd $GOPATH/restic && go mod vendor && \
curl -sSLo /tmp/asset-devworkspace-operator.zip https://api.github.com/repos/devfile/devworkspace-operator/zipball/${DEV_WORKSPACE_CONTROLLER_VERSION} && \
curl -sSLo /tmp/asset-devworkspace-che-operator.zip https://api.github.com/repos/che-incubator/devworkspace-che-operator/zipball/${DEV_WORKSPACE_CHE_OPERATOR_VERSION}
curl -sSLo /tmp/asset-devworkspace-che-operator.zip https://api.github.com/repos/che-incubator/devworkspace-che-operator/zipball/${DEV_WORKSPACE_CHE_OPERATOR_VERSION} && \
curl -sSLo /tmp/asset-header-rewrite-traefik-plugin.zip https://api.github.com/repos/che-incubator/header-rewrite-traefik-plugin/zipball/${DEV_HEADER_REWRITE_TRAEFIK_PLUGIN}
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks, I've opened a PR redhat-developer/devspaces-images#63
However, I have no idea about the process and how to test that

Copy link
Contributor

Choose a reason for hiding this comment

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

looks good to me, I'll merge it. But still blocked in https://issues.redhat.com/browse/CRW-1956 (all the huge changes in che-operator 7.34/main have not yet been implemented in downstream sync scripts) so can't test this yet.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also I'm assuming that in downstream CSV I'll just remove RELATED_IMAGE_single_host_gateway_native_user_mode because we're not including 2 versions of traefik in the product when one of those is unreleased RC.

I hope the plan is to eventually use traefik 2.5 in both related images?

Copy link
Member Author

Choose a reason for hiding this comment

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

Also I'm assuming that in downstream CSV I'll just remove RELATED_IMAGE_single_host_gateway_native_user_mode because we're not including 2 versions of traefik in the product when one of those is unreleased RC.

Imho it won't work, che-operator code will complain that it does not know the env variable. I believe you can keep it empty. But why don't keep it there? Yes, it's RC version, but whole nativeUserMode is experimental. Alternatively I think you can set it empty, then nativeUserMode: true won't work.

I hope the plan is to eventually use traefik 2.5 in both related images?

yes, plan is to have only one stable Traefik in Che, once Traefik 2.5 is released.

@tolusha
Copy link
Contributor

tolusha commented Jul 21, 2021

/retest

@openshift-ci
Copy link

openshift-ci bot commented Jul 21, 2021

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: skabashnyuk, sparkoo, tolusha

The full list of commands accepted by this bot can be found 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

@sparkoo sparkoo merged commit 6bf5c65 into eclipse-che:main Jul 21, 2021
@sparkoo sparkoo deleted the traefikPlugin branch July 21, 2021 11:43
@che-bot che-bot added this to the 7.34 milestone Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants