Texternetes, known more affectionately as t8s is a Twilio-based SMS controller for your k8s cluster! In addition to this, t8s helps you provision and spin up a k8s cluster with an interactive interface.
This is a guide on how to run t8s, but may be missing some parts.
- gcloud
- kubectl
- docker
- jq
- yq
- node
- npm
- ngrok
More when I think of them...
- Account on Google Cloud Platform
- Account on Azure (coming soon!)
- Twilio account and phone #
There are two main components that you need to install:
Download the t8s.sh file and give it permissions to execute: chmod +x t8s.sh.
Download the deployment.yml file.
Change a couple things:
In the deployment.yml file, change metada.name, spec.template.metadata.labels.app, and spec.template.spec.containers.name to your App Name (the name you use for deployment (from kubectl get deployment))
In the t8s.sh script, change any occurrences of <project path> to the absolute path to your deployment.yml file.
Download the Twilio/GCP sample app:
git clone https://github.com/GoogleCloudPlatform/nodejs-docs-samples
cd nodejs-docs-samples/appengine/twilio
In that directory, replace app.js with the twilio-server/app.js from this repo. Also replace package.json with twilio-server/package.json in this directory.
- Go into the directory where you downloaded the Twilio/GCP sample app (preferably, this is a different directory).
- Now start the Twilio NodeJS server:
npm install; npm start
- Open up a new terminal tab and start
ngrokwithngrok http 3000 - Put the URL that
ngrokgives you into your Twilio number's config for the Messaging Webhook URL, with/sms/receiveappended at the end. - Done
- Go to the directory with the NodeJS app you would like to deploy.
- Copy
t8s.shanddeployment.ymlto the root of that directory (where yourapp.jsis). - Run
t8s.sh initto initialize your deployment.- Follow the steps that it walks you through.
- Done
You have now finished dockerizing, provisioning, and deploying your app!
There are many commands you can run:
t8s just update hacktech-t8s hello-world-node- This will deploy a new version of your application
t8s just scale hacktech-t8s hello-world-node 7- This scales your pods to the number at the end
t8s just rollback please- This rolls back your deployment to the last stable version.
t8s init- You can init a new cluster or re-init the current one.
Additionally, you can run any kubectl commands as normal.
NOTE: if you forget any of the commands, you can run t8s help for help, or run a partial command and it will help you fill out the rest
Once you have deployed your app (using t8s init) you can run any of the other t8s just... commands by texting your Twilio phone number.
You can also run any kubectl commands via text using k <command>. For example: k get pods gets your pods.
