<p>So I have a JCasC ConfigMap containing</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: master-jcasc
  namespace: master-namespace
data:
  entries.yaml: |
    master:
      JCasC:
        defaultConfig: false
        configScripts:
         jenkins-settings: |
           field1: ...
           field2: ...
           jobs:
             - script: &gt;
                 someJobDefenition
</code></pre>
<p>And keeping the <code>jobs</code> section here in the Jcasc file works when I <code>k apply</code>, however when I create another ConfigMap with just the <code>jobs</code> in it, they keep overwriting each other.</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: jobs-file
  namespace: master-namespace
data:
  entries.yaml: |
    master:
      JCasC:
        defaultConfig: false
        configScripts:
         jenkins-settings: |
           jobs:
             - script: &gt;
                 someJobDefenition
</code></pre>
<p>How can I seperate a ConfigMap into two? without having them overwrite each other?</p>

Chris Ragner
<p>You can use <a href="https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization/" rel="nofollow noreferrer">kustomize</a> to use a separate config file.</p>
<p>As mentioned  in this <a href="https://stackoverflow.com/questions/71008589/">stack question</a> you can use 2 yaml files and create a config map as below :</p>
<pre><code>configMapGenerator: 
- name: my-configmap 
  files:
  - datasource1.yaml 
  - datasource2.yaml
</code></pre>
<p>Where datasourse1.yaml and datasource2.yaml are files which are derived by splitting a config map into two files.</p>
<p>Here is a <a href="https://stackoverflow.com/questions/71008589/kustomize-overlays-when-using-a-shared-configmap">stack question</a> with another approach.</p>
