This is a simple Kubernetes controller built using Kubebuilder and Crossplane-Runtime.
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
kubectl
configuration to talk to your KIND cluster:export KUBECONFIG="$(kind get kubeconfig-path --name="kind")"
. - Install the Slack CRD's:
make install
. - Create
token.txt
inconfig/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 KUBECONFIG
in that session as well. - Create a
Secret
andProvider
object populated with your API token:./config/tbs/slack/provider.sh
. - Edit
config/tbs/slack/message.yaml
with your desiredmessage
andchannel
to 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
Message
object: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!
This project was bootstrapped using Kubebuilder. You can copy this project and modify it, or setup your own using the Kubebuilder book.