Skip to content

Commit

Permalink
feat(envoy): closing off the admin interface (#5936)
Browse files Browse the repository at this point in the history
* closing off the admin interface

* update hacks

* remove port 9003 from envoy svc

* fixing the service monitor
  • Loading branch information
driev authored Oct 22, 2024
1 parent be379f8 commit 5801de6
Show file tree
Hide file tree
Showing 14 changed files with 193 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1369,12 +1369,12 @@ spec:
- containerPort: 9000
name: http
- containerPort: 9003
name: envoy-admin
name: envoy-stats
readinessProbe:
failureThreshold: 3
httpGet:
path: /ready
port: envoy-admin
port: envoy-stats
initialDelaySeconds: 10
periodSeconds: 5
resources:
Expand Down
4 changes: 2 additions & 2 deletions k8s/yaml/components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1000,12 +1000,12 @@ spec:
- containerPort: 9000
name: http
- containerPort: 9003
name: envoy-admin
name: envoy-stats
readinessProbe:
failureThreshold: 3
httpGet:
path: /ready
port: envoy-admin
port: envoy-stats
initialDelaySeconds: 10
periodSeconds: 5
resources:
Expand Down
4 changes: 2 additions & 2 deletions operator/config/seldonconfigs/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ spec:
- containerPort: 9000
name: http
- containerPort: 9003
name: envoy-admin
name: envoy-stats
resources:
limits:
memory: 128Mi
Expand All @@ -68,7 +68,7 @@ spec:
readinessProbe:
httpGet:
path: /ready
port: envoy-admin
port: envoy-stats
initialDelaySeconds: 10
periodSeconds: 5
failureThreshold: 3
Expand Down
4 changes: 2 additions & 2 deletions operator/controllers/reconcilers/seldon/service_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ func getSeldonMeshService(meta metav1.ObjectMeta, serviceConfig mlopsv1alpha1.Se
},
{
Port: 9003,
TargetPort: intstr.FromString("envoy-admin"),
Name: "admin",
TargetPort: intstr.FromString("envoy-stats"),
Name: "stats",
Protocol: v1.ProtocolTCP,
},
},
Expand Down
2 changes: 1 addition & 1 deletion prometheus/monitors/envoy-servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
matchNames: []
any: false
endpoints:
- port: admin
- port: stats
interval: 15s
path: /stats/prometheus
48 changes: 45 additions & 3 deletions scheduler/config/envoy-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Base config for a split xDS management server on 9002, admin port on 9003
static_resources:
clusters:
- connect_timeout: 1s
Expand All @@ -14,6 +13,49 @@ static_resources:
port_value: 9002
http2_protocol_options: {}
name: xds_cluster
- connect_timeout: 0.250s
type: LOGICAL_DNS
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: admin_interface_cluster
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 127.0.0.1
port_value: 9901
name: admin_interface_cluster
listeners:
- name: util_endpoint_listener
address:
socket_address:
address: 0.0.0.0
port_value: 9003
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: util_endpoint_http
http_filters:
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
route_config:
name: local_admin_interface_route
virtual_hosts:
- name: admin_interface
domains: ["*"]
routes:
- match:
prefix: /stats
route:
cluster: admin_interface_cluster
- match:
prefix: /ready
route:
cluster: admin_interface_cluster
dynamic_resources:
cds_config:
resource_api_version: V3
Expand Down Expand Up @@ -53,5 +95,5 @@ admin:
access_log_path: /dev/null
address:
socket_address:
address: 0.0.0.0
port_value: 9003
address: 127.0.0.1
port_value: 9901
48 changes: 45 additions & 3 deletions scheduler/config/envoy-local.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Base config for a split xDS management server on 9002, admin port on 9003
static_resources:
clusters:
- connect_timeout: 1s
Expand All @@ -14,6 +13,49 @@ static_resources:
port_value: 9002
http2_protocol_options: {}
name: xds_cluster
- connect_timeout: 0.250s
type: LOGICAL_DNS
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: admin_interface_cluster
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 127.0.0.1
port_value: 9901
name: admin_interface_cluster
listeners:
- name: util_endpoint_listener
address:
socket_address:
address: 0.0.0.0
port_value: 9003
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: util_endpoint_http
http_filters:
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
route_config:
name: local_admin_interface_route
virtual_hosts:
- name: admin_interface
domains: ["*"]
routes:
- match:
prefix: /stats
route:
cluster: admin_interface_cluster
- match:
prefix: /ready
route:
cluster: admin_interface_cluster
dynamic_resources:
cds_config:
resource_api_version: V3
Expand Down Expand Up @@ -53,5 +95,5 @@ admin:
access_log_path: /dev/null
address:
socket_address:
address: 0.0.0.0
port_value: 9003
address: 127.0.0.1
port_value: 9901
48 changes: 45 additions & 3 deletions scheduler/config/envoy-tls.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Base config for a split xDS management server on 9002, admin port on 9003
static_resources:
clusters:
- connect_timeout: 1s
Expand Down Expand Up @@ -27,6 +26,49 @@ static_resources:
name: validation_context_sds
sds_config:
path: /etc/validation_context_sds_secret.yaml
- connect_timeout: 0.250s
type: LOGICAL_DNS
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: admin_interface_cluster
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 127.0.0.1
port_value: 9901
name: admin_interface_cluster
listeners:
- name: util_endpoint_listener
address:
socket_address:
address: 0.0.0.0
port_value: 9003
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: util_endpoint_http
http_filters:
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
route_config:
name: local_admin_interface_route
virtual_hosts:
- name: admin_interface
domains: ["*"]
routes:
- match:
prefix: /stats
route:
cluster: admin_interface_cluster
- match:
prefix: /ready
route:
cluster: admin_interface_cluster
dynamic_resources:
cds_config:
resource_api_version: V3
Expand Down Expand Up @@ -66,5 +108,5 @@ admin:
access_log_path: /dev/null
address:
socket_address:
address: 0.0.0.0
port_value: 9003
address: 127.0.0.1
port_value: 9901
48 changes: 45 additions & 3 deletions scheduler/config/envoy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Base config for a split xDS management server on 9002, admin port on 9003
static_resources:
clusters:
- connect_timeout: 1s
Expand All @@ -14,6 +13,49 @@ static_resources:
port_value: 9002
http2_protocol_options: {}
name: xds_cluster
- connect_timeout: 0.250s
type: LOGICAL_DNS
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: admin_interface_cluster
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 127.0.0.1
port_value: 9901
name: admin_interface_cluster
listeners:
- name: util_endpoint_listener
address:
socket_address:
address: 0.0.0.0
port_value: 9003
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: util_endpoint_http
http_filters:
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
route_config:
name: local_admin_interface_route
virtual_hosts:
- name: admin_interface
domains: ["*"]
routes:
- match:
prefix: /stats
route:
cluster: admin_interface_cluster
- match:
prefix: /ready
route:
cluster: admin_interface_cluster
dynamic_resources:
cds_config:
resource_api_version: V3
Expand Down Expand Up @@ -53,5 +95,5 @@ admin:
access_log_path: /dev/null
address:
socket_address:
address: 0.0.0.0
port_value: 9003
address: 127.0.0.1
port_value: 9901
3 changes: 1 addition & 2 deletions scheduler/hack/bootstrap.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Base config for a split xDS management server on 9002, admin port on 9003
static_resources:
clusters:
- connect_timeout: 1s
Expand Down Expand Up @@ -53,4 +52,4 @@ admin:
address:
socket_address:
address: 127.0.0.1
port_value: 9003
port_value: 9901
3 changes: 1 addition & 2 deletions scheduler/hack/bootstrap_delta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Base config for a split xDS management server on 9002, admin port on 9003
static_resources:
clusters:
- connect_timeout: 1s
Expand Down Expand Up @@ -53,4 +52,4 @@ admin:
address:
socket_address:
address: 127.0.0.1
port_value: 9003
port_value: 9901
2 changes: 1 addition & 1 deletion scheduler/k8s/envoy/envoy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ spec:
ports:
- name: http
containerPort: 9000
- name: envoy-admin
- name: envoy-stats
containerPort: 9003
terminationGracePeriodSeconds: 5
4 changes: 0 additions & 4 deletions scheduler/k8s/envoy/svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,5 @@ spec:
port: 80
targetPort: http
protocol: TCP
- name: admin
port: 9003
targetPort: envoy-admin
protocol: TCP
selector:
app: seldon-envoy
2 changes: 1 addition & 1 deletion scheduler/pkg/envoy/resources/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ func MakeHTTPListener(listenerName, address string,
// HTTP filter configuration
manager := &hcm.HttpConnectionManager{
CodecType: hcm.HttpConnectionManager_AUTO,
StatPrefix: "http",
StatPrefix: listenerName,
AlwaysSetRequestIdInResponse: false,
GenerateRequestId: &wrappers.BoolValue{Value: false},
RouteSpecifier: &hcm.HttpConnectionManager_Rds{
Expand Down

0 comments on commit 5801de6

Please sign in to comment.