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

Wrong source bindings when using existingCommunicationsSecretName #1273

Closed
pkosiec opened this issue Sep 22, 2023 · 0 comments · Fixed by #1274
Closed

Wrong source bindings when using existingCommunicationsSecretName #1273

pkosiec opened this issue Sep 22, 2023 · 0 comments · Fixed by #1274
Assignees
Labels
bug Something isn't working
Milestone

Comments

@pkosiec
Copy link
Member

pkosiec commented Sep 22, 2023

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
@pkosiec pkosiec added the bug Something isn't working label Sep 22, 2023
@pkosiec pkosiec added this to the v1.5.0 milestone Sep 22, 2023
@pkosiec pkosiec changed the title Wrong configuration merging when using existingCommunicationsSecretName Wrong source bindings when using existingCommunicationsSecretName Sep 22, 2023
@pkosiec pkosiec self-assigned this Sep 22, 2023
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
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant