TykTechnologies / tyk-operator

Tyk Operator for Kubernetes
https://tyk.io
Mozilla Public License 2.0
197 stars 38 forks source link

feat: upgrade crds and webhooks to v1 #124

Closed asoorm closed 3 years ago

asoorm commented 3 years ago

After deploying the operator using make deploy IMG=tykio/tyk-operator:latest, then applying an API definition:

kubectl apply -f ./config/samples/httpbin.yaml

Error from server (InternalError): error when creating "./config/samples/httpbin.yaml": Internal error occurred: failed calling webhook "mapidefinition.kb.io": expected response.uid="c27dafd5-51e9-4b21-b773-9da861d0a14e", got ""

Operator logs:

2020-10-25T17:48:51.371Z        ERROR   controller-runtime.webhook.webhooks     unable to decode the request    {"webhook": "/mutate-tyk-tyk-io-v1alpha1-apidefinition", "error": "no kind \"AdmissionReview\" is registered for version \"admission.k8s.io/v1\" in scheme \"pkg/runtime/scheme.go:101\""}
github.com/go-logr/zapr.(*zapLogger).Error
        /go/pkg/mod/github.com/go-logr/zapr@v0.1.0/zapr.go:128
sigs.k8s.io/controller-runtime/pkg/webhook/admission.(*Webhook).ServeHTTP
        /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.6.0/pkg/webhook/admission/http.go:79
sigs.k8s.io/controller-runtime/pkg/webhook.instrumentedHook.func1
        /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.6.0/pkg/webhook/server.go:129
net/http.HandlerFunc.ServeHTTP
        /usr/local/go/src/net/http/server.go:2036
net/http.(*ServeMux).ServeHTTP
        /usr/local/go/src/net/http/server.go:2416
net/http.serverHandler.ServeHTTP
        /usr/local/go/src/net/http/server.go:2831
net/http.(*conn).serve
        /usr/local/go/src/net/http/server.go:1919
2020-10-25T17:48:51.372Z        DEBUG   controller-runtime.webhook.webhooks     wrote response  {"webhook": "/mutate-tyk-tyk-io-v1alpha1-apidefinition", "UID": "", "allowed": false, "result": {}, "resultError": "got runtime.Object without object metadata: &Status{ListMeta:ListMeta{SelfLink:,ResourceVersion:,Continue:,RemainingItemCount:nil,},Status:,Message:no kind \"AdmissionReview\" is registered for version \"admission.k8s.io/v1\" in scheme \"pkg/runtime/scheme.go:101\",Reason:,Details:nil,Code:400,}"}
asoorm commented 3 years ago

Cannot use CRD v1 or Webhooks v1. We will stick with v1beta1 till the underlying tooling catches up and we can work our way round breaking changes between apis.

https://github.com/operator-framework/operator-sdk/issues/3580 https://v1-16.docs.kubernetes.io/docs/setup/release/notes/ https://github.com/kubernetes-sigs/controller-runtime/issues/1161 https://github.com/kubernetes-sigs/controller-runtime/issues/1123

asoorm commented 3 years ago

Dependent on https://github.com/TykTechnologies/tyk-operator/issues/220

asoorm commented 3 years ago

Closed by https://github.com/TykTechnologies/tyk-operator/pull/316