Replies: 6 comments
-
I think you could just have this is a config map? |
Beta Was this translation helpful? Give feedback.
-
Yes but a config map is namespace isolated. I run the workflows on multiple namespaces (it's a report cluster-workflow). I would like to find a "cluster-wide" place where to store the value (from any namespace). Or an environment variable set for any pod run by argo. Or any other solution I don't see. |
Beta Was this translation helpful? Give feedback.
-
Ah. So you want every pod to know it is in production or dev. An env variable would work well. This is a great idea! Would you like to raise a PR to add this feature? |
Beta Was this translation helpful? Give feedback.
-
@sarabala1979 suggests this: Use workflow defaults to set an envvar for all main pods. workflowDefaultSpec: |
spec:
podSpecPatch: |
spec:
containers:
- name: main
env:
- name: ENVIRONMENT
value: production Or something like that. |
Beta Was this translation helpful? Give feedback.
-
It looks like a very good idea but:
Here is the piece of code: I added the piece of code just below the "workflowDefaults" that was already configured:
A mini workflow to test:
|
Beta Was this translation helpful? Give feedback.
-
@alexec I'm also interested in doing something similar! ConfigMap: apiVersion: v1
data:
mykey: myval
kind: ConfigMap
metadata:
creationTimestamp: "2021-05-13T10:10:11Z"
name: test-map
namespace: data
resourceVersion: "183589566"
selfLink: /api/v1/namespaces/data/configmaps/test-map
uid: dea5b366-fc90-4f4e-bb9b-3cf1e2b7abe5 Workflow: apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: configmap-test-
spec:
entrypoint: whalesay
serviceAccountName: argo-workflow
arguments:
parameters:
- name: configmap
value:
configMapKeyRef:
name: test-map
key: mykey
templates:
- name: whalesay
container:
image: docker/whalesay
command: [cowsay]
args: ["{{workflow.parameters.configmap}}"] But this doesn't work. The template prints an empty string. I guess it's because EDIT: |
Beta Was this translation helpful? Give feedback.
-
Hi,
I have 2 argo environments : dev and prod, installed on separated clusters. I would like to get the value "PROD" or "DEV" depending on my environment as an argument parameter for one of my cluster workflow. I don't know how to do this. Where and how should I store that value? (artifact, configmap, env ...) and how can I retrieve it from a clusterWorfklow?
Thank you,
Beta Was this translation helpful? Give feedback.
All reactions