Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iov-one/chatbot
Slack Chatbot to interact with Kubernetes
https://github.com/iov-one/chatbot
Last synced: 10 days ago
JSON representation
Slack Chatbot to interact with Kubernetes
- Host: GitHub
- URL: https://github.com/iov-one/chatbot
- Owner: iov-one
- License: other
- Created: 2019-03-27T19:18:41.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-27T10:53:26.000Z (over 5 years ago)
- Last Synced: 2024-11-06T22:12:54.686Z (about 2 months ago)
- Language: Go
- Homepage:
- Size: 366 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://my.slack.com/services/new/bot) user integration on Slack and get the `token` (See [Slack bot users](https://api.slack.com/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](https://github.com/iov-one/devnet-operations/blob/master/README.md#deploying-current-artifacts-with-chatbot)