3

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}
4

1 回答 1

3

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
于 2019-11-22T18:05:23.577 回答