Tor Operator is a Kubernetes Operator that manages Onion Balances, Onion Keys and Onion Services to provide a highly available, load balanced and fault tolerate Tor Ingress and Tor Proxy.
https://agabani.github.io/tor-operator/docs/
-
Add the chart repository.
helm repo add agabani-tor-operator https://agabani.github.io/tor-operator
-
Update the chart repository.
helm repo update agabani-tor-operator
-
Install the Tor Operator.
helm upgrade tor-operator agabani-tor-operator/tor-operator \ --create-namespace \ --install \ --namespace tor-operator
-
Test the Tor Operator.
helm test tor-operator --namespace tor-operator
-
Prepare your existing Onion Key to look like:
hostname
hs_ed25519_public_key
hs_ed25519_secret_key
or generate a new Onion Key using:
cargo install --git https://github.com/agabani/tor-operator --tag v0.0.33 tor-operator onion-key generate
-
Create a
Secret
containing the Onion Key.kubectl create secret generic tor-ingress-example \ --from-file=hostname=./hostname \ --from-file=hs_ed25519_public_key=./hs_ed25519_public_key \ --from-file=hs_ed25519_secret_key=./hs_ed25519_secret_key
-
Create an
OnionKey
wrapping theSecret
.# onionkey.yaml apiVersion: tor.agabani.co.uk/v1 kind: OnionKey metadata: name: tor-ingress-example spec: secret: name: tor-ingress-example
kubectl apply -f onionkey.yaml
-
Create a
TorIngress
, changingexample:80
to your targetshost:port
# toringress.yaml apiVersion: tor.agabani.co.uk/v1 kind: TorIngress metadata: name: tor-ingress-example spec: horizontalPodAutoscaler: maxReplicas: 6 minReplicas: 3 onionBalance: onionKey: name: tor-ingress-example onionService: deployment: containers: - name: tor resources: requests: cpu: 100m ports: - target: example:80 virtport: 80
kubectl apply -f toringress.yaml
-
Create a
TorProxy
# torproxy.yaml apiVersion: tor.agabani.co.uk/v1 kind: TorProxy metadata: name: tor-proxy-example spec: deployment: containers: - name: tor resources: requests: cpu: 100m horizontalPodAutoscaler: maxReplicas: 4 minReplicas: 2 service: ports: - name: http-tunnel port: 1080 protocol: HTTP_TUNNEL - name: socks port: 9050 protocol: SOCKS
kubectl apply -f torproxy.yaml