Skip to content

Commit 0a616df

Browse files
authored
Merge pull request #1602 from benoitg31/main
Migrate istio VirtualService/DestinationRule to APIversion v1beta1 (current v1alpha3)
2 parents f3be47d + 217db66 commit 0a616df

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+395
-395
lines changed

charts/loadtester/templates/istio-gw.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{- if and (.Values.istio.enabled) (.Values.istio.gateway.enabled) }}
2-
apiVersion: networking.istio.io/v1alpha3
2+
apiVersion: networking.istio.io/v1beta1
33
kind: Gateway
44
metadata:
55
name: {{ include "loadtester.fullname" . }}

charts/loadtester/templates/istio-vs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{- if .Values.istio.enabled }}
2-
apiVersion: networking.istio.io/v1alpha3
2+
apiVersion: networking.istio.io/v1beta1
33
kind: VirtualService
44
metadata:
55
name: {{ include "loadtester.fullname" . }}

docs/gitbook/faq.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ spec:
600600
For the above spec Flagger will generate the following virtual service:
601601

602602
```yaml
603-
apiVersion: networking.istio.io/v1alpha3
603+
apiVersion: networking.istio.io/v1beta1
604604
kind: VirtualService
605605
metadata:
606606
name: frontend
@@ -653,7 +653,7 @@ spec:
653653
For each destination in the virtual service a rule is generated:
654654

655655
```yaml
656-
apiVersion: networking.istio.io/v1alpha3
656+
apiVersion: networking.istio.io/v1beta1
657657
kind: DestinationRule
658658
metadata:
659659
name: frontend-primary
@@ -664,7 +664,7 @@ spec:
664664
tls:
665665
mode: DISABLE
666666
---
667-
apiVersion: networking.istio.io/v1alpha3
667+
apiVersion: networking.istio.io/v1beta1
668668
kind: DestinationRule
669669
metadata:
670670
name: frontend-canary
@@ -751,7 +751,7 @@ spec:
751751
Based on the above spec, Flagger will create the following virtual service:
752752

753753
```yaml
754-
apiVersion: networking.istio.io/v1alpha3
754+
apiVersion: networking.istio.io/v1beta1
755755
kind: VirtualService
756756
metadata:
757757
name: backend
@@ -777,7 +777,7 @@ spec:
777777
Therefore, the following virtual service forwards the traffic to `/podinfo` by the above delegate VirtualService.
778778

779779
```yaml
780-
apiVersion: networking.istio.io/v1alpha3
780+
apiVersion: networking.istio.io/v1beta1
781781
kind: VirtualService
782782
metadata:
783783
name: frontend

docs/gitbook/install/flagger-install-on-google-cloud.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ helm upgrade -i flagger-grafana flagger/grafana \
374374
Expose Grafana through the public gateway by creating a virtual service \(replace `example.com` with your domain\):
375375

376376
```yaml
377-
apiVersion: networking.istio.io/v1alpha3
377+
apiVersion: networking.istio.io/v1beta1
378378
kind: VirtualService
379379
metadata:
380380
name: grafana

hack/update-codegen.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ chmod +x ${CODEGEN_PKG}/generate-internal-groups.sh
3131

3232
${CODEGEN_PKG}/generate-groups.sh client,deepcopy,informer,lister \
3333
github.com/fluxcd/flagger/pkg/client github.com/fluxcd/flagger/pkg/apis \
34-
"flagger:v1beta1 appmesh:v1beta2 appmesh:v1beta1 istio:v1alpha3 smi:v1alpha1 smi:v1alpha2 smi:v1alpha3 gloo/gloo:v1 gloo/gateway:v1 projectcontour:v1 traefik:v1alpha1 kuma:v1alpha1 gatewayapi:v1beta1 gatewayapi:v1 keda:v1alpha1 apisix:v2" \
34+
"flagger:v1beta1 appmesh:v1beta2 appmesh:v1beta1 istio:v1beta1 smi:v1alpha1 smi:v1alpha2 smi:v1alpha3 gloo/gloo:v1 gloo/gateway:v1 projectcontour:v1 traefik:v1alpha1 kuma:v1alpha1 gatewayapi:v1beta1 gatewayapi:v1 keda:v1alpha1 apisix:v2" \
3535
--output-base "${TEMP_DIR}" \
3636
--go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt
3737

pkg/apis/flagger/v1beta1/canary.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"time"
2222

2323
"github.com/fluxcd/flagger/pkg/apis/gatewayapi/v1beta1"
24-
istiov1alpha3 "github.com/fluxcd/flagger/pkg/apis/istio/v1alpha3"
24+
istiov1beta1 "github.com/fluxcd/flagger/pkg/apis/istio/v1beta1"
2525
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2626
"k8s.io/apimachinery/pkg/util/intstr"
2727
)
@@ -173,31 +173,31 @@ type CanaryService struct {
173173

174174
// TrafficPolicy attached to the generated Istio destination rules
175175
// +optional
176-
TrafficPolicy *istiov1alpha3.TrafficPolicy `json:"trafficPolicy,omitempty"`
176+
TrafficPolicy *istiov1beta1.TrafficPolicy `json:"trafficPolicy,omitempty"`
177177

178178
// URI match conditions for the generated service
179179
// +optional
180-
Match []istiov1alpha3.HTTPMatchRequest `json:"match,omitempty"`
180+
Match []istiov1beta1.HTTPMatchRequest `json:"match,omitempty"`
181181

182182
// Rewrite HTTP URIs for the generated service
183183
// +optional
184184
Rewrite *HTTPRewrite `json:"rewrite,omitempty"`
185185

186186
// Retries policy for the generated virtual service
187187
// +optional
188-
Retries *istiov1alpha3.HTTPRetry `json:"retries,omitempty"`
188+
Retries *istiov1beta1.HTTPRetry `json:"retries,omitempty"`
189189

190190
// Headers operations for the generated Istio virtual service
191191
// +optional
192-
Headers *istiov1alpha3.Headers `json:"headers,omitempty"`
192+
Headers *istiov1beta1.Headers `json:"headers,omitempty"`
193193

194194
// Mirror specifies the destination for request mirroring.
195195
// Responses from this destination are dropped.
196196
Mirror []v1beta1.HTTPRequestMirrorFilter `json:"mirror,omitempty"`
197197

198198
// Cross-Origin Resource Sharing policy for the generated Istio virtual service
199199
// +optional
200-
CorsPolicy *istiov1alpha3.CorsPolicy `json:"corsPolicy,omitempty"`
200+
CorsPolicy *istiov1beta1.CorsPolicy `json:"corsPolicy,omitempty"`
201201

202202
// Mesh name of the generated App Mesh virtual nodes and virtual service
203203
// +optional
@@ -275,7 +275,7 @@ type CanaryAnalysis struct {
275275

276276
// A/B testing HTTP header match conditions
277277
// +optional
278-
Match []istiov1alpha3.HTTPMatchRequest `json:"match,omitempty"`
278+
Match []istiov1beta1.HTTPMatchRequest `json:"match,omitempty"`
279279

280280
// SessionAffinity represents the session affinity settings for a canary run.
281281
// +optional
@@ -516,10 +516,10 @@ func (r *HTTPRewrite) GetType() string {
516516
return string(v1beta1.FullPathHTTPPathModifier)
517517
}
518518

519-
// GetIstioRewrite returns a istiov1alpha3.HTTPRewrite object.
520-
func (s *CanaryService) GetIstioRewrite() *istiov1alpha3.HTTPRewrite {
519+
// GetIstioRewrite returns a istiov1beta1.HTTPRewrite object.
520+
func (s *CanaryService) GetIstioRewrite() *istiov1beta1.HTTPRewrite {
521521
if s.Rewrite != nil {
522-
return &istiov1alpha3.HTTPRewrite{
522+
return &istiov1beta1.HTTPRewrite{
523523
Authority: s.Rewrite.Authority,
524524
Uri: s.Rewrite.Uri,
525525
}

pkg/apis/flagger/v1beta1/zz_generated.deepcopy.go

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/istio/v1alpha3/destination_rule.go pkg/apis/istio/v1beta1/destination_rule.go

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// proto: https://github.com/istio/api/blob/master/networking/v1alpha3/destination_rule.pb.go
2-
package v1alpha3
1+
// proto: https://github.com/istio/api/blob/master/networking/v1beta1/destination_rule.pb.go
2+
package v1beta1
33

44
import (
55
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -21,7 +21,7 @@ type DestinationRule struct {
2121
// balancing pool. For example, a simple load balancing policy for the
2222
// ratings service would look as follows:
2323
//
24-
// apiVersion: networking.istio.io/v1alpha3
24+
// apiVersion: networking.istio.io/v1beta1
2525
// kind: DestinationRule
2626
// metadata:
2727
//
@@ -40,7 +40,7 @@ type DestinationRule struct {
4040
// going to a subset named testversion that is composed of endpoints (e.g.,
4141
// pods) with labels (version:v3).
4242
//
43-
// apiVersion: networking.istio.io/v1alpha3
43+
// apiVersion: networking.istio.io/v1beta1
4444
// kind: DestinationRule
4545
// metadata:
4646
//
@@ -68,7 +68,7 @@ type DestinationRule struct {
6868
// traffic to port 80, while uses a round robin load balancing setting for
6969
// traffic to the port 9080.
7070
//
71-
// apiVersion: networking.istio.io/v1alpha3
71+
// apiVersion: networking.istio.io/v1beta1
7272
// kind: DestinationRule
7373
// metadata:
7474
//
@@ -172,7 +172,7 @@ type PortTrafficPolicy struct {
172172
// subset named testversion that is composed of endpoints (e.g., pods) with
173173
// labels (version:v3).
174174
//
175-
// apiVersion: networking.istio.io/v1alpha3
175+
// apiVersion: networking.istio.io/v1beta1
176176
// kind: DestinationRule
177177
// metadata:
178178
//
@@ -218,7 +218,7 @@ type Subset struct {
218218
// For example, the following rule uses a round robin load balancing policy
219219
// for all traffic going to the ratings service.
220220
//
221-
// apiVersion: networking.istio.io/v1alpha3
221+
// apiVersion: networking.istio.io/v1beta1
222222
// kind: DestinationRule
223223
// metadata:
224224
//
@@ -235,7 +235,7 @@ type Subset struct {
235235
// hashing-based load balancer for the same ratings service using the
236236
// the User cookie as the hash key.
237237
//
238-
// apiVersion: networking.istio.io/v1alpha3
238+
// apiVersion: networking.istio.io/v1beta1
239239
// kind: DestinationRule
240240
// metadata:
241241
// name: bookinfo-ratings
@@ -486,7 +486,7 @@ type HTTPCookie struct {
486486
// For example, the following rule sets a limit of 100 connections to redis
487487
// service called myredissrv with a connect timeout of 30ms
488488
//
489-
// apiVersion: networking.istio.io/v1alpha3
489+
// apiVersion: networking.istio.io/v1beta1
490490
// kind: DestinationRule
491491
// metadata:
492492
//
@@ -563,7 +563,7 @@ type HTTPSettings struct {
563563
// scanned every 5 mins, such that any host that fails 7 consecutive times
564564
// with 5XX error code will be ejected for 15 minutes.
565565
//
566-
// apiVersion: networking.istio.io/v1alpha3
566+
// apiVersion: networking.istio.io/v1beta1
567567
// kind: DestinationRule
568568
// metadata:
569569
//
@@ -652,7 +652,7 @@ type OutlierDetection struct {
652652
// For example, the following rule configures a client to use mutual TLS
653653
// for connections to upstream database cluster.
654654
//
655-
// apiVersion: networking.istio.io/v1alpha3
655+
// apiVersion: networking.istio.io/v1beta1
656656
// kind: DestinationRule
657657
// metadata:
658658
//
@@ -671,7 +671,7 @@ type OutlierDetection struct {
671671
// The following rule configures a client to use TLS when talking to a
672672
// foreign service whose domain matches *.foo.com.
673673
//
674-
// apiVersion: networking.istio.io/v1alpha3
674+
// apiVersion: networking.istio.io/v1beta1
675675
// kind: DestinationRule
676676
// metadata:
677677
//
@@ -687,7 +687,7 @@ type OutlierDetection struct {
687687
// The following rule configures a client to use Istio mutual TLS when talking
688688
// to rating services.
689689
//
690-
// apiVersion: networking.istio.io/v1alpha3
690+
// apiVersion: networking.istio.io/v1beta1
691691
// kind: DestinationRule
692692
// metadata:
693693
//

pkg/apis/istio/v1alpha3/doc.go pkg/apis/istio/v1beta1/doc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
// +k8s:deepcopy-gen=package
66
// +groupName=networking.istio.io
7-
package v1alpha3
7+
package v1beta1

pkg/apis/istio/v1alpha3/register.go pkg/apis/istio/v1beta1/register.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package v1alpha3
1+
package v1beta1
22

33
import (
44
"github.com/fluxcd/flagger/pkg/apis/istio"
@@ -8,7 +8,7 @@ import (
88
)
99

1010
// SchemeGroupVersion is group version used to register these objects
11-
var SchemeGroupVersion = schema.GroupVersion{Group: istio.GroupName, Version: "v1alpha3"}
11+
var SchemeGroupVersion = schema.GroupVersion{Group: istio.GroupName, Version: "v1beta1"}
1212

1313
// Kind takes an unqualified kind and returns back a Group qualified GroupKind
1414
func Kind(kind string) schema.GroupKind {

0 commit comments

Comments
 (0)