mirror of https://github.com/crossplane/tbs.git
|
…
|
||
|---|---|---|
| .. | ||
| api/v1 | ||
| clients | ||
| config | ||
| controllers | ||
| hack | ||
| tokentest | ||
| .gitignore | ||
| Dockerfile | ||
| Makefile | ||
| PROJECT | ||
| README.md | ||
| go.mod | ||
| go.sum | ||
| main.go | ||
README.md
Slack Message Kubernetes Controller
This is a simple Kubernetes controller built using Kubebuilder and Crossplane-Runtime.
Running Locally
Execute the following steps to run the Slack controller locally on a KIND cluster:
- Make sure you have installed KIND.
- Create a new cluster:
kind create cluster. - Set your
kubectlconfiguration to talk to your KIND cluster:export KUBECONFIG="$(kind get kubeconfig-path --name="kind")". - Install the Slack CRD's:
make install. - Create
token.txtinconfig/tbs/slack. - Go to https://api.slack.com/custom-integrations/legacy-tokens and create an API token for your chosen Workspace.
- Paste the API token into
token.txt. - Start the Slack controller:
make run. This will run in the foreground, so you may want to open a new terminal window. If you do, make sure toexport KUBECONFIGin that session as well. - Create a
SecretandProviderobject populated with your API token:./config/tbs/slack/provider.sh. - Edit
config/tbs/slack/message.yamlwith your desiredmessageandchannelto post to. You can find your channel ID by navigating to the channel in your browser and it will be the last part of the URL path. - Create your
Messageobject:kubectl apply -f config/tbs/slack/message.yaml
You should see a message posted to your Slack channel, and the controller should report successful reconciliation in your logs!
Create Your Own
This project was bootstrapped using Kubebuilder. You can copy this project and modify it, or setup your own using the Kubebuilder book.