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

Add PagerDuty integration platform #1446

Merged
merged 5 commits into from
May 16, 2024
Merged

Conversation

mszostok
Copy link
Contributor

@mszostok mszostok commented May 14, 2024

Description

Changes proposed in this pull request:

  • Add PagerDuty integration platform

Testing

  1. Create cluster

  2. Install ArgoCD and create example app

  3. Create PagerDuty service

  4. Change the argocd plugin to get rid of cloud check (we need to use local values.yaml)

  5. Build plugin: PLUGIN_TARGETS='argocd' make build-plugins-single

  6. Serve plugin: make serve-local-plugins

  7. Use such configuration:

    communications:
      default-group:
        ## Settings for PagerDuty.
        pagerDuty:
          # -- If true, enables PagerDuty.
          enabled: true
          # -- The Integration Service Key
          integrationKey: 'key'
          bindings:
            # -- Notification sources configuration for the PagerDuty.
            sources:
              - k8s-err-events
              - k8s-deploy
              - argocd
    sources:
      argocd:
        displayName: argocd
        local-cloud/argocd:
          enabled: true
          config:
            log:
              level: debug
            argoCD:
              notificationsConfigMap:
                name: argocd-notifications-cm
                namespace: argocd
              uiBaseUrl: http://localhost:8080
            defaultSubscriptions:
              applications:
                - name: guestbook # your app name
                  namespace: argocd
            webhook:
              name: bk-{{ .SourceName }}
              register: true
              url: '{{ .IncomingWebhook.FullURLForSource }}'
    
          context:
            rbac:
              group:
                type: Static
                static:
                  values: [ "argocd" ]
    
      'k8s-deploy':
        displayName: "All events"
        botkube/kubernetes:
          enabled: true
          context:
            rbac:
              group:
                type: Static
                prefix: ""
                static:
                  values: [ "botkube-plugins-default" ]
            enabled: true
          config:
            namespaces:
              include:
                - ".*"
            event:
              types:
                - error
                - create
                - update
                - delete
            resources:
              - type: apps/v1/deployments
                event: # Overrides 'source'.kubernetes.event
                  types:
                    - create
                    - update
                    - delete
                    - error
                updateSetting:
                  includeDiff: true
                  fields:
                    - spec.template.spec.containers[*].image
    
    plugins:
      cacheDir: "/tmp/plugins"
      repositories:
        botkube:
          url: https://storage.googleapis.com/botkube-plugins-latest/plugins-index.yaml
        local-cloud:
          url:  http://localhost:3010/botkube.yaml
    
    settings:
      log:
        level: "debug"
        formatter: text
      kubeconfig: "/Users/mszostok/.kube/config"
      clusterName: "labs"
      upgradeNotifier: false
    
    analytics:
      disable: true
    
  8. Run Botkube. I did it locally.

Related issue(s)

@mszostok mszostok added the enhancement New feature or request label May 14, 2024
@mszostok mszostok force-pushed the pager-duty branch 2 times, most recently from 8d641cc to 1bf1987 Compare May 15, 2024 08:16
@mszostok mszostok requested a review from pkosiec May 15, 2024 13:04
@mszostok mszostok marked this pull request as ready for review May 15, 2024 13:04
@mszostok mszostok requested review from PrasadG193 and a team as code owners May 15, 2024 13:04
@@ -0,0 +1,145 @@
// Package sink. This file contains a hack functions to extract metadata from different source events to be used in
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@pkosiec pkosiec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well 👌

pkg/sink/pager_duty.go Show resolved Hide resolved
@mszostok mszostok enabled auto-merge (squash) May 16, 2024 07:55
@mszostok mszostok merged commit 1feb8a5 into kubeshop:main May 16, 2024
16 checks passed
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
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants