Skip to content

Commit 32a868e

Browse files
author
openshift-service-mesh-bot
committed
Automator: merge upstream changes to openshift-service-mesh/istio@master
* upstream/master: Bug Fix - Add Handling of `GatewayClass` to `WaypointPolicyStatusCollection` (#55667) samples: update open-telemetry (#55672) add retry backoff support in gateway (#55659) Automator: update proxy@master in istio/istio@master (#55666) fix unknown annotation sidecar.istio.io/statsCompression (#55657) sample: update metallb for kind-lb (#55653)
2 parents 9035611 + ea1c520 commit 32a868e

File tree

14 files changed

+188
-26
lines changed

14 files changed

+188
-26
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ require (
9494
gopkg.in/yaml.v2 v2.4.0
9595
gopkg.in/yaml.v3 v3.0.1
9696
helm.sh/helm/v3 v3.17.1
97-
istio.io/api v1.25.0-alpha.0.0.20250320073341-81bc1902f4b3
97+
istio.io/api v1.25.0-alpha.0.0.20250321002943-e41c1d8a2a3e
9898
istio.io/client-go v1.25.0-alpha.0.0.20250320073741-e8b65a187b3a
9999
k8s.io/api v0.32.3
100100
k8s.io/apiextensions-apiserver v0.32.3

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -643,8 +643,8 @@ helm.sh/helm/v3 v3.17.1 h1:gzVoAD+qVuoJU6KDMSAeo0xRJ6N1znRxz3wyuXRmJDk=
643643
helm.sh/helm/v3 v3.17.1/go.mod h1:nvreuhuR+j78NkQcLC3TYoprCKStLyw5P4T7E5itv2w=
644644
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
645645
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
646-
istio.io/api v1.25.0-alpha.0.0.20250320073341-81bc1902f4b3 h1:xK5cnBL7JwNi2J3Ib+3mjwg58rrxV+UZZxXC6a+EbqY=
647-
istio.io/api v1.25.0-alpha.0.0.20250320073341-81bc1902f4b3/go.mod h1:QFzEXv/IT582T0FHZVp1QoolvE4ws0zz/vVO55blmlE=
646+
istio.io/api v1.25.0-alpha.0.0.20250321002943-e41c1d8a2a3e h1:DrzGSeOMnGdhY4bu8NI70NTjaMpPjQ18qC1Qf64ieDQ=
647+
istio.io/api v1.25.0-alpha.0.0.20250321002943-e41c1d8a2a3e/go.mod h1:QFzEXv/IT582T0FHZVp1QoolvE4ws0zz/vVO55blmlE=
648648
istio.io/client-go v1.25.0-alpha.0.0.20250320073741-e8b65a187b3a h1:LFB0Tn1NTjdZVG2mgAQRklVZgKmEO0ABE7wO7k8eFCg=
649649
istio.io/client-go v1.25.0-alpha.0.0.20250320073741-e8b65a187b3a/go.mod h1:pti0wgffDXhlnCKKKXnMbE1HiAHH1I/q3dxk/Mar68w=
650650
k8s.io/api v0.32.3 h1:Hw7KqxRusq+6QSplE3NYG4MBxZw1BZnq4aP4cJVINls=

istio.deps

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "PROXY_REPO_SHA",
55
"repoName": "proxy",
66
"file": "",
7-
"lastStableSHA": "dfae03070b07b43465e834c61a4642b13ba180bb"
7+
"lastStableSHA": "147cc9af7be04d55b0c9d9177c6de6bfdec9d655"
88
},
99
{
1010
"_comment": "",

pilot/pkg/config/kube/gateway/conversion.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,10 @@ func convertHTTPRoute(r k8s.HTTPRouteRule, ctx configContext,
295295
// Invalid to set this when there are no attempts
296296
vs.Retries.RetryOn = ""
297297
}
298-
// Istio does not currently implement the Backoff field due to lack of support in VirtualService
298+
if r.Retry.Backoff != nil {
299+
retrybackOff, _ := time.ParseDuration(string(*r.Retry.Backoff))
300+
vs.Retries.Backoff = durationpb.New(retrybackOff)
301+
}
299302
}
300303

301304
if r.Timeouts != nil {

pilot/pkg/config/kube/gateway/testdata/http.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ spec:
295295
port: 80
296296
retry:
297297
attempts: 3
298+
backoff: 3ms
298299
codes:
299300
- 503
300301
- 429

pilot/pkg/config/kube/gateway/testdata/http.yaml.golden

+1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ spec:
116116
name: default.http-retry-request.0
117117
retries:
118118
attempts: 3
119+
backoff: 0.003s
119120
retryOn: connect-failure,refused-stream,unavailable,cancelled,503,429
120121
route:
121122
- destination:

pilot/pkg/serviceregistry/kube/controller/ambient/ambientindex.go

+1
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ func New(options Options) Index {
221221
Waypoints,
222222
Services,
223223
ServiceEntries,
224+
GatewayClasses,
224225
Namespaces,
225226
opts,
226227
)

pilot/pkg/serviceregistry/kube/controller/ambient/authorization_test.go

+128-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ package ambient
1616

1717
import (
1818
"context"
19+
"fmt"
1920
"testing"
2021
"time"
2122

@@ -231,6 +232,9 @@ func TestWaypointPolicyStatusCollection(t *testing.T) {
231232
clientSe := kclient.New[*networkingclient.ServiceEntry](c)
232233
seCol := krt.WrapClient(clientSe, opts.WithName("seCol")...)
233234

235+
clientGwClass := kclient.New[*gtwapiv1beta1.GatewayClass](c)
236+
gwClassCol := krt.WrapClient(clientGwClass, opts.WithName("gwClassCol")...)
237+
234238
clientNs := kclient.New[*v1.Namespace](c)
235239
nsCol := krt.WrapClient(clientNs, opts.WithName("nsCol")...)
236240

@@ -261,7 +265,7 @@ func TestWaypointPolicyStatusCollection(t *testing.T) {
261265
}
262266
}, opts.WithName("waypoint")...)
263267

264-
wpsCollection := WaypointPolicyStatusCollection(authzPolCol, waypointCol, svcCol, seCol, nsCol, opts)
268+
wpsCollection := WaypointPolicyStatusCollection(authzPolCol, waypointCol, svcCol, seCol, gwClassCol, nsCol, opts)
265269
c.RunAndWait(ctx.Done())
266270

267271
_, err := clientNs.Create(&v1.Namespace{
@@ -981,6 +985,123 @@ func TestWaypointPolicyStatusCollection(t *testing.T) {
981985
},
982986
},
983987
},
988+
{
989+
testName: "single-bind-gateway-class",
990+
gatewayClasses: []gtwapiv1beta1.GatewayClass{
991+
{
992+
ObjectMeta: metav1.ObjectMeta{
993+
Name: "istio-waypoint",
994+
},
995+
Spec: gtwapiv1beta1.GatewayClassSpec{
996+
ControllerName: constants.ManagedGatewayMeshController,
997+
},
998+
},
999+
},
1000+
policy: securityclient.AuthorizationPolicy{
1001+
ObjectMeta: metav1.ObjectMeta{
1002+
Name: "single-gateway-class-pol",
1003+
Namespace: "istio-system",
1004+
Generation: 1,
1005+
},
1006+
Spec: v1beta1.AuthorizationPolicy{
1007+
TargetRefs: []*apiv1beta1.PolicyTargetReference{
1008+
{
1009+
Group: gvk.GatewayClass.Group,
1010+
Kind: gvk.GatewayClass.Kind,
1011+
Name: "istio-waypoint",
1012+
},
1013+
},
1014+
Rules: []*v1beta1.Rule{},
1015+
Action: 0,
1016+
},
1017+
},
1018+
expect: []model.PolicyBindingStatus{
1019+
{
1020+
Ancestor: "GatewayClass.gateway.networking.k8s.io:istio-system/istio-waypoint",
1021+
Status: &model.StatusMessage{
1022+
Reason: model.WaypointPolicyReasonAccepted,
1023+
Message: "bound to istio-waypoint",
1024+
},
1025+
Bound: true,
1026+
ObservedGeneration: 1,
1027+
},
1028+
},
1029+
},
1030+
{
1031+
testName: "nonexistent-gateway-class",
1032+
gatewayClasses: []gtwapiv1beta1.GatewayClass{},
1033+
policy: securityclient.AuthorizationPolicy{
1034+
ObjectMeta: metav1.ObjectMeta{
1035+
Name: "single-no-gateway-class-pol",
1036+
Namespace: "istio-system",
1037+
Generation: 1,
1038+
},
1039+
Spec: v1beta1.AuthorizationPolicy{
1040+
TargetRefs: []*apiv1beta1.PolicyTargetReference{
1041+
{
1042+
Group: gvk.GatewayClass.Group,
1043+
Kind: gvk.GatewayClass.Kind,
1044+
Name: "nonexistent-gateway-class",
1045+
},
1046+
},
1047+
Rules: []*v1beta1.Rule{},
1048+
Action: 0,
1049+
},
1050+
},
1051+
expect: []model.PolicyBindingStatus{
1052+
{
1053+
Ancestor: "GatewayClass.gateway.networking.k8s.io:istio-system/nonexistent-gateway-class",
1054+
Status: &model.StatusMessage{
1055+
Reason: model.WaypointPolicyReasonTargetNotFound,
1056+
Message: "not bound",
1057+
},
1058+
Bound: false,
1059+
ObservedGeneration: 1,
1060+
},
1061+
},
1062+
},
1063+
{
1064+
testName: "non-waypoint-gateway-class",
1065+
gatewayClasses: []gtwapiv1beta1.GatewayClass{
1066+
{
1067+
ObjectMeta: metav1.ObjectMeta{
1068+
Name: "not-for-waypoint",
1069+
},
1070+
Spec: gtwapiv1beta1.GatewayClassSpec{
1071+
ControllerName: "random-controller",
1072+
},
1073+
},
1074+
},
1075+
policy: securityclient.AuthorizationPolicy{
1076+
ObjectMeta: metav1.ObjectMeta{
1077+
Name: "non-waypoint-gateway-class-pol",
1078+
Namespace: "istio-system",
1079+
Generation: 1,
1080+
},
1081+
Spec: v1beta1.AuthorizationPolicy{
1082+
TargetRefs: []*apiv1beta1.PolicyTargetReference{
1083+
{
1084+
Group: gvk.GatewayClass.Group,
1085+
Kind: gvk.GatewayClass.Kind,
1086+
Name: "not-for-waypoint",
1087+
},
1088+
},
1089+
Rules: []*v1beta1.Rule{},
1090+
Action: 0,
1091+
},
1092+
},
1093+
expect: []model.PolicyBindingStatus{
1094+
{
1095+
Ancestor: "GatewayClass.gateway.networking.k8s.io:istio-system/not-for-waypoint",
1096+
Status: &model.StatusMessage{
1097+
Reason: model.WaypointPolicyReasonInvalid,
1098+
Message: fmt.Sprintf("GatewayClass must use controller name `%s` for waypoints", constants.ManagedGatewayMeshController),
1099+
},
1100+
Bound: false,
1101+
ObservedGeneration: 1,
1102+
},
1103+
},
1104+
},
9841105
}
9851106

9861107
// these nolint are to suppress findings regarding copying the mutex contained within our service entry proto fields
@@ -999,6 +1120,11 @@ func TestWaypointPolicyStatusCollection(t *testing.T) {
9991120
assert.NoError(t, err)
10001121
}
10011122

1123+
for _, gwClass := range tc.gatewayClasses {
1124+
_, err := clientGwClass.Create(&gwClass)
1125+
assert.NoError(t, err)
1126+
}
1127+
10021128
_, err := clientAuthzPol.Create(&tc.policy)
10031129
assert.NoError(t, err)
10041130

@@ -1017,6 +1143,7 @@ type TestWaypointPolicyStatusCollectionTestCase struct {
10171143
testName string
10181144
serviceEntries []networkingclient.ServiceEntry
10191145
services []v1.Service
1146+
gatewayClasses []gtwapiv1beta1.GatewayClass
10201147
policy securityclient.AuthorizationPolicy
10211148
expect []model.PolicyBindingStatus
10221149
}

pilot/pkg/serviceregistry/kube/controller/ambient/policies.go

+19
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ import (
2020
"strings"
2121

2222
corev1 "k8s.io/api/core/v1"
23+
"sigs.k8s.io/gateway-api/apis/v1beta1"
2324

2425
networkingclient "istio.io/client-go/pkg/apis/networking/v1"
2526
securityclient "istio.io/client-go/pkg/apis/security/v1"
2627
"istio.io/istio/pilot/pkg/model"
28+
"istio.io/istio/pkg/config/constants"
2729
"istio.io/istio/pkg/config/schema/gvk"
2830
"istio.io/istio/pkg/kube/krt"
2931
"istio.io/istio/pkg/log"
32+
"istio.io/istio/pkg/ptr"
3033
"istio.io/istio/pkg/slices"
3134
"istio.io/istio/pkg/spiffe"
3235
"istio.io/istio/pkg/workloadapi/security"
@@ -37,6 +40,7 @@ func WaypointPolicyStatusCollection(
3740
waypoints krt.Collection[Waypoint],
3841
services krt.Collection[*corev1.Service],
3942
serviceEntries krt.Collection[*networkingclient.ServiceEntry],
43+
gatewayClasses krt.Collection[*v1beta1.GatewayClass],
4044
namespaces krt.Collection[*corev1.Namespace],
4145
opts krt.OptionsBuilder,
4246
) krt.Collection[model.WaypointPolicyStatus] {
@@ -59,6 +63,21 @@ func WaypointPolicyStatusCollection(
5963
reason := "unknown"
6064
bound := false
6165
switch target.GetKind() {
66+
case gvk.GatewayClass_v1.Kind:
67+
fetchedGatewayClass := ptr.Flatten(krt.FetchOne(ctx, gatewayClasses, krt.FilterKey(target.GetName())))
68+
if fetchedGatewayClass == nil {
69+
reason = model.WaypointPolicyReasonTargetNotFound
70+
} else {
71+
// verify GatewayClass is for waypoint
72+
if fetchedGatewayClass.Spec.ControllerName != constants.ManagedGatewayMeshController {
73+
reason = model.WaypointPolicyReasonInvalid
74+
message = fmt.Sprintf("GatewayClass must use controller name `%s` for waypoints", constants.ManagedGatewayMeshController)
75+
} else {
76+
bound = true
77+
reason = model.WaypointPolicyReasonAccepted
78+
message = fmt.Sprintf("bound to %s", fetchedGatewayClass.GetName())
79+
}
80+
}
6281
case gvk.KubernetesGateway.Kind:
6382
fetchedWaypoints := krt.Fetch(ctx, waypoints, krt.FilterKey(key))
6483
if len(fetchedWaypoints) == 1 {

pkg/bootstrap/config.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ func getStatsOptions(meta *model.BootstrapNodeMetadata) []option.Instance {
301301
}
302302

303303
var compression string
304-
// TODO: move annotation to api repo
305-
if statsCompression, ok := meta.Annotations["sidecar.istio.io/statsCompression"]; ok && envoyWellKnownCompressorLibrary.Contains(statsCompression) {
304+
if statsCompression, ok := meta.Annotations[annotation.SidecarStatsCompression.Name]; ok &&
305+
envoyWellKnownCompressorLibrary.Contains(statsCompression) {
306306
compression = statsCompression
307307
}
308308

releasenotes/notes/52082.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: release-notes/v2
2+
kind: feature
3+
area: istioctl
4+
issue:
5+
- 52082
6+
releaseNotes:
7+
- |
8+
**Fixed** an issue that istioctl analyze report unknown annotation `sidecar.istio.io/statsCompression`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: release-notes/v2
2+
kind: bug-fix
3+
area: traffic-management
4+
releaseNotes:
5+
- |
6+
**Fixed** an issue where `AuthorizationPolicy`'s WaypointAccepted status condition was not being updated to reflect the resolution of a `GatewayClass` target reference.

samples/kind-lb/setupkind.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ fi
183183
# Setup cluster context
184184
kubectl cluster-info --context "kind-${CLUSTERNAME}"
185185

186-
# Setup metallb using v0.13.11
187-
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.13.11/config/manifests/metallb-native.yaml
186+
# Setup metallb using v0.14.9
187+
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.14.9/config/manifests/metallb-native.yaml
188188

189189
addrName="IPAddress"
190190
ipv4Prefix=""
@@ -223,7 +223,7 @@ function waitForPods() {
223223
ns=$1
224224
lb=$2
225225
waittime=$3
226-
# Wait for the pods to be ready in the given namespace with lable
226+
# Wait for the pods to be ready in the given namespace with label
227227
while : ; do
228228
res=$(kubectl wait --context "kind-${CLUSTERNAME}" -n "${ns}" pod \
229229
-l "${lb}" --for=condition=Ready --timeout="${waittime}s" 2>/dev/null ||true)

samples/open-telemetry/otel.yaml

+11-15
Original file line numberDiff line numberDiff line change
@@ -12,42 +12,38 @@ data:
1212
otlp:
1313
protocols:
1414
grpc:
15+
endpoint: 0.0.0.0:4317
1516
http:
17+
endpoint: 0.0.0.0:4318
1618
processors:
1719
batch:
1820
exporters:
1921
zipkin:
2022
# Export to zipkin for easy querying
2123
endpoint: http://zipkin.istio-system.svc:9411/api/v2/spans
22-
logging:
23-
loglevel: debug
24-
jaeger:
25-
endpoint: jaeger-collector.istio-system.svc.cluster.local:14250
26-
tls:
27-
insecure: true
28-
sending_queue:
29-
enabled: true
30-
retry_on_failure:
31-
enabled: true
24+
debug:
25+
verbosity: detailed
3226
extensions:
3327
health_check:
34-
port: 13133
28+
pprof:
29+
zpages:
3530
service:
3631
extensions:
3732
- health_check
33+
- pprof
34+
- zpages
3835
pipelines:
3936
logs:
4037
receivers: [otlp]
4138
processors: [batch]
42-
exporters: [logging]
39+
exporters: [debug]
4340
traces:
4441
receivers:
4542
- otlp
4643
- opencensus
4744
exporters:
4845
- zipkin
49-
- logging
50-
- jaeger
46+
- debug
5147
---
5248
apiVersion: v1
5349
kind: Service
@@ -106,7 +102,7 @@ spec:
106102
fieldRef:
107103
apiVersion: v1
108104
fieldPath: metadata.namespace
109-
image: otel/opentelemetry-collector:0.54.0
105+
image: otel/opentelemetry-collector:0.122.1
110106
imagePullPolicy: IfNotPresent
111107
name: opentelemetry-collector
112108
ports:

0 commit comments

Comments
 (0)