Skip to content

Commit

Permalink
Upgrade istio Api and migrate to v1beta1 Api version (kserve#3150)
Browse files Browse the repository at this point in the history
Signed-off-by: Sivanantham Chinnaiyan <sivanantham.chinnaiyan@ideas2it.com>
  • Loading branch information
sivanantha321 authored and spolti committed Jan 11, 2024
1 parent b9f0a7a commit 7c99ecd
Show file tree
Hide file tree
Showing 26 changed files with 1,222 additions and 560 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ venv/

# editor and IDE paraphernalia
.idea
.editorconfig
.vscode
.project
*.swp
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ QPEXT_IMG ?= qpext
CRD_OPTIONS ?= "crd:maxDescLen=0"
KSERVE_ENABLE_SELF_SIGNED_CA ?= false
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.26
ENVTEST_K8S_VERSION = 1.27
SUCCESS_200_ISVC_IMG ?= success-200-isvc
ERROR_404_ISVC_IMG ?= error-404-isvc

Expand Down
17 changes: 11 additions & 6 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package main
import (
"flag"
"os"
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"

"github.com/kserve/kserve/pkg/apis/serving/v1alpha1"
"github.com/kserve/kserve/pkg/apis/serving/v1beta1"
Expand All @@ -29,8 +30,8 @@ import (
v1beta1controller "github.com/kserve/kserve/pkg/controller/v1beta1/inferenceservice"
"github.com/kserve/kserve/pkg/webhook/admission/pod"
"github.com/kserve/kserve/pkg/webhook/admission/servingruntime"
istio_networking "istio.io/api/networking/v1alpha3"
"istio.io/client-go/pkg/apis/networking/v1alpha3"
istio_networking "istio.io/api/networking/v1beta1"
istioclientv1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/kubernetes"
Expand Down Expand Up @@ -154,8 +155,8 @@ func main() {
}
if ingressConfig.DisableIstioVirtualHost == false {
log.Info("Setting up Istio schemes")
if err := v1alpha3.AddToScheme(mgr.GetScheme()); err != nil {
log.Error(err, "unable to add Istio v1alpha3 APIs to scheme")
if err := istioclientv1beta1.AddToScheme(mgr.GetScheme()); err != nil {
log.Error(err, "unable to add Istio v1beta1 APIs to scheme")
os.Exit(1)
}
}
Expand Down Expand Up @@ -220,13 +221,17 @@ func main() {
hookServer := mgr.GetWebhookServer()

log.Info("registering webhooks to the webhook server")
hookServer.Register("/mutate-pods", &webhook.Admission{Handler: &pod.Mutator{}})
hookServer.Register("/mutate-pods", &webhook.Admission{
Handler: &pod.Mutator{Client: mgr.GetClient(), Decoder: admission.NewDecoder(mgr.GetScheme())},
})

//log.Info("registering cluster serving runtime validator webhook to the webhook server")
//hookServer.Register("/validate-serving-kserve-io-v1alpha1-clusterservingruntime", &webhook.Admission{Handler: &servingruntime.ClusterServingRuntimeValidator{}})

log.Info("registering serving runtime validator webhook to the webhook server")
hookServer.Register("/validate-serving-kserve-io-v1alpha1-servingruntime", &webhook.Admission{Handler: &servingruntime.ServingRuntimeValidator{}})
hookServer.Register("/validate-serving-kserve-io-v1alpha1-servingruntime", &webhook.Admission{
Handler: &servingruntime.ServingRuntimeValidator{Client: mgr.GetClient(), Decoder: admission.NewDecoder(mgr.GetScheme())},
})

if err = ctrl.NewWebhookManagedBy(mgr).
For(&v1alpha1.TrainedModel{}).
Expand Down
15 changes: 15 additions & 0 deletions config/crd/serving.kserve.io_clusterservingruntimes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,19 @@ spec:
format: int32
type: integer
type: object
resizePolicy:
items:
properties:
resourceName:
type: string
restartPolicy:
type: string
required:
- resourceName
- restartPolicy
type: object
type: array
x-kubernetes-list-type: atomic
resources:
properties:
claims:
Expand Down Expand Up @@ -901,6 +914,8 @@ spec:
x-kubernetes-int-or-string: true
type: object
type: object
restartPolicy:
type: string
securityContext:
properties:
allowPrivilegeEscalation:
Expand Down
15 changes: 15 additions & 0 deletions config/crd/serving.kserve.io_clusterstoragecontainers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,19 @@ spec:
format: int32
type: integer
type: object
resizePolicy:
items:
properties:
resourceName:
type: string
restartPolicy:
type: string
required:
- resourceName
- restartPolicy
type: object
type: array
x-kubernetes-list-type: atomic
resources:
properties:
claims:
Expand Down Expand Up @@ -445,6 +458,8 @@ spec:
x-kubernetes-int-or-string: true
type: object
type: object
restartPolicy:
type: string
securityContext:
properties:
allowPrivilegeEscalation:
Expand Down
Loading

0 comments on commit 7c99ecd

Please sign in to comment.