I found a better way to solve this. Here is my Value.yaml
test:
cors:
allowedOrigins: 'https://www.test.com'
And this is was in my microservice which I needed to override.
spring:
application:
name: something
cloud:
gateway:
globalcors:
corsConfigurations:
'[/**]':
allowedOrigins: ${GATEWAY_CORS_ALLOWED_ORIGINS:*}
And this is the value mapping in deployment yaml.
- name: GATEWAY_CORS_ALLOWED_ORIGINS
value: {{ default "*" (.Values.test.cors.allowedOrigins) | quote }}
To do this, it helped me the comments I received for this question. So Thanks for the comments.