-
Notifications
You must be signed in to change notification settings - Fork 4
/
13-deployment-sidecar.yaml
123 lines (123 loc) · 2.57 KB
/
13-deployment-sidecar.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
apiVersion: v1
data:
config.yaml: |
logger:
level: debug
server:
port: 8080
services:
cache:
exceptions:
- /metrics
- /healthz
methods:
- GET
- HEAD
- OPTIONS
ttl:
success: 15
error: 3
hash:
prefix: demo
usePath: true
headers:
- X-Auth-Token
queryParams:
- apikey
proxy:
# Upstream targets definition, a.k.a where requests are routed to
# Targets are used in a round robin fashion
upstreams:
- port: 8000
host: localhost
kind: ConfigMap
metadata:
name: configs-cache
namespace: demo
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-sidecar
namespace: demo
labels:
app: hello-sidecar
spec:
replicas: 1
selector:
matchLabels:
app: hello-sidecar
template:
metadata:
labels:
app: hello-sidecar
spec:
initContainers:
- name: init-networking
image: marcoamador/vache-init:1.1.4
securityContext:
capabilities:
add:
- NET_ADMIN
privileged: true
containers:
- name: vache-proxy
image: marcoamador/vache:1.1.4
volumeMounts:
- name: configs-cache
mountPath: /mfamador/app/configs/config.yaml
subPath: config.yaml
ports:
- name: proxy-http
containerPort: 8080
livenessProbe:
httpGet:
path: "/vache/healthz"
port: proxy-http
readinessProbe:
httpGet:
path: "/vache/healthz"
port: proxy-http
- name: hello
image: marcoamador/hello:1.0.0
imagePullPolicy: Always
ports:
- containerPort: 8000
volumes:
- name: configs-cache
configMap:
name: configs-cache
---
apiVersion: v1
kind: Service
metadata:
labels:
app: hello-sidecar
name: hello-sidecar
namespace: demo
spec:
ports:
- port: 8000
protocol: TCP
targetPort: 8000
selector:
app: hello-sidecar
type: ClusterIP
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: hello-sidecar
namespace: demo
spec:
rules:
- host: echo-sidecar.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: hello-sidecar
port:
number: 8000