---
# Configmap
apiVersion: v1
kind: ConfigMap
metadata:
  name: botkube-configmap
  labels:
    app: botkube
data:
  config.yaml: |
    ## Resources you want to watch
    resources:
      - name: pods                # Name of the resources e.g pods, deployments, ingresses, etc. (Resource name must be in plural form)
        namespaces:               # List of namespaces, "all" will watch all the namespaces
          - all
        events:                   # List of lifecycle events you want to receive, e.g create, update, delete OR all
          - create
          - delete
      - name: services
        namespaces:
          - all
        events:
          - create
          - delete
      - name: deployments
        namespaces:
          - all
        events:
          - create
          - delete
      - name: ingresses
        namespaces:
          - all
        events:
          - create
          - delete
      - name: nodes
        namespaces:
          - all
        events:
          - create
          - delete
      - name: namespaces
        namespaces:
          - all
        events:
          - create
          - delete
      - name: persistentvolumes
        namespaces:
          - all
        events:
          - create
          - delete
      - name: persistentvolumeclaims
        namespaces:
          - all
        events:
          - create
          - delete
      - name: secrets
        namespaces:
          - all
        events:
          - create
          - delete
      - name: configmaps
        namespaces:
          - all
        events:
          - create
          - delete
      - name: daemonsets
        namespaces:
          - all
        events:
          - create
          - delete
      - name: jobs
        namespaces:
          - all
        events:
          - create
          - delete
      - name: roles
        namespaces:
          - all
        events:
          - create
          - delete
      - name: rolebindings
        namespaces:
          - all
        events:
          - create
          - delete
      - name: clusterroles
        namespaces:
          - all
        events:
          - create
          - delete
      - name: clusterrolebindings
        namespace:
          - all
        events:
          - create
          - delete
      - name: nodes
        namespaces:
          - all
        events:
          - create
          - delete
  
    # K8S error/warning events you want to receive for the configured resources
    events:
      types:
        #- normal
        - warning
  
    # Check true if you want to receive recommendations
    # about the best practices for the created resource
    recommendations: true
    
    # Channels configuration
    communications:
      # Settings for Slack
      slack:
        enabled: true
        channel: 'latch'
        token: 'Z286IGV4dHJhY3RpbmcgZ29sYW5nLm9yZy94L3N5cyB2MC4wLjAtMjAxOTA2MjEyMDM4MTgtZDQzMjQ5MWI5MTM4Cg=='

      # Settings for Mattermost
      mattermost:
        enabled: false
        url: 'MATTERMOST_SERVER_URL'                # URL where Mattermost is running. e.g https://example.com:9243
        token: 'MATTERMOST_TOKEN'                   # Personal Access token generated by BotKube user
        team: 'MATTERMOST_TEAM'                     # Mattermost Team to configure with BotKube
        channel: 'MATTERMOST_CHANNEL'               # Mattermost Channel for receiving BotKube alerts

      # Settings for ELS
      elasticsearch:
        enable: false
        server: 'ELASTICSEARCH_ADDRESS'              # e.g https://example.com:9243
        username: 'ELASTICSEARCH_USERNAME'
        password: 'ELASTICSEARCH_PASSWORD'
        # ELS index settings
        index:
          name: botkube
          type: botkube-event
          shards: 1
          replicas: 0
  
    # Setting to support multiple clusters
    settings:
      # Cluster name to differentiate incoming messages
      clustername: 'latch'
      # Set false to disable kubectl commands execution
      allowkubectl: true
