As the final step in this long series of blogposts we are going to deploy a simple webapp in a docker container to my personal cloud. For context here is the personal cloud setup with Traefik/Let’s Encrypt (Run a personal cloud with Traefik, Let’s encrypt and Zookeeper).
In previous blogposts I also described how I built the app (Build a PWA in docker).
App deployment The deployment runs the docker container....
In previous blogposts I explained my concept of a personal cloud for my own projects (Kubernetes for Sideprojects) and how I set it up (Run a personal cloud with Traefik, Let’s encrypt and Zookeeper). I also showed how I packaged a PWA project with docker (Build a PWA in docker).
With all those ingredients ready to go the last hurdle to solve is building the docker image automatically as well as publishing it to a private container registry so I can deploy it to my cloud from there....
In a previous blogpost I showed how I build and publish docker images on gitlab ci (Build a docker image on gitlab ci)
Make sure to read that post first for an overview and permission setup.
Update the kubernetes service with the new docker image You can easily set up a deploy step using google’s own cloud SDK docker images. Note the service account with the permissions to change the kubernetes setup is saved as “GCLOUD_K8S_KEY” variable here....
With my personal cloud setup based on kubernetes done (you can read about it here: https://heltweg.org/posts/run-a-personal-cloud-with-traefik-lets-encrypt-and-zookeeper/) it is time to actually deploy the first project into it.
The easiest application to deploy is a pure client side single page application, packaged in a docker container with a webserver like nginx to deliver the files. Packaging the application into it’s own container allows us to build a standardized container that can be run locally for testing or deployed to docker swarm and kubernetes....
Kubernetes ingress with Traefik As mentioned in my last blog post I want to focus on a provider neutral setup for my own cloud, using technology that is not bound to any cloud offering whenever possible.
While google cloud offers load balanced HTTP ingress by default it is apparently very expensive in comparison to running small nodes and I have heard only good things about using Traefik for kubernetes ingress....
Why invest in a personal cloud It has never been easier to host your personal side projects. Tools like surge.sh or Heroku make it painless to run your code. And if all else fails the old reliable “drag and drop files to a ftp” is always there - so why invest time into setting up your own personal cloud with kubernetes?
My goal for technology is typically to find a setup that gets boring to work with because I know it well and can focus on delivering new functionality....