Question: I have a spring boot app that has an application YAML file (src/main/resources/).

```
app:
  props:
    -
      key1: value
      key2: value
    - 
      key3: value
      key4: value
    -
      key5: value
      key6: value

```

I want to override the entire list of `props` in the deployment's env section (k8s). is there any way to do it in Kubernetes?

Answer: 
Spring will automatically allow you to override properties via environment variables.

So if you want to change key3, then all you need to do is to create an environment variable called: APP\_PROPS\_1\_KEY3 and you can override this value. This can be done via K8.

More here: <https://stackoverflow.com/a/58186093/5563263>
As per this [SO](https://stackoverflow.com/a/66186031/19230181), Assuming the App is deployed on Kubernetes with a Pod you can inject environment variables inside the container by either directly assigning them to the Deployment itself, or with a ConfigMap, Here in this [Tutorial](https://www.tutorialworks.com/spring-boot-kubernetes-override-properties/) you have detailed info and steps about this process.

Adding the support links:

Here is the doc for :

1. [Expose Pod Information to Containers Through Environment Variables](https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/).
2. [Configure a Pod to Use a ConfigMap](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/).
3. [Spring Boot features external configuration](https://docs.spring.io/spring-boot/docs/1.3.3.RELEASE/reference/html/boot-features-external-config.html).