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

Error Schedule Pod if kubectl enable #726

Closed
nuvme-devops opened this issue Sep 7, 2022 · 3 comments
Closed

Error Schedule Pod if kubectl enable #726

nuvme-devops opened this issue Sep 7, 2022 · 3 comments
Labels
needs-more-info Further information is needed

Comments

@nuvme-devops
Copy link

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

@nuvme-devops nuvme-devops added the bug Something isn't working label Sep 7, 2022
@mszostok
Copy link
Contributor

mszostok commented Sep 8, 2022

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 apiservice

Look for ones the AVAILABLE is False

If you don't need those APIs any more, delete them:

kubectl delete apiservce <service-name>

source: helm/helm#6361 (comment)

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 #685 will be implemented. For now, you need to ensure that the ServerGroupsAndResources call can be executed properly.

Thanks!

@mszostok mszostok added needs-more-info Further information is needed and removed bug Something isn't working labels Sep 8, 2022
@nuvme-devops
Copy link
Author

Hi @mszostok

Thanks for your return.

I'm checking about the APISERVICE.

Interestingly, on the same cluster v0.12.4 works fine.

@mszostok
Copy link
Contributor

Fixed as a part of #834

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-more-info Further information is needed
Projects
None yet
Development

No branches or pull requests

2 participants