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

[installer] Add serviceAnnotations config to proxy #9773

Merged
merged 2 commits into from
May 5, 2022

Conversation

andrew-farries
Copy link
Contributor

Description

One of the Webapp team's epics for Q2 is to use the Gitpod installer to deploy to Gitpod SaaS. In order to do that we will need to add additional configuration to the installer to make the output suitable for a SaaS deployment as opposed to a self-hosted deployment.

This PR allows for extra annotations to configured on the proxy component so that we can configure GCP annotations for Gitpod SaaS.

Related Issue(s)

Part of #9097

How to test

Create an installer config file containing this experimental section:

experimental:
  webapp:
    proxy:
      serviceAnnotations:
        hello: world

Get a versions.yaml for use with the installer:

docker run -it --rm "eu.gcr.io/gitpod-core-dev/build/versions:${version}" cat versions.yaml > versions.yaml

Then invoke the installer as:

go run . render --debug-version-file versions.yaml --config /path/to/config --use-experimental-config

The Service resource for proxy will contain the extra annotation.

Release Notes

Allow setting `proxy` service annotations via the installer.

Documentation

None.

Andrew Farries added 2 commits May 4, 2022 17:00
Allow the annotations on the service to be added to by specifying them
in the experimental config.
Ensure that any annotations specified in the experimental config are
present on the rendered Service.
@andrew-farries andrew-farries requested review from a team May 4, 2022 17:02
@github-actions github-actions bot added team: delivery Issue belongs to the self-hosted team team: webapp Issue belongs to the WebApp team labels May 4, 2022
@corneliusludmann
Copy link
Contributor

@Pothulapati, just out of curiosity: Would these be the annotations we would need for the AWS/EKS load balancer as well?

service.Annotations["external-dns.alpha.kubernetes.io/hostname"] = fmt.Sprintf("%s,*.%s,*.ws.%s", ctx.Config.Domain, ctx.Config.Domain, ctx.Config.Domain)
service.Annotations["cloud.google.com/neg"] = `{"exposed_ports": {"80":{},"443": {}}}`

for k, v := range annotations {
service.Annotations[k] = v
Copy link
Member

Choose a reason for hiding this comment

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

💯

Copy link
Member

@geropl geropl left a comment

Choose a reason for hiding this comment

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

💯 Thx for tests!

require.Len(t, objects, 1, "must render only one object")

svc := objects[0].(*corev1.Service)
for k, v := range annotations {
Copy link
Member

Choose a reason for hiding this comment

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

Should be possible to use require.EqualValues(t, annotations, svc.Annotations)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What we are checking here is slightly different; we need to check that the extra annotations are a subset of those on the rendered service. The installer hard-codes a couple of annotations too.

@roboquat roboquat merged commit 9a9736d into main May 5, 2022
@roboquat roboquat deleted the af/installer-proxy-service-annotations branch May 5, 2022 07:42
@roboquat roboquat added the deployed: webapp Meta team change is running in production label May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production release-note size/M team: delivery Issue belongs to the self-hosted team team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants