Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I version control a kubernetes application?

I've checked out helm.sh of course, but at first glance the entire setup seems a little complicated (helm-client & tiller-server). It seems to me like I can get away by just having a helm-client in most cases.

This is what I currently do

Let's say I have a project composed of 3 services viz. postgres, express, nginx.

I create a directory called product-release that is as follows:

product-release/
    .git/
    k8s/
        postgres/
            Deployment.yaml
            Service.yaml
            Secret.mustache.yaml   # Needs to be rendered by the dev before use
        express/
            Deployment.yaml
            Service.yaml
        nginx/
            Deployment.yaml
            Service.yaml
    updates/
        0.1__0.2/
            Job.yaml    # postgres schema migration
            update.sh   # k8s API server scritps to patch/replace existing k8s objects, and runs the state change job

The usual git stuff can apply now. Everytime I make a change, I make changes to the spec files, test them, write the update scripts to help move from the last version to this current version and then commit it and tag it.

Questions:

  1. This works for me so far, but is this "the right way"?
  2. Why does helm have the tiller server? Isn't it simpler to do the templating on the client-side? Of course, if you want to separate the activity of the deployment from the knowledge of the application (like secrets) the templating would have to happen on the server, but otherwise why?
like image 660
iamnat Avatar asked Nov 24 '16 12:11

iamnat


1 Answers

Seems that https://redspread.com/ (open source) addresses this particular issue, but needs more development before it'll be production ready - at least from my team quick glance at it.

We'll stick with keeping yaml files in git together with the deployed application for now I guess.

like image 90
Jakub Głazik Avatar answered Oct 11 '22 16:10

Jakub Głazik