ConfigMap

Very similarly to the PeristentVolumeClaim module, you can also mount Kubernetes ConfigMaps on container modules using the configmap module type (see here for the full reference).

Example:

kind: Module
name: my-configmap
type: configmap
data:
  config.properties: |
    some: data
    or: something
---
kind: Module
name: my-module
type: container
services:
  - name: my-service
    volumes:
      - name: my-configmap
        module: my-configmap
        containerPath: /config
    ...

This mounts all the keys in the data field on the my-configmap module under the /config directory in the container. In this case, you'll find the file /config/config.properties there, with the value above (some: data ...) as the file contents.

You can do the same for tests and tasks using the tests.volumes and tasks.volumes fields. configmap volumes can of course also be referenced in kubernetes and helm modules, since they are deployed as standard ConfigMap resources.

Take a look at the configmap module type and container module docs for more details.

Last updated