From 479c831adfb1043180daf6d80045953310fef5fd Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Mon, 24 Mar 2025 17:07:13 +0300 Subject: [PATCH 1/5] feat: add gost-agent --- charts/gost-agent/.helmignore | 23 +++++++ charts/gost-agent/Chart.yaml | 12 ++++ charts/gost-agent/README.md | 49 +++++++++++++++ .../templates/_components/controller.tpl | 6 ++ charts/gost-agent/templates/_helpers.tpl | 62 +++++++++++++++++++ .../gost-agent/templates/all_resources.yaml | 7 +++ charts/gost-agent/templates/deployment.yaml | 3 + charts/gost-agent/values.yaml | 36 +++++++++++ 8 files changed, 198 insertions(+) create mode 100644 charts/gost-agent/.helmignore create mode 100644 charts/gost-agent/Chart.yaml create mode 100644 charts/gost-agent/README.md create mode 100644 charts/gost-agent/templates/_components/controller.tpl create mode 100644 charts/gost-agent/templates/_helpers.tpl create mode 100644 charts/gost-agent/templates/all_resources.yaml create mode 100644 charts/gost-agent/templates/deployment.yaml create mode 100644 charts/gost-agent/values.yaml diff --git a/charts/gost-agent/.helmignore b/charts/gost-agent/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/charts/gost-agent/.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/gost-agent/Chart.yaml b/charts/gost-agent/Chart.yaml new file mode 100644 index 00000000..7d77cf90 --- /dev/null +++ b/charts/gost-agent/Chart.yaml @@ -0,0 +1,12 @@ +apiVersion: v2 +name: ngrok-agent +description: A Helm chart for Kubernetes +type: application +version: 0.1.0 +maintainers: + - name: codefresh + url: https://codefresh-io.github.io/ +dependencies: + - name: cf-common + repository: oci://quay.io/codefresh/charts + version: 0.24.1 diff --git a/charts/gost-agent/README.md b/charts/gost-agent/README.md new file mode 100644 index 00000000..05193f79 --- /dev/null +++ b/charts/gost-agent/README.md @@ -0,0 +1,49 @@ +# ngrok-agent + +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) + +A Helm chart for Kubernetes + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| codefresh | | | + +## Requirements + +| Repository | Name | Version | +|------------|------|---------| +| oci://quay.io/codefresh/charts | cf-common | 0.24.1 | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| container.args[0] | string | `"-L"` | | +| container.args[1] | string | `"rtcp://:0//internal-gateway:80"` | | +| container.args[2] | string | `"-F"` | | +| container.args[3] | string | `"tunnel+wss://${GOST_SERVER_HOSTNAME}:443?tunnel.id=${GOST_PLATFORM_TUNNEL_ID}&keepalive=true&ttl=15s"` | | +| container.command[0] | string | `"gost"` | | +| container.env.GOST_PLATFORM_TUNNEL_ID | string | `"c5db1800-ce4c-11de-8413-6a7c5a153390"` | | +| container.env.GOST_SERVER_HOSTNAME | string | `"f598c8b79c17fe29.gost.shared-services.cf-infra.com"` | | +| container.image.pullPolicy | string | `"IfNotPresent"` | | +| container.image.registry | string | `"docker.io"` | | +| container.image.repository | string | `"gogost/gost"` | | +| container.image.tag | string | `"latest"` | | +| controller.deployment.strategy | string | `"Recreate"` | | +| controller.enabled | bool | `true` | | +| controller.replicas | int | `1` | | +| controller.type | string | `"deployment"` | | +| global | object | `{}` | | +| hpa | object | `{}` | | +| keda.auth | object | `{}` | | +| keda.spec | object | `{}` | | +| libraryMode | bool | `false` | | +| nodeSelector | object | `{}` | | +| pdb | object | `{}` | | +| tolerations | list | `[]` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1) diff --git a/charts/gost-agent/templates/_components/controller.tpl b/charts/gost-agent/templates/_components/controller.tpl new file mode 100644 index 00000000..18305160 --- /dev/null +++ b/charts/gost-agent/templates/_components/controller.tpl @@ -0,0 +1,6 @@ +{{- define "gost-agent.controller" }} + +{{- $templateName := printf "cf-common-%s.controller" (index .Subcharts "cf-common").Chart.Version -}} +{{- include $templateName . -}} + +{{- end }} diff --git a/charts/gost-agent/templates/_helpers.tpl b/charts/gost-agent/templates/_helpers.tpl new file mode 100644 index 00000000..459ada06 --- /dev/null +++ b/charts/gost-agent/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "ngrok-agent.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 "ngrok-agent.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 "ngrok-agent.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "ngrok-agent.labels" -}} +helm.sh/chart: {{ include "ngrok-agent.chart" . }} +{{ include "ngrok-agent.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "ngrok-agent.selectorLabels" -}} +app.kubernetes.io/name: {{ include "ngrok-agent.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "ngrok-agent.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "ngrok-agent.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/gost-agent/templates/all_resources.yaml b/charts/gost-agent/templates/all_resources.yaml new file mode 100644 index 00000000..32bdea28 --- /dev/null +++ b/charts/gost-agent/templates/all_resources.yaml @@ -0,0 +1,7 @@ +{{- define "ngrok-agent.resources" -}} + +{{ include "ngrok-agent.controller" . }} +--- +{{ include "ngrok-agent.configmap" . }} + +{{- end -}} diff --git a/charts/gost-agent/templates/deployment.yaml b/charts/gost-agent/templates/deployment.yaml new file mode 100644 index 00000000..84a3974b --- /dev/null +++ b/charts/gost-agent/templates/deployment.yaml @@ -0,0 +1,3 @@ +{{- if not .Values.libraryMode }} +{{- include "gost-agent.controller" . }} +{{- end }} diff --git a/charts/gost-agent/values.yaml b/charts/gost-agent/values.yaml new file mode 100644 index 00000000..3f524e17 --- /dev/null +++ b/charts/gost-agent/values.yaml @@ -0,0 +1,36 @@ +libraryMode: false + +global: {} + +controller: + enabled: true + type: deployment + replicas: 1 + deployment: + strategy: Recreate + +container: + image: + registry: docker.io + repository: gogost/gost + tag: latest + pullPolicy: IfNotPresent + command: + - "gost" + args: + - "-L" + - 'rtcp://:0//internal-gateway:80' + - "-F" + - "tunnel+wss://${GOST_SERVER_HOSTNAME}:443?tunnel.id=${GOST_PLATFORM_TUNNEL_ID}&keepalive=true&ttl=15s" + env: + GOST_SERVER_HOSTNAME: f598c8b79c17fe29.gost.shared-services.cf-infra.com + GOST_PLATFORM_TUNNEL_ID: c5db1800-ce4c-11de-8413-6a7c5a153390 + +nodeSelector: {} +tolerations: [] +affinity: {} +hpa: {} +keda: + spec: {} + auth: {} +pdb: {} From 135adcf092148b70a6ac16db5af132c29f708997 Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Mon, 24 Mar 2025 17:07:52 +0300 Subject: [PATCH 2/5] feat: add gost-agent --- charts/gost-agent/templates/all_resources.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/charts/gost-agent/templates/all_resources.yaml b/charts/gost-agent/templates/all_resources.yaml index 32bdea28..ed9f1aea 100644 --- a/charts/gost-agent/templates/all_resources.yaml +++ b/charts/gost-agent/templates/all_resources.yaml @@ -1,7 +1,5 @@ {{- define "ngrok-agent.resources" -}} {{ include "ngrok-agent.controller" . }} ---- -{{ include "ngrok-agent.configmap" . }} {{- end -}} From 4fdd4dcb1f43c10b80a336c76b33903236e946ae Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Tue, 25 Mar 2025 11:15:29 +0300 Subject: [PATCH 3/5] feat: add gost-agent --- charts/gost-agent/Chart.yaml | 4 ++-- charts/gost-agent/values.yaml | 23 ++++++++++++++++++++--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/charts/gost-agent/Chart.yaml b/charts/gost-agent/Chart.yaml index 7d77cf90..93a2277f 100644 --- a/charts/gost-agent/Chart.yaml +++ b/charts/gost-agent/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -name: ngrok-agent +name: gost-agent description: A Helm chart for Kubernetes type: application version: 0.1.0 @@ -9,4 +9,4 @@ maintainers: dependencies: - name: cf-common repository: oci://quay.io/codefresh/charts - version: 0.24.1 + version: 0.24.0 diff --git a/charts/gost-agent/values.yaml b/charts/gost-agent/values.yaml index 3f524e17..5ca56e91 100644 --- a/charts/gost-agent/values.yaml +++ b/charts/gost-agent/values.yaml @@ -21,10 +21,27 @@ container: - "-L" - 'rtcp://:0//internal-gateway:80' - "-F" - - "tunnel+wss://${GOST_SERVER_HOSTNAME}:443?tunnel.id=${GOST_PLATFORM_TUNNEL_ID}&keepalive=true&ttl=15s" + - "tunnel+wss://$(GOST_SERVER_HOSTNAME):443?tunnel.id=$(GOST_PLATFORM_TUNNEL_ID)&keepalive=true&ttl=15s" env: - GOST_SERVER_HOSTNAME: f598c8b79c17fe29.gost.shared-services.cf-infra.com - GOST_PLATFORM_TUNNEL_ID: c5db1800-ce4c-11de-8413-6a7c5a153390 + GOST_SERVER_HOSTNAME: "" + GOST_PLATFORM_TUNNEL_ID: "" + GOST_PLATFORM_TUNNEL_HOSTNAME: "" + probes: + liveness: + enabled: true + type: exec + exec: + command: + - wget + - --server-response + - --spider + - https://$(GOST_PLATFORM_TUNNEL_HOSTNAME) + spec: + initialDelaySeconds: 30 + periodSeconds: 15 + timeoutSeconds: 15 + successThreshold: 1 + failureThreshold: 2 nodeSelector: {} tolerations: [] From be0a55aab87040b8d12b7e0b77b0459acb443c00 Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Tue, 25 Mar 2025 11:17:41 +0300 Subject: [PATCH 4/5] feat: add gost-agent --- charts/gost-agent/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/gost-agent/values.yaml b/charts/gost-agent/values.yaml index 5ca56e91..6d01298c 100644 --- a/charts/gost-agent/values.yaml +++ b/charts/gost-agent/values.yaml @@ -27,13 +27,13 @@ container: GOST_PLATFORM_TUNNEL_ID: "" GOST_PLATFORM_TUNNEL_HOSTNAME: "" probes: - liveness: + liveness: enabled: true type: exec exec: command: - wget - - --server-response + - --server-response - --spider - https://$(GOST_PLATFORM_TUNNEL_HOSTNAME) spec: From c668ddeef3e7e560fb39ffe37246a87d2eb3a4cb Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Tue, 25 Mar 2025 11:26:25 +0300 Subject: [PATCH 5/5] feat: add gost-agent --- charts/gost-agent/README.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/charts/gost-agent/README.md b/charts/gost-agent/README.md index 05193f79..1030de4b 100644 --- a/charts/gost-agent/README.md +++ b/charts/gost-agent/README.md @@ -1,4 +1,4 @@ -# ngrok-agent +# gost-agent ![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) @@ -14,7 +14,7 @@ A Helm chart for Kubernetes | Repository | Name | Version | |------------|------|---------| -| oci://quay.io/codefresh/charts | cf-common | 0.24.1 | +| oci://quay.io/codefresh/charts | cf-common | 0.24.0 | ## Values @@ -24,14 +24,26 @@ A Helm chart for Kubernetes | container.args[0] | string | `"-L"` | | | container.args[1] | string | `"rtcp://:0//internal-gateway:80"` | | | container.args[2] | string | `"-F"` | | -| container.args[3] | string | `"tunnel+wss://${GOST_SERVER_HOSTNAME}:443?tunnel.id=${GOST_PLATFORM_TUNNEL_ID}&keepalive=true&ttl=15s"` | | +| container.args[3] | string | `"tunnel+wss://$(GOST_SERVER_HOSTNAME):443?tunnel.id=$(GOST_PLATFORM_TUNNEL_ID)&keepalive=true&ttl=15s"` | | | container.command[0] | string | `"gost"` | | -| container.env.GOST_PLATFORM_TUNNEL_ID | string | `"c5db1800-ce4c-11de-8413-6a7c5a153390"` | | -| container.env.GOST_SERVER_HOSTNAME | string | `"f598c8b79c17fe29.gost.shared-services.cf-infra.com"` | | +| container.env.GOST_PLATFORM_TUNNEL_HOSTNAME | string | `""` | | +| container.env.GOST_PLATFORM_TUNNEL_ID | string | `""` | | +| container.env.GOST_SERVER_HOSTNAME | string | `""` | | | container.image.pullPolicy | string | `"IfNotPresent"` | | | container.image.registry | string | `"docker.io"` | | | container.image.repository | string | `"gogost/gost"` | | | container.image.tag | string | `"latest"` | | +| container.probes.liveness.enabled | bool | `true` | | +| container.probes.liveness.exec.command[0] | string | `"wget"` | | +| container.probes.liveness.exec.command[1] | string | `"--server-response"` | | +| container.probes.liveness.exec.command[2] | string | `"--spider"` | | +| container.probes.liveness.exec.command[3] | string | `"https://$(GOST_PLATFORM_TUNNEL_HOSTNAME)"` | | +| container.probes.liveness.spec.failureThreshold | int | `2` | | +| container.probes.liveness.spec.initialDelaySeconds | int | `30` | | +| container.probes.liveness.spec.periodSeconds | int | `15` | | +| container.probes.liveness.spec.successThreshold | int | `1` | | +| container.probes.liveness.spec.timeoutSeconds | int | `15` | | +| container.probes.liveness.type | string | `"exec"` | | | controller.deployment.strategy | string | `"Recreate"` | | | controller.enabled | bool | `true` | | | controller.replicas | int | `1` | |