dashboard: CRDs details retrieval broken
Hello,
this is a cross-posted issue in Dashboard and Cert-Manager repositories.
I’m pretty sure it’s a Cert-Manager CRD problem but I can’t be 100% sure.
[Edit]This is a dashboard problem[/Edit]
Environment
Installation method: helm chart
Kubernetes version: 1.21.2/1.21.5
Dashboard version (v1.x is not supported. Use v2.0 or later.): 2.4.0
Operating system: Linux
Node.js version ('node --version' output): not relevant
Go version ('go version' output): not relevant
Steps to reproduce
I installed the Kubernetes Dashboard via the chart (5.0.4) using the pinnedCRDs option.
pinnedCRDs:
- kind: customresourcedefinition
name: certificates.cert-manager.io
displayName: "Certificates"
namespaced: true
- kind: customresourcedefinition
name: certificaterequests.cert-manager.io
displayName: "Certificate Requests"
namespaced: true
- kind: customresourcedefinition
name: challenges.acme.cert-manager.io
displayName: "Challenges"
namespaced: true
- kind: customresourcedefinition
name: orders.acme.cert-manager.io
displayName: "Orders"
namespaced: true
and I installed Cert-Manager via the chart (v1.6.1) with the option installCRDs: true.
Observed result
I get this:
By clicking on one of the menu items, the Dashboard FE makes a rest call to the Dashboard BE:
Example:
https://dashboard.example.com/api/v1/crd/certificates.cert-manager.io
The API responds this:
the server could not find the requested resource (get certificates.cert-manager.io)
The CRDs are correctly installed:
kubectl get crd | grep cert-manager.io
certificaterequests.cert-manager.io 2021-11-19T13:24:18Z
certificates.cert-manager.io 2021-11-19T13:24:18Z
challenges.acme.cert-manager.io 2021-11-19T13:24:18Z
clusterissuers.cert-manager.io 2021-11-19T13:24:18Z
issuers.cert-manager.io 2021-11-19T13:24:18Z
orders.acme.cert-manager.io 2021-11-19T13:24:18Z
I have checked all the involved Dashboard BE code and I don’t think there is anything wrong with it.
Ref:
- https://github.com/kubernetes/dashboard/blob/master/src/app/backend/errors/errors.go#L120
- https://github.com/kubernetes/dashboard/blob/master/src/app/backend/errors/handler.go#L106
- https://github.com/kubernetes/dashboard/blob/master/src/app/backend/handler/apihandler.go#L2548-L2553
- https://github.com/kubernetes/dashboard/blob/master/src/app/backend/resource/customresourcedefinition/types/types.go#L50-L60
- https://github.com/kubernetes/dashboard/blob/master/src/app/backend/handler/apihandler.go#L649-L652
All the CRDs of the dozen charts installed in the clusters work perfectly, I tried to completely remove Cert-Manager and reinstall it from scratch and nothing changes.
We have many clusters on both AWS EKS (K8s 1.21.5) and Azure AKS (K8s 1.21.2), all aligned and basically with the same software/charts installed. The problem occurs to everyone regardless.
So I assume the problem is on the Cert-Manager side. Can you help me in any way?
Expected result
I would like to be able to have the details of the Cert-Manager CRDs in the dashboard.
Comments
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 5
- Comments: 16 (14 by maintainers)
Just for posterity’s sake, the issue here is that the dashboard is not taking account of the
served: falseentry in our CRD definitions for older API versions that we no longer serve (but do need to ensure the apiserver is aware of the version whilst it is going through the deprecation period).(ref https://github.com/jetstack/cert-manager/issues/4609#issuecomment-975440783)
Ok. it appears I must have had a temporary brain fog as the code that removes non-served versions is just bad 🙂. Big thanks to @shixuyue for noticing and working on a fix (#6840). Sorry! It will be fixed soon and a patch release will be created.
Looking into this now
Hey @pierluigilenoci - I’m not too sure what you want me to take a look at? Do you mean can I make the changes to the dashboard to fix this issue?