Giter Club home page Giter Club logo

chatbot's Introduction

Chatbot

Chatbot is a Slack bot to deploy things to Kubernetes

Requirements

This assumes you already have a kubernetes cluster. Tested with kubectl v1.11.1.

Setup

To run Chatbot on Slack, first you need to create a new bot user integration on Slack and get the token (See Slack bot users for more details).

Then you need to know the channel ids where you want to run the Chatbot. You can get them on https://slack.com/api/channels.list?token={REPLACE WITH YOUR TOKEN}

How to run

Binary

You just need to supply one environment variable, which is the slack token you've created earlier:
CHATBOT_SLACK_TOKEN=your_token CHATBOT_CLUSTER_NAME=your_net_name go run cmd/bot/main.go

How to use

After creating and setting up a bot - invite it to your desired Slack channel(s) by mentioning it.

Supported commands

  • !deploy your_cluster your_app your_container your/docker:image, currently supports deployments and statefulsets,
    where your_cluster is CHATBOT_CLUSTER_NAME,your_app is a statefulset/deployment name, your_container is a container name within a pod and image is the image you want
    to deploy. Note, that it automatically forces redeploy even if the image name is the same as the last deployed one
    but if you want to force pull - you need to specify imagePullPolicy: Always for your container in the manifest.
  • !reset your_cluster your_app, basically resets data for statefulesets, where your_cluster is CHATBOT_CLUSTER_NAME,
    your_app is your app label and it's name.
  • A link with concrete commands per artifact can be found here

chatbot's People

Contributors

ruseinov avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

chatbot's Issues

Unable to build from source

When trying to build the code it fails with

go: git.apache.org/[email protected]: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /go/pkg/mod/cache/vcs/83dba939f95a790e497d565fc4418400145a1a514f955fa052f662d56e920c3e: exit status 128:
        fatal: unable to access 'https://git.apache.org/thrift.git/': Failed to connect to git.apache.org port 443: Connection refused

Not sure if this is a temp problem or permanent. But it's not good to be unable to build the source.

Show error message when deploying invalid dockerhub tag

Both

!deploy bns-faucet bns-faucet iov1/iov-faucet:v0.6.0
!deploy bcp-faucet bcp-faucet iov1/iov-faucet:v0.6.bbbuuugg

lead to the (success?) bot messages

deployment.extensions/bns-faucet image updated
deployment.extensions/bcp-faucet image updated

However, in the second case at some point an error must have occurred somewhere during the process. It would be good if this error was reported.

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.