k9s icon indicating copy to clipboard operation
k9s copied to clipboard

Unable to list Secrets and ConfigMaps with k2d

Open deviantony opened this issue 2 years ago • 4 comments




Describe the bug Hello there! I'm working on k2d, a Kubernetes API translator: https://github.com/portainer/k2d

This projects aims to translate Kubernetes API calls to Docker resources. It works great with Kubernetes clients such as kubectl and Lens/OpenLens but for some reasons when I try to use k9s I'm getting some errors when trying to access Secrets and ConfigMaps. Other resources are displaying fine.

I'm getting the following errors when trying to access the Secret and ConfigMap resources using k9s:

For secrets:

ERR Watcher failed for v1/secrets -- no kind "SecretList" is registered for version "v1" in scheme "pkg/runtime/scheme.go:100"

For configmaps:

ERR Watcher failed for v1/configmaps -- no kind "ConfigMapList" is registered for version "v1" in scheme "pkg/runtime/scheme.go:100"

I'm trying to understand whether this is coming from k9s directly or if k2d is missing something in the response format that k9s expects. I have found a similar issue with an older version of k9s but this is not giving any information: https://github.com/derailed/k9s/issues/427

To Reproduce Steps to reproduce the behavior:

  1. Start k2d and retrieve the kubeconfig (see https://docs.k2d.io/quick-start-guide#installation and https://docs.k2d.io/quick-start-guide#usage)
  2. Start k9s
  3. Try to list Secret or ConfigMap resources
  4. See error

Expected behavior I expect to be able to list ConfigMap and Secret resources.

Screenshots If applicable, add screenshots to help explain your problem. image image

Versions (please complete the following information):

  • OS: Linux AMD64
  • K9s: v0.27.4
  • k2d: 1.0.0-beta

deviantony avatar Oct 03 '23 09:10 deviantony

Hum.. K9s uses the dynamic client api to render secret/cm/crd/... these calls come back as a table with col/row vs standard openapi json. I haven't played with k2d as of yet so not sure what could be the issue.

derailed avatar Nov 10 '23 00:11 derailed

@derailed thanks for the update, could you point me at the location in k9s code where this is done? This might help me get a better understanding of the format the k2d should return.

deviantony avatar Nov 10 '23 02:11 deviantony

@deviantony np - https://github.com/derailed/k9s/blob/master/internal/dao/table.go

derailed avatar Nov 21 '23 22:11 derailed

I'm having this same issue of not able to list configmaps with k9s verison v0.31.9 Screenshot 2024-04-17 at 10 17 48 AM

Running kubectl get cm -n returns the configmaps just fine. Just its just k9s not able to render them for some reason

Screenshot 2024-04-17 at 10 21 06 AM

arorashamik avatar Apr 17 '24 17:04 arorashamik