diff --git a/charts/ctrlplane/Chart.lock b/charts/ctrlplane/Chart.lock index b5d3955..04269cd 100644 --- a/charts/ctrlplane/Chart.lock +++ b/charts/ctrlplane/Chart.lock @@ -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" diff --git a/charts/ctrlplane/Chart.yaml b/charts/ctrlplane/Chart.yaml index a1763b8..e92d17b 100644 --- a/charts/ctrlplane/Chart.yaml +++ b/charts/ctrlplane/Chart.yaml @@ -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: @@ -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" diff --git a/charts/ctrlplane/charts/event-worker/values.yaml b/charts/ctrlplane/charts/event-worker/values.yaml index ff1a644..176551c 100644 --- a/charts/ctrlplane/charts/event-worker/values.yaml +++ b/charts/ctrlplane/charts/event-worker/values.yaml @@ -21,11 +21,6 @@ hpa: minReplicas: 2 maxReplicas: 5 -service: - type: ClusterIP - annotations: {} - labels: {} - tolerations: [] pod: {} diff --git a/charts/ctrlplane/charts/pty-proxy/.helmignore b/charts/ctrlplane/charts/pty-proxy/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/ctrlplane/charts/pty-proxy/.helmignore @@ -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/ diff --git a/charts/ctrlplane/charts/pty-proxy/Chart.yaml b/charts/ctrlplane/charts/pty-proxy/Chart.yaml new file mode 100644 index 0000000..f0667d0 --- /dev/null +++ b/charts/ctrlplane/charts/pty-proxy/Chart.yaml @@ -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" diff --git a/charts/ctrlplane/charts/pty-proxy/templates/_helpers.tpl b/charts/ctrlplane/charts/pty-proxy/templates/_helpers.tpl new file mode 100644 index 0000000..e92153d --- /dev/null +++ b/charts/ctrlplane/charts/pty-proxy/templates/_helpers.tpl @@ -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 }} diff --git a/charts/ctrlplane/charts/pty-proxy/templates/deployment.yaml b/charts/ctrlplane/charts/pty-proxy/templates/deployment.yaml new file mode 100644 index 0000000..e1cf5c0 --- /dev/null +++ b/charts/ctrlplane/charts/pty-proxy/templates/deployment.yaml @@ -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 }} \ No newline at end of file diff --git a/charts/ctrlplane/charts/pty-proxy/templates/service.yaml b/charts/ctrlplane/charts/pty-proxy/templates/service.yaml new file mode 100644 index 0000000..d79eb38 --- /dev/null +++ b/charts/ctrlplane/charts/pty-proxy/templates/service.yaml @@ -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 }} diff --git a/charts/ctrlplane/charts/pty-proxy/templates/serviceaccount.yaml b/charts/ctrlplane/charts/pty-proxy/templates/serviceaccount.yaml new file mode 100644 index 0000000..6271fac --- /dev/null +++ b/charts/ctrlplane/charts/pty-proxy/templates/serviceaccount.yaml @@ -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 }} \ No newline at end of file diff --git a/charts/ctrlplane/charts/pty-proxy/values.yaml b/charts/ctrlplane/charts/pty-proxy/values.yaml new file mode 100644 index 0000000..956643a --- /dev/null +++ b/charts/ctrlplane/charts/pty-proxy/values.yaml @@ -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 diff --git a/charts/ctrlplane/templates/ingress.yaml b/charts/ctrlplane/templates/ingress.yaml index b38ed7d..431b3b3 100644 --- a/charts/ctrlplane/templates/ingress.yaml +++ b/charts/ctrlplane/templates/ingress.yaml @@ -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 }} \ No newline at end of file diff --git a/charts/ctrlplane/values.yaml b/charts/ctrlplane/values.yaml index 8626ca5..7dfd86b 100644 --- a/charts/ctrlplane/values.yaml +++ b/charts/ctrlplane/values.yaml @@ -60,3 +60,6 @@ event-worker: otel: install: true + +pty-proxy: + install: true