GithubHelp home page GithubHelp logo

gke-notifications-to-slack's Introduction

gke-notifications-to-slack

A Cloud Function that will parse the GKE cluster upgrade notifications and send them to a slack channel. Inspired by https://github.com/shipwreckdev/gke-notification-handler, Added support to retrieve secrets from the GCP secret manager and improved logging

Configurations

This cloud function gets triggered once a new gke upgrade notification message is placed in the pub/sub topic. The gke notification pub/sub topic needs to be avaiable in the same project where the GKE cluster is created.

You'll need a Slack application with an incoming webhook token that has permission to post in whichever channel you'd like to receive these notifications.

Prerequisites

Python script

  • main.py - The python script processes the event received from pub/sub topic and publishes the messages to the slack channel.

  • requirements.txt - libraries required for this python script. The requirements.txt and main.py need to be under the same directory.

The instructions listed on this page https://cloud.google.com/logging/docs/setup/python#connecting_the_library_to_python_logging is configured in the python script to capture the logs emitted by the application and send them to cloud logging.

Environment Variables

The below environment variables passed to the cloud-function

  • PROJECT_ID - GCP secret manager project id
  • SLACK_SECRET_NAME - GCP secret manager secret name
  • SLACK_NOTIFICATION_CHANNEL - Slack channel name
  • CLOUD_LOGGING_ENABLED - Set to true to capture the logs emitted by the application and send them to cloud logging

gke-notifications-to-slack's People

Contributors

chimbuchinnadurai avatar

Forkers

divyac85

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.