This is the @CloudNativeBot Twitter bot code :-)
It uses OpenFaas to run the several slash commands and also uses the OpenFaas Connector-SDK and Cron Connector to call the functions based on the trigger received from the Twitter stream.
Currently we have three commands available for any twitter user:
/cloudnativetv
- returns a random logo for the CNCF CloudNative TV shows/k8s-patch-schedule
- returns the patch schedule for the active release branches fro Kubernetes/kubecon-random-video
- returns a random KubeCon video
- Next Kubecon - tweet how many days you need to wait for the next KubeCon
- CFP closes - tweet how long the CFP will be open for Proposal submission (TBD)
You can deploy the Twitter stream using ko and then deploy it in your K8s cluster
To build/push and have the manifests ready to deploy you can run
$ export KO_DOCKER_REPO=ctadeu
$ ko resolve -f kubernetes/stream/ > release.yaml
$ kubectl apply -f release.yaml
To deploy each function you can use the faas-cli
command
For example to deploy the kubecon-randon-video
$ cd functions/
$ faas-cli up -f functions-stack.yml --gateway https://YOUR-OPENFAAS