Skip to content

Which apiVersion to use for CRDs and WebhooksConfigurations? #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bsctl opened this issue Sep 11, 2020 · 5 comments
Closed

Which apiVersion to use for CRDs and WebhooksConfigurations? #90

bsctl opened this issue Sep 11, 2020 · 5 comments
Assignees
Labels
needs-discussion No outline on the feature, discussion is welcome question Further information is requested

Comments

@bsctl
Copy link
Member

bsctl commented Sep 11, 2020

Noted the CRDs and WebhooksConfigurations are installed by make deploy script with apiVersion: v1 and templates files have apiVersion: v1beta1. When installing with Helm, we install always with apiVersion: v1 but this leads to some errors preventing the installation, see: https://github.com/clastix/capsule-helm-chart/issues/5 and https://github.com/clastix/capsule-helm-chart/issues/4.

@bsctl bsctl added bug Something isn't working blocked-needs-validation Issue need triage and validation needs-discussion No outline on the feature, discussion is welcome question Further information is requested and removed bug Something isn't working labels Sep 11, 2020
@prometherion
Copy link
Member

Which Kubernetes version are you referring to? Tested on Kubernetes 1.18 and works like a charm.

@prometherion prometherion removed the blocked-needs-validation Issue need triage and validation label Sep 11, 2020
@prometherion prometherion self-assigned this Sep 11, 2020
@bsctl
Copy link
Member Author

bsctl commented Sep 11, 2020

Kubernetes 1.18.5.

https://github.com/clastix/capsule/blob/303fc4d69ca2c8d416422154d5e4b0f27c21ee8a/config/crd/bases/capsule.clastix.io_tenants.yaml#L3

Once installed with make deploy , we have:

$ kubectl get crd tenants.capsule.clastix.io -o yaml | more
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.3.0
    ...

So I assumed v1 in the Helm chart
https://github.com/clastix/capsule-helm-chart/blob/07a759cb1e38aa24ecc8a1a4b0c90a5be8c90230/crds/tenant-crd.yaml#L1

However, trying to deploy with the Helm Chart, I get https://github.com/clastix/capsule-helm-chart/issues/4

@bsctl
Copy link
Member Author

bsctl commented Sep 16, 2020

See #98

@MaxFedotov
Copy link
Collaborator

There are some problems with updating to controller-gen.kubebuilder.io/version: v0.4.0 and apiVersion: apiextensions.k8s.io/v1/admissionregistration.k8s.io/v1

So the thing is following:

{"level":"error","ts":1600335087.011634,"logger":"controller-runtime.webhook.webhooks","msg":"unable to decode the request","webhook":"/mutate-v1-service-labels","error":"no kind \"AdmissionReview\" is registered for version \"admission.k8s.io/v1\" in scheme \"pkg/runtime/scheme.go:101\"","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\t/go/pkg/mod/github.com/go-logr/[email protected]/zapr.go:128\nsigs.k8s.io/controller-runtime/pkg/webhook/admission.(*Webhook).ServeHTTP\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/webhook/admission/http.go:79\nsigs.k8s.io/controller-runtime/pkg/webhook.instrumentedHook.func1\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/webhook/server.go:129\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2036\nnet/http.(*ServeMux).ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2416\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2831\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:1919"}
{"level":"error","ts":1600335087.2033126,"logger":"controller-runtime.webhook.webhooks","msg":"unable to decode the request","webhook":"/mutate-v1-service-labels","error":"no kind \"AdmissionReview\" is registered for version \"admission.k8s.io/v1\" in scheme \"pkg/runtime/scheme.go:101\"","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\t/go/pkg/mod/github.com/go-logr/[email protected]/zapr.go:128\nsigs.k8s.io/controller-runtime/pkg/webhook/admission.(*Webhook).ServeHTTP\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/webhook/admission/http.go:79\nsigs.k8s.io/controller-runtime/pkg/webhook.instrumentedHook.func1\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/webhook/server.go:129\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2036\nnet/http.(*ServeMux).ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2416\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2831\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:1919"}

So let's use controller-gen.kubebuilder.io/version: v0.3.0 and apiextensions.k8s.io/v1beta1/ admissionregistration.k8s.io/v1beta1 until controller-runtime will add support for newer versions

@bsctl
Copy link
Member Author

bsctl commented Sep 17, 2020

@prometherion Close in favour of #98

@bsctl bsctl closed this as completed Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-discussion No outline on the feature, discussion is welcome question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants