-
Notifications
You must be signed in to change notification settings - Fork 0
/
docs-api-envoy.yaml
170 lines (170 loc) · 4.98 KB
/
docs-api-envoy.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
apiVersion: apps/v1
kind: Deployment
metadata:
name: docs-api
labels:
app: docs-api
spec:
selector:
matchLabels:
app: docs-api
template:
metadata:
labels:
app: docs-api
spec:
containers:
- name: docs-api
image: quay.io/kuadrant/authorino-examples:news-api
imagePullPolicy: IfNotPresent
env:
- name: PORT
value: "3000"
tty: true
ports:
- containerPort: 3000
- name: envoy
image: envoyproxy/envoy:v1.19-latest
imagePullPolicy: IfNotPresent
command:
- /usr/local/bin/envoy
args:
- --config-path /usr/local/etc/envoy/envoy.yaml
- --service-cluster front-proxy
- --log-level info
- --component-log-level filter:trace,http:debug,router:debug
ports:
- containerPort: 8000
volumeMounts:
- mountPath: /usr/local/etc/envoy
name: config
readOnly: true
volumes:
- name: config
configMap:
items:
- key: envoy.yaml
path: envoy.yaml
name: envoy
replicas: 1
---
apiVersion: v1
kind: Service
metadata:
name: docs-api
labels:
app: docs-api
spec:
selector:
app: docs-api
ports:
- name: envoy
port: 8000
protocol: TCP
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: docs-api
labels:
app: docs-api
spec:
rules:
- host: docs-api.127.0.0.1.nip.io
http:
paths:
- backend:
service:
name: docs-api
port:
number: 8000
path: /docs
pathType: Prefix
---
apiVersion: v1
kind: ConfigMap
metadata:
name: envoy
labels:
app: envoy
data:
envoy.yaml: |
static_resources:
clusters:
- name: docs-api
connect_timeout: 0.25s
type: strict_dns
lb_policy: round_robin
load_assignment:
cluster_name: docs-api
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 127.0.0.1
port_value: 3000
- name: authorino
connect_timeout: 0.25s
type: strict_dns
lb_policy: round_robin
http2_protocol_options: {}
load_assignment:
cluster_name: authorino
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: authorino-authorino-authorization
port_value: 50051
listeners:
- address:
socket_address:
address: 0.0.0.0
port_value: 8000
filter_chains:
- filters:
- name: envoy.http_connection_manager
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
stat_prefix: local
route_config:
name: docs-api
virtual_hosts:
- name: docs-api
domains: ['*']
routes:
- match:
prefix: /
route:
cluster: docs-api
http_filters:
- name: envoy.filters.http.ext_authz
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthz
transport_api_version: V3
failure_mode_allow: false
include_peer_certificate: true
grpc_service:
envoy_grpc:
cluster_name: authorino
timeout: 1s
- name: envoy.filters.http.lua
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua
inline_code: |
function envoy_on_request(request_handle)
if string.match(request_handle:headers():get(":path"), '^/docs/[^/]+/allow/.+') then
request_handle:respond({[":status"] = "200"}, "")
end
end
- name: envoy.filters.http.router
typed_config: {}
use_remote_address: true
admin:
access_log_path: "/tmp/admin_access.log"
address:
socket_address:
address: 0.0.0.0
port_value: 8001