Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

Commit 5a29022

Browse files
committed
config/meshConfig: New localProxyMode field (#4686)
Add new `spec.sidecar.localProxyMode` field for user to control how mesh traffic gets proxied Signed-off-by: Keith Mattix II <[email protected]>
1 parent e9ae621 commit 5a29022

File tree

5 files changed

+34
-0
lines changed

5 files changed

+34
-0
lines changed

charts/osm/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ The following table lists the configurable parameters of the osm chart and their
138138
| osm.injector.replicaCount | int | `1` | Sidecar injector's replica count (ignored when autoscale.enable is true) |
139139
| osm.injector.resource | object | `{"limits":{"cpu":"0.5","memory":"64M"},"requests":{"cpu":"0.3","memory":"64M"}}` | Sidecar injector's container resource parameters |
140140
| osm.injector.webhookTimeoutSeconds | int | `20` | Mutating webhook timeout |
141+
| osm.localProxyMode | string | `"Localhost"` | Proxy mode for the Envoy proxy sidecar. Acceptable values are ['Localhost', 'PodIP'] |
141142
| osm.maxDataPlaneConnections | int | `0` | Sets the max data plane connections allowed for an instance of osm-controller, set to 0 to not enforce limits |
142143
| osm.meshName | string | `"osm"` | Identifier for the instance of a service mesh within a cluster |
143144
| osm.multicluster | object | `{"gatewayLogLevel":"error"}` | OSM multicluster feature configuration |

charts/osm/values.schema.json

+10
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,16 @@
701701
"error"
702702
]
703703
},
704+
"localProxyMode": {
705+
"$id": "#/properties/osm/properties/localProxyMode",
706+
"type": "string",
707+
"title": "The localProxyMode schema",
708+
"description": "Proxy mode for the Envoy proxy sidecar. Acceptable values are ['Localhost', 'PodIP'].",
709+
"enum": ["Localhost","PodIP"],
710+
"examples": [
711+
"Localhost"
712+
]
713+
},
704714
"controllerLogLevel": {
705715
"$id": "#/properties/osm/properties/controllerLogLevel",
706716
"type": "string",

charts/osm/values.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ osm:
204204
# -- Log level for the Envoy proxy sidecar. Non developers should generally never set this value. In production environments the LogLevel should be set to `error`
205205
envoyLogLevel: error
206206

207+
# -- Proxy mode for the Envoy proxy sidecar. Acceptable values are ['Localhost', 'PodIP']
208+
localProxyMode: Localhost
209+
207210
# -- Sets the max data plane connections allowed for an instance of osm-controller, set to 0 to not enforce limits
208211
maxDataPlaneConnections: 0
209212

cmd/osm-bootstrap/crds/config_meshconfig.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ spec:
116116
type: array
117117
items:
118118
type: string
119+
localProxyMode:
120+
description: Sets the destination ip address the envoy proxy will use when connecting to the backend application. Acceptable values are [Localhost, PodIP]. The default value is Localhost
121+
type: string
122+
enum:
123+
- Localhost
124+
- PodIP
125+
default: Localhost
119126
traffic:
120127
description: Configuration for traffic management
121128
type: object

pkg/apis/config/v1alpha2/mesh_config.go

+13
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ type MeshConfigSpec struct {
4040
FeatureFlags FeatureFlags `json:"featureFlags,omitempty"`
4141
}
4242

43+
// LocalProxyMode is a type alias representing the way the envoy sidecar proxies to the main application
44+
type LocalProxyMode string
45+
46+
const (
47+
// LocalProxyModeLocalhost indicates the the sidecar should communicate with the main application over localhost
48+
LocalProxyModeLocalhost LocalProxyMode = "Localhost"
49+
// LocalProxyModePodIP indicates that the sidecar should communicate with the main application via the pod ip
50+
LocalProxyModePodIP LocalProxyMode = "PodIP"
51+
)
52+
4353
// SidecarSpec is the type used to represent the specifications for the proxy sidecar.
4454
type SidecarSpec struct {
4555
// EnablePrivilegedInitContainer defines a boolean indicating whether the init container for a meshed pod should run as privileged.
@@ -77,6 +87,9 @@ type SidecarSpec struct {
7787

7888
// ECDHCurves defines a list of ECDH curves that TLS connection supports. If not specified, the curves are [X25519, P-256] for non-FIPS build and P-256 for builds using BoringSSL FIPS.
7989
ECDHCurves []string `json:"ecdhCurves,omitempty"`
90+
91+
// LocalProxyMode defines the network interface the envoy proxy will use to send traffic to the backend service application. Acceptable values are [`Localhost`, `PodIP`]. The default is `Localhost`
92+
LocalProxyMode LocalProxyMode `json:"localProxyMode,omitempty"`
8093
}
8194

8295
// TrafficSpec is the type used to represent OSM's traffic management configuration.

0 commit comments

Comments
 (0)