Non-mesh traffic

Incoming

When mTLS is enabled, clients from outside the mesh can’t reach the applications inside the mesh. If you want to allow external clients to consume mesh services see the Permissive mTLS mode.

Without Transparent Proxying

TLS check on Envoy can be bypassed. You should take action to secure the application ports.

Outgoing

In its default setup, Kuma allows any non-mesh traffic to pass Envoy without applying any policy. For instance if a service needs to send a request to http://example.com, all requests won’t be logged even if a traffic logging is enabled in the mesh where the service is deployed. The passthrough mode is enabled by default on all the dataplane proxies in transparent mode in a Mesh. This behavior can be changed by setting the networking.outbound.passthrough in the Mesh resource. Example:

  1. apiVersion: kuma.io/v1alpha1
  2. kind: Mesh
  3. metadata:
  4. name: default
  5. spec:
  6. networking:
  7. outbound:
  8. passthrough: false
  1. type: Mesh
  2. name: default
  3. networking:
  4. outbound:
  5. passthrough: false

When networking.outbound.passthrough is false, no traffic to any non-mesh resource can leave the Mesh.

Before setting networking.outbound.passthrough to false, double-check Envoy stats that no traffic is flowing through pass_through cluster. Otherwise, you will block the traffic which may cause the instability of the system.

Policies don’t apply to non-mesh traffic

If you need to change configuration for non-mesh traffic you can use a ProxyTemplate.

Circuit Breaker

Default values:

  1. maxConnections: 1024
  2. maxPendingRequests: 1024
  3. maxRequests: 1024
  4. maxRetries: 3

Proxy Template to change the defaults:

  1. apiVersion: kuma.io/v1alpha1
  2. kind: ProxyTemplate
  3. mesh: default
  4. metadata:
  5. name: custom-template-1
  6. spec:
  7. selectors:
  8. - match:
  9. kuma.io/service: "*"
  10. conf:
  11. imports:
  12. - default-proxy
  13. modifications:
  14. - cluster:
  15. operation: patch
  16. match:
  17. name: "outbound:passthrough:ipv4"
  18. value: |
  19. circuit_breakers: {
  20. thresholds: [
  21. {
  22. max_connections: 2048,
  23. max_pending_requests: 2048,
  24. max_requests: 2048,
  25. max_retries: 4
  26. }
  27. ]
  28. }
  1. type: ProxyTemplate
  2. mesh: default
  3. name: custom-template-1
  4. selectors:
  5. - match:
  6. kuma.io/service: "*"
  7. conf:
  8. imports:
  9. - default-proxy
  10. modifications:
  11. - cluster:
  12. operation: patch
  13. match:
  14. name: "outbound:passthrough:ipv4"
  15. value: |
  16. circuit_breakers: {
  17. thresholds: [
  18. {
  19. max_connections: 2048,
  20. max_pending_requests: 2048,
  21. max_requests: 2048,
  22. max_retries: 4
  23. }
  24. ]
  25. }

Timeouts

Default values:

  1. connectTimeout: 10s
  2. tcp:
  3. idleTimeout: 1h

Proxy Template to change the defaults:

  1. apiVersion: kuma.io/v1alpha1
  2. kind: ProxyTemplate
  3. mesh: default
  4. metadata:
  5. name: custom-template-1
  6. spec:
  7. selectors:
  8. - match:
  9. kuma.io/service: "*"
  10. conf:
  11. imports:
  12. - default-proxy
  13. modifications:
  14. - cluster:
  15. operation: patch
  16. match:
  17. name: "outbound:passthrough:ipv4"
  18. value: |
  19. connect_timeout: "99s"
  20. - networkFilter:
  21. operation: patch
  22. match:
  23. name: "envoy.filters.network.tcp_proxy"
  24. listenerName: "outbound:passthrough:ipv4"
  25. value: |
  26. name: envoy.filters.network.tcp_proxy
  27. typedConfig:
  28. '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
  29. idleTimeout: "3h"
  1. type: ProxyTemplate
  2. mesh: default
  3. name: custom-template-1
  4. selectors:
  5. - match:
  6. kuma.io/service: "*"
  7. conf:
  8. imports:
  9. - default-proxy
  10. modifications:
  11. - cluster:
  12. operation: patch
  13. match:
  14. name: "outbound:passthrough:ipv4"
  15. value: |
  16. connect_timeout: "99s"
  17. - networkFilter:
  18. operation: patch
  19. match:
  20. name: "envoy.filters.network.tcp_proxy"
  21. listenerName: "outbound:passthrough:ipv4"
  22. value: |
  23. name: envoy.filters.network.tcp_proxy
  24. typedConfig:
  25. '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
  26. idleTimeout: "3h"