I was inspired to do this project because I wanted to do something involving Kubernetes, and I wanted to make a developer's job easier. I was also tired of trying to write Dockerfiles and deployment.yaml files and so part of the interactive script helps you through that process.
What it does
You can use
t8s init to start your cluster, which is an interactive way of dockerizing your app, provisioning resources, and deploying to the cloud. In addition, it supports a few operations via text message:
t8s just update hacktech-t8s hello-world-node -- This is an example of a text you can send to deploy the latest version of your app.
t8s just scale hacktech-t8s hello-world-node 7 -- This scales the number of pods in your app to the number you enter.
t8s just rollback please -- This is an example of a text you can send if you messed up that previous deployment.
test -- This is an example of a text you can send that will test your app (in this case, simply hits the endpoint and sees what happens).
kubectl command can be run via text, by prepending the command with
k. For example:
k get pods will return all your pods.
How I built it
This is built pretty much entirely using shell scripts. I downloaded a Hello World NodeJS sample app to use as the app that we are deploying. Additionally, I am using an Express server to route the incoming texts.
Challenges I ran into
There were some really interesting challenges throughout, but I'll describe the one that gave me the most trouble. When pushing Docker images, I would tag them with versions, like v1, v2, etc. However, I soon got up pretty high (near v100) and wanted to start over. I thought I could just overwrite the old Docker images and start at v1 again, however, it appeared that either GCR (Google Container Registry) or my local machine were caching the old images and thus not overwriting them. To get past this hurdle, I changed my tagging convention to the base64 encoded time of when the image got built (this pretty much guarantees no collisions).
Accomplishments that I'm proud of
I'm really proud that I actually got this up and running with at least a few commands. I did not know a ton about Kubernetes coming into this, and so I'm proud that I made a somewhat useful app with K8s.
What I learned
I learned a lot about different
kubectl commands and how to manage clusters on my own. I also learned more about bash scripting and best practices.
What's next for texternetes
Next is to maybe keep developing it, at least to learn more and work out some of the bugs.