Skip to content

Commit 84d213d

Browse files
authored
Add new virtual service option - xff_num_trusted_hops (#185)
* add new vs option
1 parent 7d9f245 commit 84d213d

File tree

11 files changed

+178
-101
lines changed

11 files changed

+178
-101
lines changed

api/v1alpha1/virtualservice_common.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ type VirtualServiceCommonSpec struct {
2626
// UpgradeConfigs - https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto#envoy-v3-api-msg-extensions-filters-network-http-connection-manager-v3-httpconnectionmanager-upgradeconfig
2727
UpgradeConfigs []*runtime.RawExtension `json:"upgradeConfigs,omitempty"`
2828
RBAC *VirtualServiceRBACSpec `json:"rbac,omitempty"`
29+
// The number of additional ingress proxy hops from the right side of the x-forwarded-for HTTP header to trust
30+
// when determining the origin client’s IP address. The default is zero if this option is not specified.
31+
// See the documentation for x-forwarded-for for more information.
32+
// https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto
33+
XFFNumTrustedHops *uint32 `json:"xffNumTrustedHops,omitempty"`
2934
}
3035

3136
type TlsConfig struct {

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/envoy.kaasops.io_virtualservices.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,14 @@ spec:
150150
virtualHost:
151151
type: object
152152
x-kubernetes-preserve-unknown-fields: true
153+
xffNumTrustedHops:
154+
description: |-
155+
The number of additional ingress proxy hops from the right side of the x-forwarded-for HTTP header to trust
156+
when determining the origin client’s IP address. The default is zero if this option is not specified.
157+
See the documentation for x-forwarded-for for more information.
158+
https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto
159+
format: int32
160+
type: integer
153161
type: object
154162
status:
155163
description: VirtualServiceStatus defines the observed state of VirtualService

config/crd/bases/envoy.kaasops.io_virtualservicetemplates.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@ spec:
127127
virtualHost:
128128
type: object
129129
x-kubernetes-preserve-unknown-fields: true
130+
xffNumTrustedHops:
131+
description: |-
132+
The number of additional ingress proxy hops from the right side of the x-forwarded-for HTTP header to trust
133+
when determining the origin client’s IP address. The default is zero if this option is not specified.
134+
See the documentation for x-forwarded-for for more information.
135+
https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto
136+
format: int32
137+
type: integer
130138
type: object
131139
status:
132140
description: VirtualServiceTemplateStatus defines the observed state of

helm/charts/envoy-xds-controller/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: "0.73"
18+
version: "0.74"
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "v0.9.2"
24+
appVersion: "v0.10.0"
2525

2626
home: https://github.com/kaasops/envoy-xds-controller
2727
sources:

helm/charts/envoy-xds-controller/crds/envoy.kaasops.io_virtualservices.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,14 @@ spec:
150150
virtualHost:
151151
type: object
152152
x-kubernetes-preserve-unknown-fields: true
153+
xffNumTrustedHops:
154+
description: |-
155+
The number of additional ingress proxy hops from the right side of the x-forwarded-for HTTP header to trust
156+
when determining the origin client’s IP address. The default is zero if this option is not specified.
157+
See the documentation for x-forwarded-for for more information.
158+
https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto
159+
format: int32
160+
type: integer
153161
type: object
154162
status:
155163
description: VirtualServiceStatus defines the observed state of VirtualService

helm/charts/envoy-xds-controller/crds/envoy.kaasops.io_virtualservicetemplates.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@ spec:
127127
virtualHost:
128128
type: object
129129
x-kubernetes-preserve-unknown-fields: true
130+
xffNumTrustedHops:
131+
description: |-
132+
The number of additional ingress proxy hops from the right side of the x-forwarded-for HTTP header to trust
133+
when determining the origin client’s IP address. The default is zero if this option is not specified.
134+
See the documentation for x-forwarded-for for more information.
135+
https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto
136+
format: int32
137+
type: integer
130138
type: object
131139
status:
132140
description: VirtualServiceTemplateStatus defines the observed state of

0 commit comments

Comments
 (0)