kubeshop / botkube

An app that helps you monitor your Kubernetes cluster, debug critical deployments & gives recommendations for standard practices

Home Page:https://botkube.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong source bindings when using `existingCommunicationsSecretName`

pkosiec opened this issue · comments

Description

Source bindings are not properly set when using existingCommunicationsSecretName.

Expected behavior

When using existingCommunicationsSecretName, runtime-config doesn't have source bindings from the secret, but from default configuration instead.

Actual behavior

Steps to reproduce

Ok, I could reproduce that with existingCommunicationsSecretName :

k create secret generic --from-file /tmp/comm_config.yaml -n botkube comm-config.yaml

Where /tmp/comm_config.yaml is:

communications:
  'default-group':
    socketSlack:
      enabled: true
      channels:
        'default':
          name: 'k8s_devops_azure'
          bindings:
            sources:
              - k8s-custom
      botToken: 'xoxb-...'
      appToken: 'xapp-...'

And then I ran

helm install botkube --version=1.4.1 -f /tmp/user-values.yaml -n botkube botkube/botkube
W0922 15:54:50.459961   74347 warnings.go:70] spec.template.spec.containers[0].resources.requests[memory]: fractional byte value "142920908800m" is invalid, must be an integer
NAME: botkube
LAST DEPLOYED: Fri Sep 22 15:54:48 2023
NAMESPACE: botkube
STATUS: deployed
REVISION: 1
TEST SUITE: None

where

existingCommunicationsSecretName: "comm-config.yaml"
settings:
  clusterName: "devops.azure.akelius.com"
sources:
  k8s-custom:
    botkube/kubernetes:
      config:
        event:
          types:
            - error
        namespaces:
          include:
            - kube-infrastructure
        resources:
          - type: v1/pods
      context:
        rbac:
          group:
            prefix: ""
            static:
              values:
                - botkube-plugins-default
            type: Static
      enabled: true
    displayName: Kubernetes Errors Kube Infra

resources:
  limits:
    cpu: 100m
    memory: 512Mi
  requests:
    cpu: 10m
    memory: 136.3Mi

image

k get cm -n botkube botkube-runtime-config -o yaml
apiVersion: v1
data:
  _runtime_state.yaml: |
    actions:
      describe-created-resource:
        enabled: false
      show-logs-on-error:
        enabled: false
    communications:
      default-group:
        discord:
          channels:
            default:
              bindings:
                sources:
                - k8s-err-events
                - k8s-recommendation-events
                - k8s-err-events-with-ai-support
                - argocd