Skip to content

Commit 19ba38e

Browse files
committedNov 14, 2024·
add pty
1 parent 509ef82 commit 19ba38e

File tree

12 files changed

+249
-8
lines changed

12 files changed

+249
-8
lines changed
 

‎charts/ctrlplane/Chart.lock

+5-2
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@ dependencies:
1414
- name: otel
1515
repository: file://charts/otel
1616
version: 0.1.0
17-
digest: sha256:d8af69c3c9973484b53d2bda085cf4966ddf7186f5d5ff0ddc81c704fbee89bc
18-
generated: "2024-10-20T01:26:33.172861-04:00"
17+
- name: pty-proxy
18+
repository: file://charts/pty-proxy
19+
version: 0.1.7
20+
digest: sha256:ee36f31f10040547ecb5a25a32c45a5bc25f70bfca315cc693e05c3efe4253d9
21+
generated: "2024-11-14T14:15:19.282865-05:00"

‎charts/ctrlplane/Chart.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: ctrlplane
33
description: Ctrlplane Helm chart for Kubernetes
44
type: application
5-
version: 0.2.8
5+
version: 0.3.0
66
appVersion: "1.16.0"
77

88
maintainers:
@@ -31,3 +31,7 @@ dependencies:
3131
condition: otel.install
3232
version: "*.*.*"
3333
repository: "file://charts/otel"
34+
- name: pty-proxy
35+
condition: pty-proxy.install
36+
version: "*.*.*"
37+
repository: "file://charts/pty-proxy"

‎charts/ctrlplane/charts/event-worker/values.yaml

-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ hpa:
2121
minReplicas: 2
2222
maxReplicas: 5
2323

24-
service:
25-
type: ClusterIP
26-
annotations: {}
27-
labels: {}
28-
2924
tolerations: []
3025
pod: {}
3126

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/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: pty-proxy
3+
description: A Helm chart for Kubernetes
4+
type: application
5+
version: 0.1.7
6+
appVersion: "1.16.0"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "pty-proxy.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 "pty-proxy.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 "pty-proxy.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "pty-proxy.labels" -}}
37+
helm.sh/chart: {{ include "pty-proxy.chart" . }}
38+
{{ include "pty-proxy.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 "pty-proxy.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "pty-proxy.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 "pty-proxy.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "pty-proxy.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
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 "event-worker.fullname" . }}
6+
labels:
7+
{{- include "event-worker.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: 1
17+
selector:
18+
matchLabels:
19+
{{- include "ctrlplane.selectorLabels" $ | nindent 6 }}
20+
{{- include "event-worker.labels" . | nindent 6 }}
21+
template:
22+
metadata:
23+
labels:
24+
{{- include "event-worker.labels" . | nindent 8 }}
25+
annotations:
26+
{{- if .Values.pod.annotations -}}
27+
{{- toYaml .Values.pod.annotations | nindent 8 }}
28+
{{- end }}
29+
spec:
30+
serviceAccountName: {{ include "event-worker.serviceAccountName" . }}
31+
{{- if .tolerations }}
32+
tolerations:
33+
{{- toYaml .tolerations | nindent 8 }}
34+
{{- end }}
35+
{{- include "ctrlplane.nodeSelector" . | nindent 6 }}
36+
{{- include "ctrlplane.priorityClassName" . | nindent 6 }}
37+
{{- include "ctrlplane.podSecurityContext" .Values.pod.securityContext | nindent 6 }}
38+
containers:
39+
- name: event-worker
40+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
41+
ports:
42+
- name: http
43+
containerPort: 4000
44+
protocol: TCP
45+
env:
46+
- name: REDIS_URL
47+
valueFrom:
48+
secretKeyRef:
49+
name: {{ .Release.Name }}-connections
50+
key: REDIS_URL
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 }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "pty-proxy.fullname" . }}
5+
labels:
6+
{{- include "pty-proxy.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: 4000
18+
protocol: TCP
19+
name: pty-proxy
20+
selector:
21+
{{- include "pty-proxy.labels" . | nindent 4 }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{{- if .Values.serviceAccount.create -}}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: {{ include "event-worker.serviceAccountName" . }}
6+
namespace: {{ $.Release.Namespace }}
7+
labels:
8+
{{- include "event-worker.labels" . | nindent 4 }}
9+
{{- if .Values.serviceAccount.labels -}}
10+
{{- toYaml .Values.serviceAccount.labels | nindent 4 }}
11+
{{- end }}
12+
annotations:
13+
{{- if .Values.serviceAccount.annotations -}}
14+
{{- toYaml .Values.serviceAccount.annotations | nindent 4 }}
15+
{{- end }}
16+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
nameOverride: ""
2+
fullnameOverride: ""
3+
4+
image:
5+
repository: ctrlplane/pty-proxy
6+
tag: latest
7+
pullPolicy: Always
8+
9+
extraEnv: {}
10+
extraEnvFrom: {}
11+
12+
deployment:
13+
labels: {}
14+
annotations: {}
15+
16+
hpa:
17+
labels: {}
18+
annotations: {}
19+
minReplicas: 2
20+
maxReplicas: 5
21+
22+
service:
23+
type: ClusterIP
24+
annotations: {}
25+
labels: {}
26+
27+
tolerations: []
28+
pod: {}
29+
30+
serviceAccount:
31+
create: false
32+
name: ""
33+
labels: {}
34+
annotations: {}
35+
36+
resources:
37+
requests:
38+
cpu: 500m
39+
memory: 1Gi
40+
limits:
41+
cpu: 4000m
42+
memory: 4Gi

‎charts/ctrlplane/templates/ingress.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,11 @@ spec:
2828
name: {{ .Release.Name }}-webservice
2929
port:
3030
number: 3000
31+
- pathType: Prefix
32+
path: /api/v1/resource/proxy
33+
backend:
34+
service:
35+
name: {{ .Release.Name }}-pty-proxy
36+
port:
37+
number: 4000
3138
{{- end }}

‎charts/ctrlplane/values.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,6 @@ event-worker:
6060

6161
otel:
6262
install: true
63+
64+
pty-proxy:
65+
install: true

0 commit comments

Comments
 (0)
Please sign in to comment.