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..93a2277f --- /dev/null +++ b/charts/gost-agent/Chart.yaml @@ -0,0 +1,12 @@ +apiVersion: v2 +name: gost-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.0 diff --git a/charts/gost-agent/README.md b/charts/gost-agent/README.md new file mode 100644 index 00000000..1030de4b --- /dev/null +++ b/charts/gost-agent/README.md @@ -0,0 +1,61 @@ +# 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) + +A Helm chart for Kubernetes + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| codefresh | | | + +## Requirements + +| Repository | Name | Version | +|------------|------|---------| +| oci://quay.io/codefresh/charts | cf-common | 0.24.0 | + +## 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_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` | | +| 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..ed9f1aea --- /dev/null +++ b/charts/gost-agent/templates/all_resources.yaml @@ -0,0 +1,5 @@ +{{- define "ngrok-agent.resources" -}} + +{{ include "ngrok-agent.controller" . }} + +{{- 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..6d01298c --- /dev/null +++ b/charts/gost-agent/values.yaml @@ -0,0 +1,53 @@ +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: "" + 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: [] +affinity: {} +hpa: {} +keda: + spec: {} + auth: {} +pdb: {}