Skip to content

Commit be32d38

Browse files
feat: add gost-agent (#106)
1 parent b435285 commit be32d38

File tree

8 files changed

+225
-0
lines changed

8 files changed

+225
-0
lines changed

charts/gost-agent/.helmignore

Lines changed: 23 additions & 0 deletions
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/

charts/gost-agent/Chart.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v2
2+
name: gost-agent
3+
description: A Helm chart for Kubernetes
4+
type: application
5+
version: 0.1.0
6+
maintainers:
7+
- name: codefresh
8+
url: https://codefresh-io.github.io/
9+
dependencies:
10+
- name: cf-common
11+
repository: oci://quay.io/codefresh/charts
12+
version: 0.24.0

charts/gost-agent/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# gost-agent
2+
3+
![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)
4+
5+
A Helm chart for Kubernetes
6+
7+
## Maintainers
8+
9+
| Name | Email | Url |
10+
| ---- | ------ | --- |
11+
| codefresh | | <https://codefresh-io.github.io/> |
12+
13+
## Requirements
14+
15+
| Repository | Name | Version |
16+
|------------|------|---------|
17+
| oci://quay.io/codefresh/charts | cf-common | 0.24.0 |
18+
19+
## Values
20+
21+
| Key | Type | Default | Description |
22+
|-----|------|---------|-------------|
23+
| affinity | object | `{}` | |
24+
| container.args[0] | string | `"-L"` | |
25+
| container.args[1] | string | `"rtcp://:0//internal-gateway:80"` | |
26+
| container.args[2] | string | `"-F"` | |
27+
| container.args[3] | string | `"tunnel+wss://$(GOST_SERVER_HOSTNAME):443?tunnel.id=$(GOST_PLATFORM_TUNNEL_ID)&keepalive=true&ttl=15s"` | |
28+
| container.command[0] | string | `"gost"` | |
29+
| container.env.GOST_PLATFORM_TUNNEL_HOSTNAME | string | `""` | |
30+
| container.env.GOST_PLATFORM_TUNNEL_ID | string | `""` | |
31+
| container.env.GOST_SERVER_HOSTNAME | string | `""` | |
32+
| container.image.pullPolicy | string | `"IfNotPresent"` | |
33+
| container.image.registry | string | `"docker.io"` | |
34+
| container.image.repository | string | `"gogost/gost"` | |
35+
| container.image.tag | string | `"latest"` | |
36+
| container.probes.liveness.enabled | bool | `true` | |
37+
| container.probes.liveness.exec.command[0] | string | `"wget"` | |
38+
| container.probes.liveness.exec.command[1] | string | `"--server-response"` | |
39+
| container.probes.liveness.exec.command[2] | string | `"--spider"` | |
40+
| container.probes.liveness.exec.command[3] | string | `"https://$(GOST_PLATFORM_TUNNEL_HOSTNAME)"` | |
41+
| container.probes.liveness.spec.failureThreshold | int | `2` | |
42+
| container.probes.liveness.spec.initialDelaySeconds | int | `30` | |
43+
| container.probes.liveness.spec.periodSeconds | int | `15` | |
44+
| container.probes.liveness.spec.successThreshold | int | `1` | |
45+
| container.probes.liveness.spec.timeoutSeconds | int | `15` | |
46+
| container.probes.liveness.type | string | `"exec"` | |
47+
| controller.deployment.strategy | string | `"Recreate"` | |
48+
| controller.enabled | bool | `true` | |
49+
| controller.replicas | int | `1` | |
50+
| controller.type | string | `"deployment"` | |
51+
| global | object | `{}` | |
52+
| hpa | object | `{}` | |
53+
| keda.auth | object | `{}` | |
54+
| keda.spec | object | `{}` | |
55+
| libraryMode | bool | `false` | |
56+
| nodeSelector | object | `{}` | |
57+
| pdb | object | `{}` | |
58+
| tolerations | list | `[]` | |
59+
60+
----------------------------------------------
61+
Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{{- define "gost-agent.controller" }}
2+
3+
{{- $templateName := printf "cf-common-%s.controller" (index .Subcharts "cf-common").Chart.Version -}}
4+
{{- include $templateName . -}}
5+
6+
{{- end }}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "ngrok-agent.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 "ngrok-agent.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 "ngrok-agent.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "ngrok-agent.labels" -}}
37+
helm.sh/chart: {{ include "ngrok-agent.chart" . }}
38+
{{ include "ngrok-agent.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 "ngrok-agent.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "ngrok-agent.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 "ngrok-agent.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "ngrok-agent.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{{- define "ngrok-agent.resources" -}}
2+
3+
{{ include "ngrok-agent.controller" . }}
4+
5+
{{- end -}}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{- if not .Values.libraryMode }}
2+
{{- include "gost-agent.controller" . }}
3+
{{- end }}

charts/gost-agent/values.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
libraryMode: false
2+
3+
global: {}
4+
5+
controller:
6+
enabled: true
7+
type: deployment
8+
replicas: 1
9+
deployment:
10+
strategy: Recreate
11+
12+
container:
13+
image:
14+
registry: docker.io
15+
repository: gogost/gost
16+
tag: latest
17+
pullPolicy: IfNotPresent
18+
command:
19+
- "gost"
20+
args:
21+
- "-L"
22+
- 'rtcp://:0//internal-gateway:80'
23+
- "-F"
24+
- "tunnel+wss://$(GOST_SERVER_HOSTNAME):443?tunnel.id=$(GOST_PLATFORM_TUNNEL_ID)&keepalive=true&ttl=15s"
25+
env:
26+
GOST_SERVER_HOSTNAME: ""
27+
GOST_PLATFORM_TUNNEL_ID: ""
28+
GOST_PLATFORM_TUNNEL_HOSTNAME: ""
29+
probes:
30+
liveness:
31+
enabled: true
32+
type: exec
33+
exec:
34+
command:
35+
- wget
36+
- --server-response
37+
- --spider
38+
- https://$(GOST_PLATFORM_TUNNEL_HOSTNAME)
39+
spec:
40+
initialDelaySeconds: 30
41+
periodSeconds: 15
42+
timeoutSeconds: 15
43+
successThreshold: 1
44+
failureThreshold: 2
45+
46+
nodeSelector: {}
47+
tolerations: []
48+
affinity: {}
49+
hpa: {}
50+
keda:
51+
spec: {}
52+
auth: {}
53+
pdb: {}

0 commit comments

Comments
 (0)