botkube
botkube copied to clipboard
Error Schedule Pod if kubectl enable
Description
Pod scheduling fails if kubectl is true
executors.kubectl-read-only.kubectl.enabled=true
When the value is false, the pod is in the running state.
Log Container:
- level=info msg=Closing... component="Analytics reporter"
- time="2022-09-07T22:02:30Z" level=info msg="Shutdown requested. Finishing..." component="Metrics server"
- while creating resource name normalizer: while getting resource list from K8s cluster: unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: the server is currently unable to handle the request
Expected behavior
- Schedule pod BotKube.
Actual behavior
- Pod scheduling fails.
Steps to reproduce
helm install --version v0.13.0 botkube --namespace botkube --create-namespace \
--set communications.default-group.slack.enabled=true \
--set communications.default-group.slack.channels.default.name=${SLACK_CHANNEL_NAME} \
--set communications.default-group.slack.token=${SLACK_API_BOT_TOKEN} \
--set settings.clusterName=${CLUSTER_NAME} \
--set executors.kubectl-read-only.kubectl.enabled=${ALLOW_KUBECTL} \
botkube/botkube
Hi @nuvme-devops
Thanks for reporting the issue and attached logs.
When you enable the kubectl executor. We fetch the supported groups and resources from API Server. It is an external call using client-go to API server. Based on the logs, it looks like it is a problem with the K8s itself:
unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: the server is currently unable to handle the request
Here is a great answer to a similar problem provided by Brendan Burns:
For anyone who hits this, it's caused by api-services that no longer have backends running...
In my case it was KEDA, but there are a number of different services that install aggregated API servers.
To fix it:
kubectl get apiserviceLook for ones the
AVAILABLEisFalseIf you don't need those APIs any more, delete them:
kubectl delete apiservce <service-name>
source: https://github.com/helm/helm/issues/6361#issuecomment-538220109
In the future version of BotKube we will get rid of fetching the supported groups and resources from API Server. It will be removed once the https://github.com/kubeshop/botkube/issues/685 will be implemented. For now, you need to ensure that the ServerGroupsAndResources call can be executed properly.
Thanks!
Hi @mszostok
Thanks for your return.
I'm checking about the APISERVICE.
Interestingly, on the same cluster v0.12.4 works fine.
Fixed as a part of https://github.com/kubeshop/botkube/pull/834