Skip to content

Commit

Permalink
Merge pull request #2 from appuio/improvements
Browse files Browse the repository at this point in the history
improve readme and add ghost example
  • Loading branch information
tobru authored Oct 21, 2022
2 parents cf02967 + 0f5f092 commit 5336d17
Show file tree
Hide file tree
Showing 2 changed files with 207 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TCP over SOCKS5

[![Build](https://img.shields.io/github/workflow/status/appuio/tcp-over-socks/Test)][build]
[![Build](https://img.shields.io/github/workflow/status/appuio/tcp-over-socks/Build)][build]
![Go version](https://img.shields.io/github/go-mod/go-version/appuio/tcp-over-socks)
[![Version](https://img.shields.io/github/v/release/appuio/tcp-over-socks)][releases]
[![GitHub downloads](https://img.shields.io/github/downloads/appuio/tcp-over-socks/total)][releases]
Expand Down Expand Up @@ -29,6 +29,10 @@ GLOBAL OPTIONS:

See files in `examples/`.

## Use-Cases

* [Tailscale on APPUiO Cloud](https://docs.appuio.cloud/user/how-to/tailscale.html)

## Credits

Original work done by @isayme in https://github.com/isayme/go-tcp-over-socks5.
Expand Down
202 changes: 202 additions & 0 deletions examples/kubernetes-ghost-over-mysql-proxy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
## Tailscale
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: tailscale
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["create"]
- apiGroups: [""]
resourceNames: ["tailscale"]
resources: ["secrets"]
verbs: ["get", "update"]
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: tailscale
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: tailscale
subjects:
- kind: ServiceAccount
name: tailscale
roleRef:
kind: Role
name: tailscale
apiGroup: rbac.authorization.k8s.io
---
apiVersion: v1
kind: Secret
metadata:
name: tailscale-auth
stringData:
TS_AUTH_KEY: YOURTAILSCALEKEY
type: Opaque
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tailscale
spec:
minReadySeconds: 15
replicas: 1
selector:
matchLabels:
app: tailscale
strategy:
type: Recreate
template:
metadata:
labels:
app: tailscale
spec:
serviceAccountName: tailscale
containers:
- name: tailscale
imagePullPolicy: Always
image: ghcr.io/tailscale/tailscale:v1.33
ports:
- containerPort: 1055
name: tsproxy
protocol: TCP
env:
- name: TS_KUBE_SECRET
value: tailscale
- name: TS_USERSPACE
value: "true"
- name: TS_AUTH_KEY
valueFrom:
secretKeyRef:
name: tailscale-auth
key: TS_AUTH_KEY
optional: true
- name: TS_SOCKS5_SERVER
value: 0.0.0.0:1055
volumeMounts:
- mountPath: /.cache/
name: cache
volumes:
- name: cache
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: tailscale
spec:
ports:
- name: tsproxy
port: 1055
protocol: TCP
targetPort: 1055
selector:
app: tailscale
type: ClusterIP

## TCP over SOCKS5
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql-tcp-over-socks
spec:
minReadySeconds: 15
replicas: 1
selector:
matchLabels:
app: mysql-tcp-over-socks
strategy:
type: RollingUpdate
template:
metadata:
labels:
app: mysql-tcp-over-socks
spec:
containers:
- name: tos
imagePullPolicy: Always
image: ghcr.io/appuio/tcp-over-socks:latest
ports:
- containerPort: 3306
protocol: TCP
args:
- --port
- "3306"
- --socks5
- tailscale:1055
- --target
- 100.66.5.47:3306
---
apiVersion: v1
kind: Service
metadata:
name: db
spec:
ports:
- name: db
port: 3306
protocol: TCP
targetPort: 3306
selector:
app: mysql-tcp-over-socks
type: ClusterIP

## Ghost
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ghost
spec:
minReadySeconds: 15
replicas: 1
selector:
matchLabels:
app: ghost
strategy:
type: Recreate
template:
metadata:
labels:
app: ghost
spec:
containers:
- name: ghost
imagePullPolicy: Always
image: docker.io/ghost:latest
ports:
- containerPort: 2368
name: ghost
protocol: TCP
env:
- name: url
value: http://localhost:8080
- name: database__client
value: mysql
- name: database__connection__host
value: db
- name: database__connection__user
value: ghost
- name: database__connection__password
value: blubber
- name: database__connection__database
value: ghost
---
apiVersion: v1
kind: Service
metadata:
name: ghost
spec:
ports:
- name: ghost
port: 2368
protocol: TCP
targetPort: 2368
selector:
app: ghost
type: ClusterIP

0 comments on commit 5336d17

Please sign in to comment.