-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample-config.yaml
More file actions
178 lines (167 loc) · 6.69 KB
/
example-config.yaml
File metadata and controls
178 lines (167 loc) · 6.69 KB
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
171
172
173
174
175
176
177
178
# Example configuration for envoy-acme-xds
#
# This server provides an XDS control plane for Envoy that:
# 1. Serves listener and cluster configuration via LDS/CDS
# 2. Automatically obtains and renews TLS certificates via ACME (Let's Encrypt)
# 3. Serves certificates to Envoy via SDS
# 4. Handles HTTP-01 ACME challenges by dynamically injecting routes
meta:
# Directory for storing ACME account credentials and certificates
storage_dir: /var/lib/envoy-acme-xds
# Unix socket path for the XDS gRPC server (optional with systemd socket activation)
socket_path: /var/run/envoy-xds.sock
# ACME directory URL (uncomment for production)
# acme_directory_url: https://acme-v02.api.letsencrypt.org/directory
# Use staging for testing (default)
acme_directory_url: https://acme-staging-v02.api.letsencrypt.org/directory
# Certificates to obtain from ACME
certificates:
- name: example
domains:
- example.com
- www.example.com
- name: api
domains:
- api.example.com
# Envoy configuration (similar to static_resources format)
# This is merged with ACME challenge routes on port 80
envoy:
listeners:
# HTTP listener on port 80 - ACME routes will be prepended here
- name: http_listener
address:
socket_address:
address: 0.0.0.0
port_value: 80
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
route_config:
name: local_route
virtual_hosts:
- name: default
domains: ["*"]
routes:
- match:
prefix: "/"
redirect:
https_redirect: true
http_filters:
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
# HTTPS listener on port 443
- name: https_listener
address:
socket_address:
address: 0.0.0.0
port_value: 443
listener_filters:
- name: envoy.filters.listener.tls_inspector
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.listener.tls_inspector.v3.TlsInspector
filter_chains:
# Filter chain for example.com
- filter_chain_match:
server_names: ["example.com", "www.example.com"]
transport_socket:
name: envoy.transport_sockets.tls
typed_config:
"@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
common_tls_context:
tls_certificate_sds_secret_configs:
- name: example
sds_config:
api_config_source:
api_type: GRPC
transport_api_version: V3
grpc_services:
- envoy_grpc:
cluster_name: xds_cluster
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_https_example
route_config:
name: https_example_route
virtual_hosts:
- name: example_backend
domains: ["example.com", "www.example.com"]
routes:
- match:
prefix: "/"
route:
cluster: backend_cluster
http_filters:
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
# Filter chain for api.example.com
- filter_chain_match:
server_names: ["api.example.com"]
transport_socket:
name: envoy.transport_sockets.tls
typed_config:
"@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
common_tls_context:
tls_certificate_sds_secret_configs:
- name: api
sds_config:
api_config_source:
api_type: GRPC
transport_api_version: V3
grpc_services:
- envoy_grpc:
cluster_name: xds_cluster
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_https_api
route_config:
name: https_api_route
virtual_hosts:
- name: api_backend
domains: ["api.example.com"]
routes:
- match:
prefix: "/"
route:
cluster: backend_cluster
http_filters:
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
clusters:
# XDS cluster for connecting to this control plane
- name: xds_cluster
type: STATIC
typed_extension_protocol_options:
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
"@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
explicit_http_config:
http2_protocol_options: {}
load_assignment:
cluster_name: xds_cluster
endpoints:
- lb_endpoints:
- endpoint:
address:
pipe:
path: /var/run/envoy-xds.sock
# Backend service cluster
- name: backend_cluster
type: STRICT_DNS
load_assignment:
cluster_name: backend_cluster
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: backend.local
port_value: 8080