-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathfull-example.yaml
86 lines (86 loc) · 1.85 KB
/
full-example.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Example: exposing ingress as .onion via OnionService
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: http-app
spec:
replicas: 2
selector:
matchLabels:
app: http-app
template:
metadata:
labels:
app: http-app
spec:
containers:
- name: http-app
image: quay.io/bugfest/echoserver:2.5
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: http-app
labels:
app: http-app
spec:
ports:
- port: 8080
protocol: TCP
targetPort: 8080
selector:
app: http-app
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: http-app-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
# Need to specify the ingress class if you don't have a default one
# $ kubectl get ingressclass
ingressClassName: nginx
defaultBackend:
service:
name: default-http-backend
port:
number: 80
rules:
- host: '*.onion'
http:
paths:
- pathType: Prefix
path: /
backend:
service:
name: http-app
port:
number: 8080
---
apiVersion: tor.k8s.torproject.org/v1alpha2
kind: OnionService
metadata:
name: ingress-example-onion-service
spec:
version: 3
rules:
- port:
number: 80
backend:
service:
# This name will depend on your ingress installation
# For example, for nginx's ingress installation using helm
# the name template is [release-name]-nginx-ingress
#
# I used this commands:
# $ helm repo add nginx-stable https://helm.nginx.com/stable
# $ helm install nginx-ingress nginx-stable/nginx-ingress
name: nginx-ingress-nginx-ingress
port:
number: 80
extraConfig: |
HiddenServiceEnableIntroDoSDefense 1