Skip to content
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

Kyverno-pre is crashing with error couldn't get resource list for custom.metrics.k8s.io/v1beta1: Got empty response for: custom.metrics.k8s.io/v1beta1 #1481

Closed
abhishekghiya opened this issue Jan 18, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@abhishekghiya
Copy link

abhishekghiya commented Jan 18, 2021

Kubernetes Environemnt : D2iq Konvoy

Kubernetes version : 1.18

Kyverno version: 1.3.0-rc8

After installing the Kyverno in D2iq Konvoy Kubernetes cluster, Getting below error in kyverno-pre container logs and container went into crash back off loop state.

I0118 09:22:28.083001 1 main.go:140] "msg"="Using in-cluster configuration"
E0118 09:22:28.145511 1 memcache.go:206] couldn't get resource list for custom.metrics.k8s.io/v1beta1: Got empty response for: custom.metrics.k8s.io/v1beta1
E0118 09:22:28.146222 1 client.go:337] dclient "msg"="failed to get registered preferred resources" "error"="unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: Got empty response for: custom.metrics.k8s.io/v1beta1"
I0118 09:22:28.146264 1 client.go:286] dclient "msg"="schema not found" "kind"="ValidatingWebhookConfiguration"
E0118 09:22:28.149584 1 client.go:337] dclient "msg"="failed to get registered preferred resources" "error"="unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: Got empty response for: custom.metrics.k8s.io/v1beta1"
I0118 09:22:28.149622 1 client.go:286] dclient "msg"="schema not found" "kind"="ValidatingWebhookConfiguration"
E0118 09:22:28.151146 1 client.go:337] dclient "msg"="failed to get registered preferred resources" "error"="unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: Got empty response for: custom.metrics.k8s.io/v1beta1"
I0118 09:22:28.151175 1 client.go:286] dclient "msg"="schema not found" "kind"="MutatingWebhookConfiguration"
E0118 09:22:28.151197 1 client.go:337] dclient "msg"="failed to get registered preferred resources" "error"="unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: Got empty response for: custom.metrics.k8s.io/v1beta1"
I0118 09:22:28.151249 1 client.go:286] dclient "msg"="schema not found" "kind"="MutatingWebhookConfiguration"
E0118 09:22:28.152362 1 client.go:337] dclient "msg"="failed to get registered preferred resources" "error"="unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: Got empty response for: custom.metrics.k8s.io/v1beta1"
I0118 09:22:28.152388 1 client.go:286] dclient "msg"="schema not found" "kind"="ValidatingWebhookConfiguration"
E0118 09:22:28.152976 1 client.go:337] dclient "msg"="failed to get registered preferred resources" "error"="unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: Got empty response for: custom.metrics.k8s.io/v1beta1"
I0118 09:22:28.153003 1 client.go:286] dclient "msg"="schema not found" "kind"="ValidatingWebhookConfiguration"
E0118 09:22:28.153435 1 client.go:337] dclient "msg"="failed to get registered preferred resources" "error"="unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: Got empty response for: custom.metrics.k8s.io/v1beta1"
I0118 09:22:28.153466 1 client.go:286] dclient "msg"="schema not found" "kind"="MutatingWebhookConfiguration"
E0118 09:22:28.154244 1 client.go:337] dclient "msg"="failed to get registered preferred resources" "error"="unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: Got empty response for: custom.metrics.k8s.io/v1beta1"
I0118 09:22:28.154265 1 client.go:286] dclient "msg"="schema not found" "kind"="MutatingWebhookConfiguration"
E0118 09:22:28.154872 1 client.go:337] dclient "msg"="failed to get registered preferred resources" "error"="unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: Got empty response for: custom.metrics.k8s.io/v1beta1"
I0118 09:22:28.154892 1 client.go:286] dclient "msg"="schema not found" "kind"="Namespace"
E0118 09:22:28.155725 1 client.go:337] dclient "msg"="failed to get registered preferred resources" "error"="unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: Got empty response for: custom.metrics.k8s.io/v1beta1"
I0118 09:22:28.155753 1 client.go:286] dclient "msg"="schema not found" "kind"="ClusterPolicyReport"
E0118 09:22:28.158599 1 client.go:337] dclient "msg"="failed to get registered preferred resources" "error"="unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: Got empty response for: custom.metrics.k8s.io/v1beta1"
I0118 09:22:28.158630 1 client.go:286] dclient "msg"="schema not found" "kind"="ReportChangeRequest"
E0118 09:22:28.159276 1 client.go:337] dclient "msg"="failed to get registered preferred resources" "error"="unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: Got empty response for: custom.metrics.k8s.io/v1beta1"
I0118 09:22:28.159297 1 client.go:286] dclient "msg"="schema not found" "kind"="ClusterReportChangeRequest"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x115b2ba]

goroutine 38 [running]:
main.removeReportChangeRequest(0xc000089220, 0x13bfe9c, 0x13, 0xc00039a201, 0xc0000adef0)
/home/runner/work/kyverno/kyverno/cmd/initContainer/main.go:312 +0x13a
main.executeRequest(0xc000089220, 0x13bfe9c, 0x13, 0x13b4908, 0x0, 0x0, 0x0)
/home/runner/work/kyverno/kyverno/cmd/initContainer/main.go:128 +0x179
main.process.func1(0xc00039a300, 0xc00039a2a0, 0xc000089220, 0xc00039a240, 0x158b6a0, 0xc000384900, 0xc0001145a0)
/home/runner/work/kyverno/kyverno/cmd/initContainer/main.go:188 +0xfb
created by main.process
/home/runner/work/kyverno/kyverno/cmd/initContainer/main.go:184 +0xd7

@abhishekghiya abhishekghiya added the bug Something isn't working label Jan 18, 2021
@realshuting realshuting added this to the Kyverno Release 1.3.1 milestone Jan 18, 2021
@realshuting
Copy link
Member

@abhishekghiya Thanks for reporting the issue!

Can you upgrade to v1.3.0 and try again? It's better to uninstall Kyverno and re-install it.

We've seen the metrics server sometimes brings an issue to Kyverno, here's a reference that may help on debugging the problem.

@abhishekghiya
Copy link
Author

abhishekghiya commented Jan 23, 2021

Thanks @realshuting for quick reply

Looks like Prometheus Adaptor addon was down (pod was in pending state) in the kubernetes cluster that was causing the "custom.metrics.k8s.io/v1beta1" to return empty response. After fixing the addon kyverno came up successfully.

Our issue is resolved now but just wanted to check if kyverno has any dependeny on the availablilty of metrics api resources "custom.metrics.k8s.io/v1beta1" to come up ?

Thanks

@realshuting
Copy link
Member

realshuting commented Jan 23, 2021 via email

@abhishekghiya
Copy link
Author

abhishekghiya commented Jan 23, 2021

Thanks @realshuting for all your help and clarification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants