Docker Deployment
Deploy the Envoy Authorization Service using Docker and Docker Compose.
Quick Start
Pull Image
bash
docker pull ghcr.io/gtriggiano/envoy-authorization-service:1.4.01
Run Container
bash
docker run -d \
--name auth-service \
-p 9001:9001 \
-p 9090:9090 \
-v $(pwd)/config.yaml:/config.yaml \
ghcr.io/gtriggiano/envoy-authorization-service:1.4.0 \
start --config /config.yaml1
2
3
4
5
6
7
2
3
4
5
6
7
Docker Compose
Create docker-compose.yaml:
yaml
services:
authz-service:
image: ghcr.io/gtriggiano/envoy-authorization-service:1.4.0
container_name: envoy-authz-service
ports:
- "9001:9001" # gRPC
- "9090:9090" # Metrics
volumes:
- ./config.yaml:/config.yaml:ro
command: start --config /config.yaml
restart: unless-stopped
networks:
- envoy-net
networks:
envoy-net:
driver: bridge1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Start services:
bash
docker-compose up -d1
With Envoy
Complete setup with Envoy Proxy:
yaml
services:
authz-service:
image: ghcr.io/gtriggiano/envoy-authorization-service:1.4.0
container_name: envoy-authz-service
volumes:
- ./config.yaml:/config.yaml:ro
command: start --config /config.yaml
ports:
- "9001:9001" # gRPC
- "9090:9090" # Metrics
networks:
- envoy-net
envoy:
image: envoyproxy/envoy:v1.28-latest
ports:
- "8080:8080"
volumes:
- ./envoy.yaml:/etc/envoy/envoy.yaml:ro
command: -c /etc/envoy/envoy.yaml
depends_on:
- authz-service
networks:
- envoy-net
upstream:
image: nginx:alpine
networks:
- envoy-net
networks:
envoy-net:
driver: bridge1
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
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
envoy.yaml:
yaml
static_resources:
listeners:
- name: main
address:
socket_address:
address: 0.0.0.0
port_value: 8080
filter_chains:
- filters:
- name: envoy.filters.network.http_connection_manager
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
stat_prefix: ingress_http
http_filters:
- name: envoy.filters.http.ext_authz
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthz
grpc_service:
envoy_grpc:
cluster_name: authz_service
timeout: 1s
transport_api_version: V3
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
route_config:
name: local_route
virtual_hosts:
- name: backend
domains: ["*"]
routes:
- match: { prefix: "/" }
route: { cluster: upstream }
clusters:
- name: authz_service
connect_timeout: 1s
type: STRICT_DNS
http2_protocol_options: {}
load_assignment:
cluster_name: authz_service
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: authz_service
port_value: 9001
- name: upstream
connect_timeout: 1s
type: STRICT_DNS
load_assignment:
cluster_name: upstream
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: upstream
port_value: 801
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
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
With Redis
Add Redis for dynamic IP control:
yaml
services:
authz-service:
image: ghcr.io/gtriggiano/envoy-authorization-service:1.4.0
volumes:
- ./config.yaml:/config.yaml:ro
command: start --config /config.yaml
ports:
- "9001:9001" # gRPC
- "9090:9090" # Metrics
depends_on:
- redis
networks:
- envoy-net
redis:
image: redis:7-alpine
command: redis-server
ports:
- "6379:6379"
volumes:
- redis-data:/data
networks:
- envoy-net
envoy:
image: envoyproxy/envoy:v1.28-latest
ports:
- "8080:8080"
volumes:
- ./envoy.yaml:/etc/envoy/envoy.yaml:ro
depends_on:
- authz-service
networks:
- envoy-net
volumes:
redis-data:
networks:
envoy-net: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
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