-
Notifications
You must be signed in to change notification settings - Fork 68
Enable running DWO workspaces behind a proxy #711
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
Conversation
I forgot to make DWO itself use the proxy, working on it. |
4b59b45
to
e6edaa2
Compare
Updated DWO to use proxy settings for its own HTTP clients. However, due to how the proxy is configured, these settings are only set once when the controller is being started, and changes to the proxy settings require a restart of the controller deployment. We can't restart the controller from itself easily, as the usual way of triggering a rollout (editing the pod's spec in the deployment) does not work in OLM, as the CSV owns the deployment and reverts changes. I've updated the docs on the DevWorkspaceOperatorConfigs struct to reflect this. |
e6edaa2
to
e7e2710
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tried on a cluster bot cluster and I'm able to see that the proxy configuration is resolved but when I look at the devworkspaceoperatorconfiguration I just have:
apiVersion: controller.devfile.io/v1alpha1
config:
routing:
defaultRoutingClass: basic
workspace:
imagePullPolicy: Always
kind: DevWorkspaceOperatorConfig
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: >
{"apiVersion":"controller.devfile.io/v1alpha1","config":{"routing":{"clusterHostSuffix":null,"defaultRoutingClass":"basic"},"workspace":{"imagePullPolicy":"Always"}},"kind":"DevWorkspaceOperatorConfig","metadata":{"annotations":{},"name":"devworkspace-operator-config","namespace":"devworkspace-controller"}}
I'm assuming that the proxy settings are just stored internally in the operator unless they're overridden by the devworkspaceoperatorconfig?
Also the proxy settings seem to be propagated correctly to a devworkspace as well 👍
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: amisevsk, JPinkney 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 |
Yes -- in fact the DevWorkspaceOperatorConfig only stores manual overrides and does not need to exist at all for DWO to function. Its existence when testing changes is a side-effect of us wanting to automate config via env vars in the |
/test v8-devworkspace-operator-e2e, v8-che-happy-path |
/test v8-devworkspace-operator-e2e |
On OpenShift, read the cluster proxy configuration and propagate the proxy configuration values to workspaces as env vars. Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Move the definition of the proxy configuration into the DevWorkspaceOperatorConfigs CRD and enable values there to override cluster proxy settings. Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Now that Proxy is included in the DevWorkspaceOperatorConfig CRD, we can just store proxy config in the same way as all other config settings, with the cluster config providing the default values. Signed-off-by: Angel Misevski <amisevsk@redhat.com>
e7e2710
to
d74b7c8
Compare
New changes are detected. LGTM label has been removed. |
/test v8-devworkspace-operator-e2e |
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
d74b7c8
to
fa5c3c9
Compare
/test v8-devworkspace-operator-e2e |
What does this PR do?
The git history for this PR is a little bit of a mess, so it may not make a huge amount of sense to go through it commit by commit, unless you want to follow my thought process.
What issues does this PR fix or reference?
Closes #678
Is it tested? How?
Set up
crc
with a proxy (see below)Start DWO and verify that proxy configuration is read from the cluster -- should have log
Resolved proxy configuration
with the current configurationUpdate the DWOC to add proxy settings, check that in-controller configuration is updated
Revert DWOC proxy settings and check that defaults from cluster are restored
Check behavior on minikube; should be able to set proxy settings in DWOC and defaults should be empty as there's no proxies.config.openshift.io CRD
Setting up
crc
with a proxyClick to expand
This is just the process I followed, there's likely a better way. This assumes that initially crc is not started (might also need to
crc delete
) and thatcrc
is running locally (i.e. not remotely)Start Squid proxy in docker:
Note: if the container above is stuck restarting, you may need to run
sudo chcon -Rt svirt_sandbox_file_t /srv/docker/squid/cache
Start following Squid access logs to verify it's being used:
docker exec -it squid tail -f /var/log/squid3/access.log
Configure
crc
to use proxy(some of these no-proxy entries are probably unnecessary)
crc start
PR Checklist
/test v8-devworkspace-operator-e2e, v8-che-happy-path
to trigger)v8-devworkspace-operator-e2e
: DevWorkspace e2e testv8-che-happy-path
: Happy path for verification integration with Che