2

I'm trying to mount a file using configmap during kubernetes deployment. I have my application properties as data in my configmap. I'm creating configmap using kustomize. Kustomize will help to merge two configmaps. When I build kustomize it returns configmap like

apiVersion: v1
data:
  append.properties: |
    TEST_PROPERTY_1=5
  base.properties: |
    TEST_PROPERTY_2=test
kind: ConfigMap
metadata:
  name: test-configmap

When I mount this config map it will create two different files. But I want to merge into a single file. my application server will expect a single property file. Can someone help this problem?

ITChap
  • 4,057
  • 1
  • 21
  • 46
Dinesh
  • 1,135
  • 2
  • 10
  • 15

2 Answers2

0

I'd suggest using a startup script to merge these two files into one property file when the pod startup.

Kun Li
  • 2,570
  • 10
  • 15
0

I think config mixin documentation is what you are looking for. You are probably just missing the

behavior: merge

in the configMapGenerator of your overlay.

ITChap
  • 4,057
  • 1
  • 21
  • 46