Automating the deployment of apps in a Kubernetes cluster?

Cluster information:

Kubernetes version: 1.16.3
Cloud being used: bare-metal
Installation method: manual
Host OS: CoreOS

Hi all,

I am still stuck on the same problem and I am hoping someone can help explain these concepts.

Let’s imagine I have two Git repos:

   |— config
   |   |— foo.conf
   |— certs
       |— foo.crt

   |— config
       |— bar.yaml

I also have a third repo which holds all my Kubernetes files which include the setup for both apps:

   |— Foo
   |   |— service.yaml
   |   |— network.yaml
   |   `— deployment.yaml
   |— Bar
       |— service.yaml
       |— network.yaml
       `— deployment.yaml

My questions are these:

  • How do you deploy to Kubernetes when your Application files (configs, certs) are in one repo and your Kubernetes configurations are in another? Part of the team want to add the config files to the app image but that seems wrong to me but I have to admit, I am unable to figure out how to do it another way.

  • I am also concerned on what work might need to be done when a config file is added to an app. I had a look at Helm and that could easily generate a new configMap but I imagine I still need to go into my deployment.yaml file and add the Volume and volumeMount. Is that correct?

  • What tools would you recommend I review to get to a point where I can make a change in Git and have it pushed to my Kubernetes cluster?

Thank you all for your time and patience with me :wink:

1 Like

For the first question, I think different repo aren’t problem. you can create configmap and secret first and then create your kubernetes deployment. As i know configuration shouldn’t be add to the app image. It should be decouple. So that you can reuse in another environment with just change configuration file.

Hi @DTher, I feel the same way as you do, Config files should not be baked into the image.

Is the idea then that a tool like Gitlab/Github, do all the work and convert the config files to configMaps, and push them to k8s? Is Github the right tool or should I be looking at other tools to deploy my changes to k8s after testing and validating code?

Thanks again for your help.