<p>We are trying to use Kubernetes to deploy our application, currently, we have +30 microservices and we have a files mess.</p>

<p>we tried Kustomization to add a patch and create ConfigMaps depending on the overlay, and also merge some files. But we always need to create a lot of files, 1 for each deployment/service. And at the end when we want to update something, for example, replicas, is a bit painful.</p>

<pre><code>---
apiVersion: v1
kind: Service
metadata:
  name: service1
spec:
  ports:
  - port: 3000
  selector:
    app: service1
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: service1
spec:
  selector:
    matchLabels:
      app: service1
  replicas: 1
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: service1
    spec:
      containers:
      - image: pyfarm-registry.local:5000/pyfarm/svclocation:dev
        name: service1
        envFrom:
        - configMapRef:
            name: configName
        ports:
        - containerPort: 3000
      imagePullSecrets:
      - name: local-registry
</code></pre>

<p>We have this file duplicated by +30 times, changing names, and env variables. But I am sure has to have something to parse these templates.</p>

<p>We already tried to implement Helm, but is not what we are finding.</p>

<p>Can we do for example 1 file with variables and generate the other 30 files, also we need different namespaces. Is it possible?</p>

<p>The only solution we found is using bash, but there are something more elegant?</p>

<p>As <a href="https://kubernetes.io/blog/2018/05/29/introducing-kustomize-template-free-configuration-customization-for-kubernetes/" rel="nofollow noreferrer">Kustomization</a> and <a href="https://helm.sh/docs/chart_template_guide/" rel="nofollow noreferrer">Helm template</a> (as you mentiones security/privilige reasons) are not working for you, I don't think that you can do anything else.
Only things comes to my mind except BASH script are Tempalte Designers:</p>

<p>1) <a href="http://jinja.pocoo.org/docs/2.10/" rel="nofollow noreferrer">Jinja2</a> which is template languate for Python. It is fast, widely used and secure with the optional sandboxed template execution environment.</p>

<p>2) <a href="https://mustache.github.io/mustache.5.html" rel="nofollow noreferrer">Mustache</a> is a simple web template system with implementations available for ActionScript, C++ etc. It's call "logic-less" because there are no if statements, else clauses, or for loops. </p>
