Skip to content

Commit

Permalink
add pty
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbroks committed Nov 14, 2024
1 parent 509ef82 commit 19ba38e
Show file tree
Hide file tree
Showing 12 changed files with 249 additions and 8 deletions.
7 changes: 5 additions & 2 deletions charts/ctrlplane/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@ dependencies:
- name: otel
repository: file://charts/otel
version: 0.1.0
digest: sha256:d8af69c3c9973484b53d2bda085cf4966ddf7186f5d5ff0ddc81c704fbee89bc
generated: "2024-10-20T01:26:33.172861-04:00"
- name: pty-proxy
repository: file://charts/pty-proxy
version: 0.1.7
digest: sha256:ee36f31f10040547ecb5a25a32c45a5bc25f70bfca315cc693e05c3efe4253d9
generated: "2024-11-14T14:15:19.282865-05:00"
6 changes: 5 additions & 1 deletion charts/ctrlplane/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: ctrlplane
description: Ctrlplane Helm chart for Kubernetes
type: application
version: 0.2.8
version: 0.3.0
appVersion: "1.16.0"

maintainers:
Expand Down Expand Up @@ -31,3 +31,7 @@ dependencies:
condition: otel.install
version: "*.*.*"
repository: "file://charts/otel"
- name: pty-proxy
condition: pty-proxy.install
version: "*.*.*"
repository: "file://charts/pty-proxy"
5 changes: 0 additions & 5 deletions charts/ctrlplane/charts/event-worker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ hpa:
minReplicas: 2
maxReplicas: 5

service:
type: ClusterIP
annotations: {}
labels: {}

tolerations: []
pod: {}

Expand Down
23 changes: 23 additions & 0 deletions charts/ctrlplane/charts/pty-proxy/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
6 changes: 6 additions & 0 deletions charts/ctrlplane/charts/pty-proxy/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v2
name: pty-proxy
description: A Helm chart for Kubernetes
type: application
version: 0.1.7
appVersion: "1.16.0"
62 changes: 62 additions & 0 deletions charts/ctrlplane/charts/pty-proxy/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "pty-proxy.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "pty-proxy.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "pty-proxy.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "pty-proxy.labels" -}}
helm.sh/chart: {{ include "pty-proxy.chart" . }}
{{ include "pty-proxy.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "pty-proxy.selectorLabels" -}}
app.kubernetes.io/name: {{ include "pty-proxy.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "pty-proxy.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "pty-proxy.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
59 changes: 59 additions & 0 deletions charts/ctrlplane/charts/pty-proxy/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{{- $imageCfg := dict "global" $.Values.global.image "local" $.Values.image -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "event-worker.fullname" . }}
labels:
{{- include "event-worker.labels" . | nindent 4 }}
{{- if .Values.deployment.labels -}}
{{- toYaml .Values.deployment.labels | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.deployment.annotations -}}
{{- toYaml .Values.deployment.annotations | nindent 4 }}
{{- end }}
spec:
replicas: 1
selector:
matchLabels:
{{- include "ctrlplane.selectorLabels" $ | nindent 6 }}
{{- include "event-worker.labels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "event-worker.labels" . | nindent 8 }}
annotations:
{{- if .Values.pod.annotations -}}
{{- toYaml .Values.pod.annotations | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "event-worker.serviceAccountName" . }}
{{- if .tolerations }}
tolerations:
{{- toYaml .tolerations | nindent 8 }}
{{- end }}
{{- include "ctrlplane.nodeSelector" . | nindent 6 }}
{{- include "ctrlplane.priorityClassName" . | nindent 6 }}
{{- include "ctrlplane.podSecurityContext" .Values.pod.securityContext | nindent 6 }}
containers:
- name: event-worker
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
ports:
- name: http
containerPort: 4000
protocol: TCP
env:
- name: REDIS_URL
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-connections
key: REDIS_URL
- name: POSTGRES_URL
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-connections
key: POSTGRES_URL
{{- include "ctrlplane.extraEnv" . | nindent 12 }}
{{- include "ctrlplane.extraEnvFrom" (dict "root" $ "local" .) | nindent 12 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
21 changes: 21 additions & 0 deletions charts/ctrlplane/charts/pty-proxy/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "pty-proxy.fullname" . }}
labels:
{{- include "pty-proxy.labels" . | nindent 4 }}
{{- if .Values.service.labels -}}
{{- toYaml .Values.service.labels | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.service.annotations -}}
{{- toYaml .Values.service.annotations | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.service.type }}
ports:
- port: 4000
protocol: TCP
name: pty-proxy
selector:
{{- include "pty-proxy.labels" . | nindent 4 }}
16 changes: 16 additions & 0 deletions charts/ctrlplane/charts/pty-proxy/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "event-worker.serviceAccountName" . }}
namespace: {{ $.Release.Namespace }}
labels:
{{- include "event-worker.labels" . | nindent 4 }}
{{- if .Values.serviceAccount.labels -}}
{{- toYaml .Values.serviceAccount.labels | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.serviceAccount.annotations -}}
{{- toYaml .Values.serviceAccount.annotations | nindent 4 }}
{{- end }}
{{- end }}
42 changes: 42 additions & 0 deletions charts/ctrlplane/charts/pty-proxy/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
nameOverride: ""
fullnameOverride: ""

image:
repository: ctrlplane/pty-proxy
tag: latest
pullPolicy: Always

extraEnv: {}
extraEnvFrom: {}

deployment:
labels: {}
annotations: {}

hpa:
labels: {}
annotations: {}
minReplicas: 2
maxReplicas: 5

service:
type: ClusterIP
annotations: {}
labels: {}

tolerations: []
pod: {}

serviceAccount:
create: false
name: ""
labels: {}
annotations: {}

resources:
requests:
cpu: 500m
memory: 1Gi
limits:
cpu: 4000m
memory: 4Gi
7 changes: 7 additions & 0 deletions charts/ctrlplane/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,11 @@ spec:
name: {{ .Release.Name }}-webservice
port:
number: 3000
- pathType: Prefix
path: /api/v1/resource/proxy
backend:
service:
name: {{ .Release.Name }}-pty-proxy
port:
number: 4000
{{- end }}
3 changes: 3 additions & 0 deletions charts/ctrlplane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@ event-worker:

otel:
install: true

pty-proxy:
install: true

0 comments on commit 19ba38e

Please sign in to comment.