-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[werft] Support installation of gitpod workspace component in a separ…
…ate k3s cluster (#4664) * Support workspace deployment in a separate k3s cluster using flag k3s-ws
- Loading branch information
Prince Rachit Sinha
authored
Jul 8, 2021
1 parent
8f0c24a
commit 9a0afff
Showing
6 changed files
with
470 additions
and
169 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import * as shell from 'shelljs'; | ||
|
||
function buildRequiredFlags(pathToKubeConfig: string): string { | ||
if (pathToKubeConfig != "") { | ||
return ` --kubeconfig=${pathToKubeConfig}` | ||
} | ||
return "" | ||
} | ||
|
||
export function buildGpctlBinary() { | ||
shell.exec(`cd /workspace/dev/gpctl && go build && cd -`) | ||
} | ||
|
||
export function printClustersList(pathToKubeConfig: string): string { | ||
let cmd = `/workspace/dev/gpctl/gpctl clusters list` + buildRequiredFlags(pathToKubeConfig) | ||
const result = shell.exec(cmd).trim() | ||
return result | ||
} | ||
|
||
export function uncordonCluster(pathToKubeConfig: string, name: string): string { | ||
let cmd = `/workspace/dev/gpctl/gpctl clusters uncordon --name=${name}` + buildRequiredFlags(pathToKubeConfig) | ||
const result = shell.exec(cmd).trim() | ||
return result | ||
} | ||
|
||
export function registerCluster(pathToKubeConfig: string, name: string, url: string): string { | ||
let cmd = `/workspace/dev/gpctl/gpctl clusters register \ | ||
--name ${name} \ | ||
--hint-cordoned \ | ||
--hint-govern \ | ||
--tls-path ./wsman-tls \ | ||
--url ${url}` + buildRequiredFlags(pathToKubeConfig) | ||
|
||
const result = shell.exec(cmd).trim() | ||
return result | ||
} | ||
|
||
export function getClusterTLS(pathToKubeConfig: string): string { | ||
let cmd = `/workspace/dev/gpctl/gpctl clusters get-tls-config` + buildRequiredFlags(pathToKubeConfig) | ||
const result = shell.exec(cmd).trim() | ||
return result | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,175 @@ | ||
installation: | ||
stage: devstaging | ||
tenant: gitpod-core | ||
region: europe-west1 | ||
cluster: "00" | ||
shortname: "k3s" | ||
hostname: staging.gitpod-dev.com | ||
imagePrefix: eu.gcr.io/gitpod-core-dev/build/ | ||
certificatesSecret: | ||
secretName: proxy-config-certificates | ||
version: not-set | ||
imagePullPolicy: Always | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: gitpod.io/workload_services | ||
operator: In | ||
values: | ||
- "true" | ||
authProviders: [] | ||
tracing: | ||
endoint: http://jaeger-collector:14268/api/traces | ||
samplerType: const | ||
samplerParam: "1" | ||
|
||
components: | ||
wsManagerBridge: | ||
disabled: true | ||
|
||
agentSmith: | ||
name: "agent-smith" | ||
disabled: false | ||
# in preview envs, we never want DaemonSets not to be scheduled (because they don't trigger scaleup) | ||
resources: | ||
cpu: 1m | ||
memory: 32Mi | ||
|
||
registryFacade: | ||
daemonSet: true | ||
# in preview envs, we never want DaemonSets not to be scheduled (because they don't trigger scaleup) | ||
resources: | ||
cpu: 1m | ||
memory: 32Mi | ||
|
||
contentService: | ||
remoteStorage: | ||
blobQuota: 1073741824 # 1 GiB | ||
|
||
workspace: | ||
# configure GCP registry | ||
pullSecret: | ||
secretName: gcp-sa-registry-auth | ||
affinity: | ||
default: "gitpod.io/workload_workspace" | ||
templates: | ||
default: | ||
spec: | ||
dnsConfig: | ||
nameservers: | ||
- 1.1.1.1 | ||
- 8.8.8.8 | ||
dnsPolicy: None # do NOT query against K8s DNS (https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/) | ||
env: | ||
- name: THEIA_PREVENT_METADATA_ACCESS | ||
value: true | ||
regular: | ||
spec: | ||
containers: | ||
- name: "workspace" | ||
env: | ||
- name: THEIA_RATELIMIT_LOG | ||
value: "50" | ||
- name: SUPERVISOR_DEBUG_ENABLE | ||
value: "true" | ||
prebuild: | ||
spec: | ||
containers: | ||
- name: workspace | ||
# Intended to reduce the density for prebuilds | ||
resources: | ||
limits: | ||
cpu: "5" | ||
memory: 12Gi | ||
requests: | ||
cpu: 1m | ||
ephemeral-storage: 5Gi | ||
memory: 4608Mi # = 2 * 2304Mi | ||
|
||
# Enable events trace | ||
wsManager: | ||
eventTraceLogLocation: "/tmp/evts.json" | ||
|
||
wsDaemon: | ||
hostWorkspaceArea: /mnt/disks/ssd0/workspaces | ||
volumes: | ||
- name: gcloud-tmp | ||
hostPath: | ||
path: /mnt/disks/ssd0/sync-tmp | ||
type: DirectoryOrCreate | ||
volumeMounts: | ||
- mountPath: /mnt/sync-tmp | ||
name: gcloud-tmp | ||
userNamespaces: | ||
fsShift: fuse | ||
shiftfsModuleLoader: | ||
enabled: false | ||
seccompProfileInstaller: | ||
enabled: true | ||
# in preview envs, we never want DaemonSets not to be scheduled (because they don't trigger scaleup) | ||
resources: | ||
cpu: 1m | ||
memory: 32Mi | ||
|
||
wsScheduler: | ||
scaler: | ||
enabled: true | ||
controller: | ||
kind: "constant" | ||
constant: | ||
setpoint: 1 | ||
|
||
# Enable ws-proxy in dev | ||
wsProxy: | ||
useHTTPS: true | ||
hostHeader: Host | ||
name: "ws-proxy" | ||
disabled: false | ||
replicas: 1 | ||
serviceType: "LoadBalancer" | ||
wsManagerProxy: | ||
enabled: true | ||
ports: | ||
wsManagerProxy: | ||
expose: true | ||
containerPort: 8081 | ||
servicePort: 8081 | ||
httpsProxy: | ||
expose: true | ||
containerPort: 9090 | ||
servicePort: 443 | ||
httpProxy: | ||
expose: true | ||
containerPort: 8080 | ||
servicePort: 80 | ||
|
||
imageBuilder: | ||
disabled: true | ||
hostDindData: "/mnt/disks/ssd0/builder" | ||
# configure GCP registry | ||
registry: | ||
name: eu.gcr.io/gitpod-core-dev/registry | ||
secretName: gcp-sa-registry-auth | ||
path: gcp-sa-registry-auth | ||
registryCerts: [] | ||
|
||
|
||
# configure GCP registry | ||
docker-registry: | ||
enabled: false | ||
|
||
rabbitmq: | ||
# ensure shovels are configured on boot | ||
disabled: true | ||
enabled: false | ||
|
||
cert-manager: | ||
enabled: true | ||
|
||
dbMigrations: | ||
disabled: true | ||
|
||
db: | ||
autoMigrate: false |