Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kustomize configMapGenerator

In kubernetes kustomize.yml, when I use configMapGenerator to pass in some values as env, can I access those variables in deployed springboot application, application.properties file?

kustomize.yml

...
configMapGenerator:
  - name: test-app-config
    env: ./test/applicationsetup.env
...

test/applicationsetup.env

some_key=data1
some_key1=data2

application.properties

APPLICATION_KEY=${some_key}
APPLICATION_KEY1=${some_key1}
like image 413
Sarav Avatar asked Jul 27 '26 08:07

Sarav


1 Answers

I missed to add configMapRef inside container where I was trying to access the data.

containers:
        - name: test-container
          image: <image>
          envFrom:
            - configMapRef:
                name: test-app-config
like image 171
Sarav Avatar answered Jul 30 '26 10:07

Sarav



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!