Struggling with building configMap from config.properties in Kubernetes deployment

Hello, im currently transferring our whole platform to GKE, we’ve our own instance of gitlab, own deployment, already ran on kubernetes. Now im strugling with building configMap:

kind: Kustomization


configMapGenerator:
  - name: the-map
    envs:
    - config.properties```


config.properties:


```CONNECTION_STRING
AMQP_URI
BUSINESS_CLIENT_URL```




```    - for APP_TO_DEPLOY in $APPS_API_POOL_TO_DEPLOY; do mv deploy/services/${APP_TO_DEPLOY}/kustomization.yaml deploy/services/${APP_TO_DEPLOY}/kustomization-template.yaml; done
    - for APP_TO_DEPLOY in $APPS_API_POOL_TO_DEPLOY; do export APP_TO_DEPLOY=$APP_TO_DEPLOY && cat deploy/services/${APP_TO_DEPLOY}/kustomization-template.yaml | envsubst > deploy/services/${APP_TO_DEPLOY}/kustomization.yaml; done
    ```


its from our current working stack, the config.properties contains list of names of env. variables, but when it built the config map, its completely empty, still just a list of env. vars, no completion from ci/cd deploy and i explore the deploy container and all variables from ci/cd are passed to them, any suggestions? I know it’s quite short description, but thanks for any suggestion or push to the right way.

Maybe its my wrong understanding how the configMapGenerator from .properties file works and i’ve to build it by my own or it’s diff. config of the deploy worker, we used different img for deploy(bitnami/kubectl before) now im using the google img(google/cloud-sdk).

Assuming that the file config.properties is in the same directory as the kustomization.yaml, your variables always will be empty

Your config.properties need to have the values:

AMQP_URI="bla bla bla"
BUSINESS_CLIENT_URL="bla bla bla"```

Fortunately i came out with this:

CONNECTION_STRING=${CONNECTION_STRING}

and then im using the envsubst to build the config.properties in the deploy time. Still it’s miracle for me, how it works in current stack, but im not the original author of it, so…
But thanks for answering anyway!

How you are deploying the app with gitlab and kustomize to k8s?