gost
by alekc
GO Simple Tunnel: a lightweight, protocol-agnostic proxy and tunnel supporting SOCKS5, HTTP, Shadowsocks, and dozens of other transports, configured declaratively from a single YAML file.
About this chart
gost
GO Simple Tunnel: a lightweight, protocol-agnostic proxy and tunnel supporting SOCKS5, HTTP, Shadowsocks, and dozens of other transports, configured declaratively from a single YAML file.
gost ("GO Simple Tunnel") is a protocol-agnostic proxy: point a client at it over SOCKS5, HTTP, Shadowsocks, or one of its many other transports, and it relays to whatever destination the client asks for. This chart runs it as a Deployment with an optional Ingress and HorizontalPodAutoscaler.
Quick start
From the classic chart repository:
helm repo add alekc https://charts.alekc.dev
helm repo update
helm install my-gost alekc/gost
Or directly from the OCI registry, no helm repo add needed:
helm install my-gost oci://charts.alekc.dev/gost --version 0.2.0
Verifying the signature
curl -sO https://charts.alekc.dev/pubring.gpg
helm pull oci://charts.alekc.dev/gost --version 0.2.0 --verify --keyring pubring.gpg
A minimal working values.yaml, a plain SOCKS5 listener with no auth:
config:
services:
- name: socks5
addr: :1080
handler:
type: socks5
listener:
type: tcp
See the gost config reference for every listener
type, chain, and auth option config can express.
Maintainers
| Name | Url | |
|---|---|---|
| alekc | [email protected] | https://blog.alekc.org |
Source Code
Gotchas
deployment.portsandservice.portsare independent lists you must keep in sync yourself. Adding a listener toconfigdoes nothing to the Deployment or Service unless you also add a matching entry to both, by container port and bytargetPort/namerespectively. Nothing validates this for you; a listener with no matching port is silently unreachable from outside the pod.- The Ingress always routes to the first entry in
service.ports. If you expose more than one listener, either put the one you want reachable via Ingress first, or fork the Ingress template for a second rule. networkPolicy.enabledallows broad egress to0.0.0.0/0by default. gost's entire job is dialing whatever destination a client asks it to relay to, so there's no small fixed CIDR to narrow this to out of the box. Narrow it withnetworkPolicy.extraEgressif this deployment only ever proxies to a known, fixed set of destinations.livenessProbe/readinessProbeare empty by default. gost has no built-in HTTP health endpoint; use atcpSocketprobe against one ofdeployment.portsif you need one.
Upgrade notes
No breaking changes yet. This section will list migration steps for any future release with
a kind: removed or kind: changed entry in artifacthub.io/changes that requires one.
Values
| Key | Type | Default | Description |
|---|---|---|---|
| additionalManifests | object | {} | Additional raw Kubernetes manifests to render alongside the chart's own resources. Supports any valid Kubernetes object; values are templated with tpl, so a manifest can reference .Release.Namespace and friends. |
| affinity | object | {} | Affinity rules for pod scheduling. |
| autoscaling.annotations | object | {} | Annotations to add to the HorizontalPodAutoscaler |
| autoscaling.enabled | bool | false | Renders a HorizontalPodAutoscaler instead of a fixed replicaCount. |
| autoscaling.maxReplicas | int | 100 | Maximum replica count. |
| autoscaling.minReplicas | int | 1 | Minimum replica count. |
| autoscaling.targetCPUUtilizationPercentage | int | 80 | Target average CPU utilization percentage. |
| commonAnnotations | object | {} | Annotations merged onto every resource this chart renders, in addition to each resource's own dedicated annotations field. |
| commonLabels | object | {} | Labels merged onto every resource this chart renders. Never reaches selector/matchLabels, safe to change without forcing a Deployment recreate. |
| config | object | {"debug":false} | gost's own config file (gost.yml), rendered into a ConfigMap and mounted at /etc/gost/. See https://gost.run/en/configuration/config/ for the full config reference: services, chains, listeners, and more. |
| configMapAnnotations | object | {} | Annotations to add to the ConfigMap holding gost.yml. |
| deployment.annotations | object | {} | Annotations to add to the Deployment. |
| deployment.args | list | [] | Extra args passed to the gost binary. |
| deployment.ports | list | [{"containerPort":1080,"name":"socks","protocol":"TCP"}] | Container ports. Add an entry here for every listener config actually configures; nothing exposes itself automatically. |
| deployment.strategy | object | {"type":"RollingUpdate"} | Deployment strategy (e.g., RollingUpdate, Recreate). |
| env | object | {"full":[],"simple":{}} | environment values |
| env.full | list | [] | full envs, they will be rendered as written here. Useful if you need to use secrets/cm |
| env.simple | object | {} | simple key: val based env vars |
| extraContainers | list | [] | Extra sidecar containers appended to the pod spec, templated with tpl so they can reference .Release.Namespace and friends. |
| fullnameOverride | string | "" | Overrides the full resource name, instead of the default <release>-<chart> pattern. |
| image.pullPolicy | string | "IfNotPresent" | Image pull policy. |
| image.repository | string | "gogost/gost" | Image repository. |
| image.tag | string | "" | Overrides the image tag whose default is the chart appVersion. |
| imagePullSecrets | list | [] | Image pull secrets, for a private registry mirror. |
| ingress.annotations | object | {} | Annotations to add to the Ingress |
| ingress.className | string | "" | IngressClass name, e.g. "nginx" or "traefik" |
| ingress.enabled | bool | false | Renders an Ingress for the Service. |
| ingress.hosts | list | [{"host":"chart-example.local","paths":[{"path":"/","pathType":"ImplementationSpecific"}]}] | Ingress host and path rules |
| ingress.tls | list | [] | TLS configuration for the Ingress |
| initContainers | list | [] | Extra init containers appended to the pod spec, templated with tpl. |
| livenessProbe | object | {} | Liveness probe. gost has no default HTTP health endpoint; leave empty (the default) unless your config defines one, or use a tcpSocket probe against one of deployment.ports instead. |
| nameOverride | string | "" | Overrides the chart name used to build resource names. |
| networkPolicy.annotations | object | {} | Annotations to add to the NetworkPolicy |
| networkPolicy.enabled | bool | false | Render a NetworkPolicy restricting ingress to service.ports and egress to DNS plus whatever extraEgress adds. gost's whole job is dialing whatever destination a client asks it to relay to, so egress here is broad by default, see Gotchas. |
| networkPolicy.extraEgress | list | [] | Additional raw egress rules, appended as-is under spec.egress. |
| networkPolicy.extraIngress | list | [] | Additional raw ingress rules, appended as-is under spec.ingress. |
| nodeSelector | object | {} | Node selector for pod scheduling. |
| podAnnotations | object | {} | Annotations added to the pod template. |
| podSecurityContext | object | {} | Pod-level securityContext. |
| readinessProbe | object | {} | Readiness probe. Same caveat as livenessProbe above. |
| replicaCount | int | 1 | Pod replica count. Ignored when autoscaling.enabled is true. |
| resources | object | {} | Container resource requests/limits. |
| securityContext | object | {} | Container-level securityContext. |
| service.annotations | object | {} | Annotations to add to the Service. |
| service.externalIPs | list | [] | Attach external IPs to the Service directly, bypassing a LoadBalancer. |
| service.ports | list | [{"name":"socks","port":1080,"protocol":"TCP","targetPort":"socks"}] | Service ports. targetPort must match one of deployment.ports' name fields. The Ingress (if enabled) always routes to the first entry here, see Gotchas. |
| service.type | string | "ClusterIP" | Kubernetes Service type. |
| serviceAccount.annotations | object | {} | Annotations to add to the service account |
| serviceAccount.create | bool | true | Specifies whether a service account should be created |
| serviceAccount.name | string | "" | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
| tolerations | list | [] | Tolerations for pod scheduling. |
Deploy gost with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has gost on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartgost is pinned at v0.3.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply