Using ConfigMap as environment variables in contai...
# 🌱|help-and-getting-started
b
Is there a way for a
container
type module to use a
configmap
as environment variables instead of mounting it as a volume in the container? similar to how kubernetes uses
configMapRef
?
Copy code
yaml
apiVersion: v1
kind: Pod
metadata:
  name: dapi-test-pod
spec:
  containers:
    - name: test-container
      image: registry.k8s.io/busybox
      command: [ "/bin/sh", "-c", "env" ]
      envFrom:
      - configMapRef:
          name: special-config
  restartPolicy: Never
c
Hi @bland-wolf-59979, unfortunately this is not possible with the
container
type. I would suggest you to either use the https://docs.garden.io/reference/action-types/deploy/configmap and mount it as volume in the container action (see: https://docs.garden.io/reference/action-types/deploy/container#spec.volumes-.action) or alternatively to move to a
kubernetes
action, which would give you the maximum level of granularity. I hope this helps.
8 Views