Skip to content

Commit b53c22e

Browse files
committed
added workspace router
1 parent e7d1e39 commit b53c22e

File tree

14 files changed

+292
-6
lines changed

14 files changed

+292
-6
lines changed

charts/ctrlplane/Chart.lock

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,8 @@ dependencies:
2626
- name: web
2727
repository: file://charts/web
2828
version: 1.0.0
29-
digest: sha256:756516a6f12884144d13d94d9316e767188d95aedb9009634e80f16e46b1bbd7
30-
generated: "2025-10-26T13:32:54.817996-04:00"
29+
- name: workspace-engine-router
30+
repository: file://charts/workspace-engine-router
31+
version: 1.0.0
32+
digest: sha256:7d563f379af55b64aacd8527775d364660e7d4a8f82c42befc9b41ebc614372a
33+
generated: "2025-10-26T20:34:22.098605-04:00"

charts/ctrlplane/Chart.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ apiVersion: v2
22
name: ctrlplane
33
description: Ctrlplane Helm chart for Kubernetes
44
type: application
5-
version: 0.6.0
6-
appVersion: "1.16.0"
5+
version: 0.7.0
6+
appVersion: "1.0.0"
77

88
maintainers:
99
- name: ctrlplane
@@ -47,3 +47,7 @@ dependencies:
4747
condition: web.install
4848
version: "*.*.*"
4949
repository: "file://charts/web"
50+
- name: workspace-engine-router
51+
condition: workspace-engine-router.install
52+
version: "*.*.*"
53+
repository: "file://charts/workspace-engine-router"

charts/ctrlplane/charts/api/templates/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ spec:
4646
value: {{ .Values.global.fqdn }}
4747
- name: AUTH_URL
4848
value: {{ .Values.global.fqdn }}
49+
- name: WORKSPACE_ENGINE_ROUTER_URL
50+
value: http://{{ .Release.Name }}-workspace-engine-router.{{ .Release.Namespace }}.svc.cluster.local:9090
4951

5052
- name: VARIABLES_AES_256_KEY
5153
valueFrom:
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: workspace-engine-router
3+
description: A Helm chart for Kubernetes
4+
type: application
5+
version: 1.0.0
6+
appVersion: "1.0.0"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# webservice
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "wer.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "wer.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "wer.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "wer.labels" -}}
37+
helm.sh/chart: {{ include "wer.chart" . }}
38+
{{ include "wer.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "wer.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "wer.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "wer.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "wer.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{{- $imageCfg := dict "global" $.Values.global.image "local" $.Values.image -}}
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: {{ include "wer.fullname" . }}
6+
labels:
7+
{{- include "wer.labels" . | nindent 4 }}
8+
{{- if .Values.deployment.labels -}}
9+
{{- toYaml .Values.deployment.labels | nindent 4 }}
10+
{{- end }}
11+
annotations:
12+
{{- if .Values.deployment.annotations -}}
13+
{{- toYaml .Values.deployment.annotations | nindent 4 }}
14+
{{- end }}
15+
spec:
16+
replicas: {{ .Values.replica }}
17+
selector:
18+
matchLabels:
19+
{{- include "wer.selectorLabels" . | nindent 6 }}
20+
template:
21+
metadata:
22+
labels:
23+
{{- include "wer.labels" . | nindent 8 }}
24+
annotations:
25+
{{- if .Values.pod.annotations -}}
26+
{{- toYaml .Values.pod.annotations | nindent 8 }}
27+
{{- end }}
28+
spec:
29+
serviceAccountName: {{ include "wer.serviceAccountName" . }}
30+
{{- if .tolerations }}
31+
tolerations:
32+
{{- toYaml .tolerations | nindent 8 }}
33+
{{- end }}
34+
{{- include "ctrlplane.nodeSelector" . | nindent 6 }}
35+
{{- include "ctrlplane.priorityClassName" . | nindent 6 }}
36+
{{- include "ctrlplane.podSecurityContext" .Values.pod.securityContext | nindent 6 }}
37+
containers:
38+
- name: router
39+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
40+
ports:
41+
- name: proxy
42+
containerPort: 9090
43+
protocol: TCP
44+
- name: managment
45+
containerPort: 9091
46+
protocol: TCP
47+
env:
48+
- name: KAFKA_BROKERS
49+
value: {{ .Values.global.kafkaBrokers | quote }}
50+
51+
- name: POSTGRES_URL
52+
valueFrom:
53+
secretKeyRef:
54+
name: {{ .Release.Name }}-connections
55+
key: POSTGRES_URL
56+
{{- include "ctrlplane.extraEnv" . | nindent 12 }}
57+
{{- include "ctrlplane.extraEnvFrom" (dict "root" $ "local" .) | nindent 12 }}
58+
resources:
59+
{{- toYaml .Values.resources | nindent 12 }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
apiVersion: autoscaling/v2
2+
kind: HorizontalPodAutoscaler
3+
metadata:
4+
name: {{ include "wer.fullname" . }}
5+
namespace: {{ $.Release.Namespace }}
6+
labels:
7+
{{- include "wer.labels" . | nindent 4 }}
8+
{{- if .Values.hpa.labels -}}
9+
{{- toYaml .Values.hpa.labels | nindent 4 }}
10+
{{- end }}
11+
annotations:
12+
{{- if .Values.hpa.annotations -}}
13+
{{- toYaml .Values.hpa.annotations | nindent 4 }}
14+
{{- end }}
15+
spec:
16+
scaleTargetRef:
17+
apiVersion: apps/v1
18+
kind: Deployment
19+
name: {{ include "wer.fullname" . }}
20+
minReplicas: {{ .Values.hpa.minReplicas }}
21+
maxReplicas: {{ .Values.hpa.maxReplicas }}
22+
metrics:
23+
- type: Resource
24+
resource:
25+
name: cpu
26+
target:
27+
type: Utilization
28+
averageUtilization: 70
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ .Release.Name }}-workspace-engine-router
5+
labels:
6+
{{- include "wer.labels" . | nindent 4 }}
7+
{{- if .Values.service.labels -}}
8+
{{- toYaml .Values.service.labels | nindent 4 }}
9+
{{- end }}
10+
annotations:
11+
{{- if .Values.service.annotations -}}
12+
{{- toYaml .Values.service.annotations | nindent 4 }}
13+
{{- end }}
14+
spec:
15+
type: {{ .Values.service.type }}
16+
ports:
17+
- port: 9090
18+
protocol: TCP
19+
name: proxy
20+
- port: 9091
21+
protocol: TCP
22+
name: managment
23+
selector:
24+
{{- include "wer.labels" . | nindent 4 }}

0 commit comments

Comments
 (0)