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

Config update detection for runtime config is too slow #765

Closed
pkosiec opened this issue Sep 27, 2022 · 0 comments · Fixed by #774 or kubeshop/botkube-docs#151
Closed

Config update detection for runtime config is too slow #765

pkosiec opened this issue Sep 27, 2022 · 0 comments · Fixed by #774 or kubeshop/botkube-docs#151
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@pkosiec
Copy link
Collaborator

pkosiec commented Sep 27, 2022

Overview

This is a follow-up of #704.

Currently, Config Watcher monitors config files, and once it detects changes, it exits the app. Our ConfigMaps and Secrets are mounted as files to the container (see the Deployment manifest).

However, there is one limitation - until Kubernetes mounts updated ConfigMaps, it may take a while:
https://kubernetes.io/docs/concepts/configuration/configmap/#mounted-configmaps-are-updated-automatically
How much? In my case, it could take a few seconds or even 30+s sometimes.

As we rely on the BotKube config reload for @BotKube edit SourceBindings command, this is something we should address.

We can think about reworking Config Watcher to purely support just ConfigMaps and Secrets via informers.

Also, there's also one more problem. When we restart the Pod too often, Kubernetes treats it as a crash loop even if it returns exit code 0 like us (see issue). That means, if people use the Source Bindings edit too much, Kubernetes applies the following policy:

After containers in a Pod exit, the kubelet restarts them with an exponential back-off delay (10s, 20s, 40s, …), that is capped at five minutes. Once a container has executed for 10 minutes without any problems, the kubelet resets the restart backoff timer for that container.

Unfortunately this is not configurable by us. We should workaround this.

Acceptance Criteria

  • Fix issue with crash loop
  • Use ConfigMap informers for ConfigWatcher
  • Make sure it works fast when it comes to botkube-runtime-config
  • Document new changes

Reason

Config update detection is too slow and we rely on it when doing Source Bindings edit.

@pkosiec pkosiec added the enhancement New feature or request label Sep 27, 2022
@pkosiec pkosiec self-assigned this Sep 27, 2022
@pkosiec pkosiec added this to Botkube Sep 27, 2022
@pkosiec pkosiec added this to the v0.14.0 milestone Sep 27, 2022
@pkosiec pkosiec moved this to In Progress in Botkube Sep 27, 2022
Repository owner moved this from In Progress to Done in Botkube Sep 29, 2022
@pkosiec pkosiec moved this from Done to To Review in Botkube Sep 29, 2022
@pkosiec pkosiec reopened this Sep 29, 2022
Repository owner moved this from To Review to Done in Botkube Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
1 participant