# Automating the deployment of apps in a Kubernetes cluster?

**URL:** <https://discuss.kubernetes.io/t/automating-the-deployment-of-apps-in-a-kubernetes-cluster/9326>\
**Category:** General Discussions\
**Created:** [January 16, 2020, 9:11am UTC](https://discuss.kubernetes.io/t/automating-the-deployment-of-apps-in-a-kubernetes-cluster/9326 "2020-01-16T09:11:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![edoardo](https://avatars.discourse-cdn.com/v4/letter/e/9fc29f/32.png) [@edoardo](https://discuss.kubernetes.io/u/edoardo)\
**Post date:** [January 16, 2020, 9:11am UTC](https://discuss.kubernetes.io/t/automating-the-deployment-of-apps-in-a-kubernetes-cluster/9326/1 "2020-01-16T09:11:04Z")

</div>

### 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:

```auto
Foo
   |— config
   | |— foo.conf
   |— certs
       |— foo.crt

Bar
   |— config
       |— bar.yaml

```

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

```nohighlight
Kubernetes
   |— 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 😉

---

<div class="post-metadata">

**Author:** ![DTher](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/dther/32/4415_2.png) [@DTher](https://discuss.kubernetes.io/u/DTher)\
**Post date:** [January 17, 2020, 2:08pm UTC](https://discuss.kubernetes.io/t/automating-the-deployment-of-apps-in-a-kubernetes-cluster/9326/2 "2020-01-17T14:08:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![edoardo](https://avatars.discourse-cdn.com/v4/letter/e/9fc29f/32.png) [@edoardo](https://discuss.kubernetes.io/u/edoardo)\
**Post date:** [January 18, 2020, 3:32pm UTC](https://discuss.kubernetes.io/t/automating-the-deployment-of-apps-in-a-kubernetes-cluster/9326/3 "2020-01-18T15:32:19Z")

</div>

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.
