kudobuilder / kudo

Kubernetes Universal Declarative Operator (KUDO)
https://kudo.dev
Apache License 2.0
1.17k stars 103 forks source link

kubectl kudo init failed on OpenShift 4.10.13 #1807

Open dove-young opened 2 years ago

dove-young commented 2 years ago

What happened: kubectl kudo init failed

What you expected to happen:

kubectl kudo init should be successful

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8" REDHAT_BUGZILLA_PRODUCT_VERSION=8.5 REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" REDHAT_SUPPORT_PRODUCT_VERSION="8.5"

- Kernel (e.g. `uname -a`):

Linux st2.example.com 4.18.0-372.9.1.el8.x86_64 #1 SMP Fri Apr 15 22:12:19 EDT 2022 x86_64 x86_64 x86_64 GNU/Linux


- Install tools:
- Others:
dove-young commented 2 years ago

I tried the dry-run yaml one by one, and the failure is caused by apiVersion: admissionregistration.k8s.io/v1beta1

[root@st2 KUDO]# cat <<EOF | kubectl apply -f -
> apiVersion: admissionregistration.k8s.io/v1beta1
> kind: MutatingWebhookConfiguration
> metadata:
>   annotations:
>     cert-manager.io/inject-ca-from: kudo-system/kudo-webhook-server-certificate
>   creationTimestamp: null
>   name: kudo-manager-instance-admission-webhook-config
> webhooks:
> - clientConfig:
>     service:
>       name: kudo-controller-manager-service
>       namespace: kudo-system
>       path: /admit-kudo-dev-v1beta1-instance
>   failurePolicy: Fail
>   matchPolicy: Equivalent
>   name: instance-admission.kudo.dev
>   rules:
>   - apiGroups:
>     - kudo.dev
>     apiVersions:
>     - v1beta1
>     operations:
>     - CREATE
>     - UPDATE
>     resources:
>     - instances
>     scope: Namespaced
>   sideEffects: None
> EOF
I0531 01:32:21.709267 1057611 request.go:621] Throttling request took 1.180783366s, request: GET:https://api.b-10.example.com:6443/apis/lighthouse.submariner.io/v2alpha1?timeout=32s
error: unable to recognize "STDIN": no matches for kind "MutatingWebhookConfiguration" in version "admissionregistration.k8s.io/v1beta1"
dove-young commented 2 years ago

When I changed it to apiVersion: admissionregistration.k8s.io/v1, it works

[root@st2 KUDO]# cat <<EOF | kubectl apply -f -
> apiVersion: admissionregistration.k8s.io/v1
> kind: MutatingWebhookConfiguration
> metadata:
>   annotations:
>     cert-manager.io/inject-ca-from: kudo-system/kudo-webhook-server-certificate
>   creationTimestamp: null
>   name: kudo-manager-instance-admission-webhook-config
> webhooks:
> - clientConfig:
>     service:
>       name: kudo-controller-manager-service
>       namespace: kudo-system
>       path: /admit-kudo-dev-v1beta1-instance
>   failurePolicy: Fail
>   matchPolicy: Equivalent
>   name: instance-admission.kudo.dev
>   rules:
>   - apiGroups:
>     - kudo.dev
>     apiVersions:
>     - v1beta1
>     operations:
>     - CREATE
>     - UPDATE
>     resources:
>     - instances
>     scope: Namespaced
>   sideEffects: None
>   admissionReviewVersions: ["v1", "v1beta1"]
> EOF
I0531 01:43:25.570267 1060221 request.go:621] Throttling request took 1.181808496s, request: GET:https://api.b-10.example.com:6443/apis/view.open-cluster-management.io/v1beta1?timeout=32s
mutatingwebhookconfiguration.admissionregistration.k8s.io/kudo-manager-instance-admission-webhook-config created
[root@st2 KUDO]#