Skip to content

Commit 0b3f10a

Browse files
committed
Add dynamic mlmd-envoy config
- Removes requirement for mlmd-grpc Service to be explicitly named `metadata-grpc-service`
1 parent aec768a commit 0b3f10a

File tree

3 files changed

+63
-0
lines changed

3 files changed

+63
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: ds-pipeline-metadata-envoy-config-{{.Name}}
5+
namespace: {{.Namespace}}
6+
labels:
7+
app: ds-pipeline-metadata-envoy-{{.Name}}
8+
component: data-science-pipelines
9+
data:
10+
envoy.yaml: |-
11+
admin:
12+
access_log_path: /tmp/admin_access.log
13+
address:
14+
socket_address: { address: 0.0.0.0, port_value: 9901 }
15+
16+
static_resources:
17+
listeners:
18+
- name: listener_0
19+
address:
20+
socket_address: { address: 0.0.0.0, port_value: 9090 }
21+
filter_chains:
22+
- filters:
23+
- name: envoy.http_connection_manager
24+
config:
25+
codec_type: auto
26+
stat_prefix: ingress_http
27+
route_config:
28+
name: local_route
29+
virtual_hosts:
30+
- name: local_service
31+
domains: ["*"]
32+
routes:
33+
- match: { prefix: "/" }
34+
route:
35+
cluster: metadata-cluster
36+
max_grpc_timeout: 0s
37+
cors:
38+
allow_origin:
39+
- "*"
40+
allow_methods: GET, PUT, DELETE, POST, OPTIONS
41+
allow_headers: keep-alive,user-agent,cache-control,content-type,content-transfer-encoding,custom-header-1,x-accept-content-transfer-encoding,x-accept-response-streaming,x-user-agent,x-grpc-web,grpc-timeout
42+
max_age: "1728000"
43+
expose_headers: custom-header-1,grpc-status,grpc-message
44+
http_filters:
45+
- name: envoy.grpc_web
46+
- name: envoy.cors
47+
- name: envoy.router
48+
clusters:
49+
- name: metadata-cluster
50+
connect_timeout: 30.0s
51+
type: logical_dns
52+
http2_protocol_options: {}
53+
lb_policy: round_robin
54+
hosts: [{ socket_address: { address: "ds-pipeline-metadata-grpc-{{.Name}}", port_value: {{.MLMD.GRPC.Port}} }}]

config/internal/ml-metadata/metadata-envoy.deployment.yaml.tmpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,11 @@ spec:
5959
memory: {{.MLMD.Envoy.Resources.Limits.Memory}}
6060
{{ end }}
6161
{{ end }}
62+
volumeMounts:
63+
- mountPath: /etc/envoy.yaml
64+
name: envoy-config
65+
subPath: envoy.yaml
66+
volumes:
67+
- name: envoy-config
68+
configMap:
69+
name: ds-pipeline-metadata-envoy-config-{{.Name}}

controllers/mlmd.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
)
2121

2222
var mlmdTemplates = []string{
23+
"ml-metadata/metadata-envoy.configmap.yaml.tmpl",
2324
"ml-metadata/metadata-envoy.deployment.yaml.tmpl",
2425
"ml-metadata/metadata-envoy.service.yaml.tmpl",
2526
"ml-metadata/metadata-grpc.deployment.yaml.tmpl",

0 commit comments

Comments
 (0)