From b36971999947f53f5c400961f22f6636ba00c3a0 Mon Sep 17 00:00:00 2001 From: Martin Weindel Date: Wed, 22 May 2024 12:41:42 +0200 Subject: [PATCH] support Istio apiVersion networking.istio.io/v1 --- README.md | 4 +- cmd/cert-controller-manager/main.go | 2 + docs/usage/tutorials/istio-gateways.md | 8 +- examples/40-gateway-istio.yaml | 2 +- go.mod | 45 +++--- go.sum | 98 ++++++------- .../source/gateways/istio/handler.go | 14 ++ .../source/gateways/istio/handler_test.go | 132 +++++++++--------- .../istio/virtualservicesReconciler.go | 7 + 9 files changed, 160 insertions(+), 152 deletions(-) diff --git a/README.md b/README.md index 000d4687..78a6618b 100644 --- a/README.md +++ b/README.md @@ -676,13 +676,13 @@ certificates are managed automatically for the hosts. ### Istio gateways -For Istio, gateways for API versions `networking.istio.io/v1beta1` and `networking.istio.io/v1alpha3` are supported. +For Istio, gateways for API versions `networking.istio.io/v1`, `networking.istio.io/v1beta1`, and `networking.istio.io/v1alpha3` are supported. To enable automatic management of `Certificate` resources, annotate the Istio `Gateway` resource with `cert.gardener.cloud/purpose=managed`. The domain names are extracted from the `spec.servers.hosts` field and from the field `spec.hosts` of related `VirtualService` resources. ```yaml -apiVersion: networking.istio.io/v1beta1 +apiVersion: networking.istio.io/v1 kind: Gateway metadata: annotations: diff --git a/cmd/cert-controller-manager/main.go b/cmd/cert-controller-manager/main.go index ca4f7842..47a87abd 100644 --- a/cmd/cert-controller-manager/main.go +++ b/cmd/cert-controller-manager/main.go @@ -11,6 +11,7 @@ import ( "os" "github.com/gardener/controller-manager-library/pkg/utils" + istionetworkingv1 "istio.io/client-go/pkg/apis/networking/v1" istionetworkingv1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" istionetworkingv1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" coordinationv1 "k8s.io/api/coordination/v1" @@ -73,6 +74,7 @@ func init() { utils.Must(resources.Register(coordinationv1.SchemeBuilder)) utils.Must(resources.Register(istionetworkingv1alpha3.SchemeBuilder)) utils.Must(resources.Register(istionetworkingv1beta1.SchemeBuilder)) + utils.Must(resources.Register(istionetworkingv1.SchemeBuilder)) utils.Must(resources.Register(gatewayapisv1alpha2.SchemeBuilder)) utils.Must(resources.Register(gatewayapisv1beta1.SchemeBuilder)) utils.Must(resources.Register(gatewayapisv1.SchemeBuilder)) diff --git a/docs/usage/tutorials/istio-gateways.md b/docs/usage/tutorials/istio-gateways.md index a5353ce2..960a9494 100644 --- a/docs/usage/tutorials/istio-gateways.md +++ b/docs/usage/tutorials/istio-gateways.md @@ -46,7 +46,7 @@ $ kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.20/sa #### Create an Istio Gateway: ```bash $ cat <