-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[installer] set the ServiceType as LB for ws-proxy #8759
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
Codecov Report
@@ Coverage Diff @@
## main #8759 +/- ##
==========================================
- Coverage 12.31% 11.17% -1.14%
==========================================
Files 20 18 -2
Lines 1161 993 -168
==========================================
- Hits 143 111 -32
+ Misses 1014 880 -134
+ Partials 4 2 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
28e4ea2
to
cde6e8c
Compare
// Hence we use LoadBalancer type for the service | ||
if cfg.Config.Kind == config.InstallationWorkspace { | ||
service.Spec.Type = corev1.ServiceTypeLoadBalancer | ||
service.Annotations["cloud.google.com/neg"] = `{"exposed_ports": {"80":{},"443": {}}}` |
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.
Do we need to hardcode google specific annotations here?
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.
These annotations have been hardcoded for some time on the basis that a) they're ignored if not used and b) we don't really have an effective (and non-verbose) way of adding custom annotations to services. Elsewhere, there's also an annotation for external-dns
with the same thinking
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.
Looks good to me, save for the nit.
install/installer/README.md
Outdated
@@ -163,12 +163,21 @@ yq eval-all --inplace \ | |||
gitpod.yaml | |||
``` | |||
|
|||
Similarly, if you are doing a `Workspace` only install (specifying `Workspace` | |||
as the kind in config) you might want to change the service type of `ws-proxy` to `ClusterIP` | |||
instead of the default `LoadBalancer`. You can post-process the yaml to change that. |
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.
nit: YAML
, not yaml
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.
done!
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.
I did not test the changes but code lgtm
6e5f2a7
to
3c93bec
Compare
yq eval-all --inplace \ | ||
'(select(.kind == "Service" and .metadata.name == "ws-proxy") | .spec.type) |= "ClusterIP"' \ | ||
gitpod.yaml | ||
``` |
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.
Off-topic: Do we have already an issue to get rid of this post-processing step and having a config value for the service type?
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.
@corneliusludmann there is no such issue open specifically for making the service type configurable. I guess the question is do we plan on making this configurable, since our thought process was to not make it configurable.
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.
I'm glad you brought that up. 🚀 Indeed, we decided like this in the past. However, 2 things have changed since then:
- We introduced the
experimental
section. Everything that we won't support for some reason but need internally for SaaS should go there. We shouldn't need to rely on post-processing. - Since our official supported installation path will be the KOTS installation, we are a little more relaxed about the config surface.
What do you think, @mrsimonemms?
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.
In principle, I'm happy for this to go into the experimental
section. I think that should be a separate change though, as it will require discussion/agreement on the config surface change
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.
Sorry for the inactivity on this issue. I have created this issue to track this requirement. Shall we merge this PR and continue the work there?
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.
code changes lgtm. did not test this though
Hey @mrsimonemms, if I understood correctly you agree with the changes in this PR. If so, can you please approve it? |
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.
LGTM
Description
Currently, the type of the service created for
ws-proxy
isClusterIP
by default. When setting up in cloud in just theWorkspace
installation, this creates a requirement for having to post process the YAML to change the type toLoadBalancer
. With this PR, the default value ofws-proxy
service type is set asLoadBalancer
when the installation is of the kindWorkspace
Related Issue(s)
Fixes #7734
How to test
Set the value of
kind
in config fileWorkspace
. Run the render command,installer render --config gitpod.config.yaml > gitpod.yaml
. This will renderService
definition of the appws-proxy
as typeLoadBalancer
Release Notes
Documentation
No