Skip to content

[installer] Add applicationCluster to statically configured workspace clusters #13946

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

Merged
merged 2 commits into from
Oct 18, 2022

Conversation

andrew-farries
Copy link
Contributor

Description

Context As part of #9198 we want to start syncing the `d_b_workspace_cluster` table with `db-sync`.

Currently, the table differs between US and EU regions because each table contains only the data relevant to that region. For example, in the EU table, the eu70 workspace cluster is marked as available and the us70 cluster is cordoned. In the US cluster eu70 is cordoned and us70 is available.

In order to sync the table we need to get to a point where there is no difference in the data in the table between EU and US regions.

To do that we will introduce a new field in the table called applicationCluster which records the name of the application cluster to which the record belongs. Thus, for each workspace cluster there will be two rows in Gitpod SaaS:

name applicationCluster url tls state ...
eu70 eu02 url tls info available ...
eu70 us02 url tls info cordoned ...

Effectively the new applicationCluster column gives the table an extra dimension so that we can combine both tables (EU and US) into one.

#13722 added the column to the table and made gpctl fill the value when gpctl registering a new workspace cluster. The value is taken from the GITPOD_INSTALLATION_SHORTNAME environment variable in ws-manager-bridge.

Set the applicationCluster for statically configured workspace clusters. This indicates to which application cluster the workspace cluster belongs.

ws-manager-bridge was already configured (in #13722) to accept the applicationCluster field in its static bridges config:

export interface WorkspaceCluster {
// Name of the workspace cluster.
// This is the string set in each
// Must be identical to the installationShortname of the cluster it represents!
name: string;
// The name of the application cluster to which this cluster should be registered.
// The name can be at most 60 characters.
applicationCluster: string;
// URL of the cluster's ws-manager API
url: string;
// TLS contains the keys and certificates necessary to use mTLS between server and clients
tls?: TLSConfig;
// Current state of the cluster
state: WorkspaceClusterState;
// Maximum value score can reach for this cluster
maxScore: number;
// Score used for cluster selection when starting workspace instances
score: number;
// True if this bridge should control this cluster
govern: boolean;
// An optional set of constraints that limit who can start workspaces on the cluster
admissionConstraints?: AdmissionConstraint[];
}

Related Issue(s)

Part of #9198 and #13800

How to test

Installer golden master tests.

Release Notes

NONE

Documentation

Werft options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-integration-tests=all
    Valid options are all, workspace, webapp, ide

@andrew-farries andrew-farries requested a review from a team October 18, 2022 10:49
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Oct 18, 2022
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.

LGTM 🚀

@roboquat roboquat merged commit c599d56 into main Oct 18, 2022
@roboquat roboquat deleted the af/installer-add-application-cluster-field branch October 18, 2022 13:50
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Oct 19, 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 deployed Change is completely running in production release-note-none size/XS team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants