rancher / rio

Application Deployment Engine for Kubernetes
https://rio.io
Apache License 2.0
2.27k stars 228 forks source link

ConfigMap as container environment variables #1039

Open boredland opened 4 years ago

boredland commented 4 years ago

Is there a way to use configMaps to configure the environment variables in a container in this style?

https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#configure-all-key-value-pairs-in-a-configmap-as-container-environment-variables

Something like in the official docs is what I search:

pods/pod-configmap-envFrom.yaml 

apiVersion: v1
kind: Pod
metadata:
  name: dapi-test-pod
spec:
  containers:
    - name: test-container
      image: k8s.gcr.io/busybox
      command: [ "/bin/sh", "-c", "env" ]
      envFrom:
      - configMapRef:
          name: special-config
  restartPolicy: Never
StrongMonkey commented 4 years ago

Check examples at here https://github.com/rancher/rio/blob/master/docs/workloads.md#examples. There are only CLI examples but syntax will be same for riofile.