Skip to content

Commit 5ec59e9

Browse files
toyamagu-2021yu-crocotico24
authored
feat(argo-workflows): Add support for artifactRepositoryRef (argoproj#2135)
Signed-off-by: tomoki-yamaguchi <[email protected]> Co-authored-by: Aikawa <[email protected]> Co-authored-by: Tim Collins <[email protected]>
1 parent 4f6f251 commit 5ec59e9

File tree

5 files changed

+124
-6
lines changed

5 files changed

+124
-6
lines changed

charts/argo-workflows/Chart.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ appVersion: v3.4.8
33
name: argo-workflows
44
description: A Helm chart for Argo Workflows
55
type: application
6-
version: 0.30.0
6+
version: 0.31.0
77
icon: https://argoproj.github.io/argo-workflows/assets/logo.png
88
home: https://github.com/argoproj/argo-helm
99
sources:
@@ -16,5 +16,5 @@ annotations:
1616
fingerprint: 2B8F22F57260EFA67BE1C5824B11F800CD9D2252
1717
url: https://argoproj.github.io/argo-helm/pgp_keys.asc
1818
artifacthub.io/changes: |
19-
- kind: fixed
20-
description: artifactRepository will not be configured by default
19+
- kind: added
20+
description: Add support for artifactRepositoryRef

charts/argo-workflows/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ Fields to note:
331331
| artifactRepository.azure | object | `{}` (See [values.yaml]) | Store artifact in Azure Blob Storage |
332332
| artifactRepository.gcs | object | `{}` (See [values.yaml]) | Store artifact in a GCS object store |
333333
| artifactRepository.s3 | object | See [values.yaml] | Store artifact in a S3-compliant object store |
334+
| artifactRepositoryRef | object | `{}` (See [values.yaml]) | The section of [artifact repository ref](https://argoproj.github.io/argo-workflows/artifact-repository-ref/). Each map key is the name of configmap |
334335
| customArtifactRepository | object | `{}` | The section of custom artifact repository. Utilize a custom artifact repository that is not one of the current base ones (s3, gcs, azure) |
335336
| useStaticCredentials | bool | `true` | Use static credentials for S3 (eg. when not using AWS IRSA) |
336337

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
artifactRepositoryRef:
2+
# 1st ConfigMap
3+
artifact-repositories:
4+
annotations:
5+
workflows.argoproj.io/default-artifact-repository: default-v1-s3-artifact-repository
6+
# 1st data
7+
default-v1-s3-artifact-repository:
8+
archiveLogs: true
9+
s3:
10+
bucket: my-bucket
11+
endpoint: minio:9000
12+
insecure: true
13+
accessKeySecret:
14+
name: my-minio-cred
15+
key: accesskey
16+
secretKeySecret:
17+
name: my-minio-cred
18+
key: secretkey
19+
# 2nd data
20+
oss-artifact-repository:
21+
archiveLogs: false
22+
oss:
23+
endpoint: http://oss-cn-zhangjiakou-internal.aliyuncs.com
24+
bucket: $mybucket
25+
accessKeySecret:
26+
name: $mybucket-credentials
27+
key: accessKey
28+
secretKeySecret:
29+
name: $mybucket-credentials
30+
key: secretKey
31+
# 2nd ConfigMap
32+
another-artifact-repositories:
33+
annotations:
34+
workflows.argoproj.io/default-artifact-repository: gcs
35+
gcs:
36+
archiveLogs: false
37+
bucket: my-bucket
38+
keyFormat: prefix/in/bucket/{{workflow.name}}/{{pod.name}}
39+
serviceAccountKeySecret:
40+
name: my-gcs-credentials
41+
key: serviceAccountKey
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{- range $cm_name, $cm_val := .Values.artifactRepositoryRef }}
2+
---
3+
apiVersion: v1
4+
kind: ConfigMap
5+
metadata:
6+
name: {{ $cm_name }}
7+
namespace: {{ $.Release.Namespace | quote }}
8+
labels:
9+
{{- include "argo-workflows.labels" (dict "context" $ "component" $.Values.controller.name "name" $cm_name) | nindent 4 }}
10+
{{- with $cm_val.annotations }}
11+
annotations:
12+
{{- toYaml . | nindent 4 }}
13+
{{- end }}
14+
data:
15+
{{- range $data_key, $data_val := (omit $cm_val "annotations") }}
16+
{{- $data_key | nindent 2 }}: |
17+
{{- toYaml $data_val | nindent 4 }}
18+
{{- end }}
19+
{{- end }}

charts/argo-workflows/values.yaml

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,13 @@ controller:
161161
# Only valid for 2.7+
162162
## See more: https://argoproj.github.io/argo-workflows/default-workflow-specs/
163163
workflowDefaults: {}
164-
# spec:
165-
# ttlStrategy:
166-
# secondsAfterCompletion: 84600
164+
# spec:
165+
# ttlStrategy:
166+
# secondsAfterCompletion: 84600
167+
# # Ref: https://argoproj.github.io/argo-workflows/artifact-repository-ref/
168+
# artifactRepositoryRef:
169+
# configMap: my-artifact-repository # default is "artifact-repositories"
170+
# key: v2-s3-artifact-repository # default can be set by the `workflows.argoproj.io/default-artifact-repository` annotation in config map.
167171

168172
# -- Number of workflow workers
169173
workflowWorkers: # 32
@@ -770,6 +774,59 @@ customArtifactRepository: {}
770774
# name: artifactory-creds
771775
# key: password
772776

777+
# -- The section of [artifact repository ref](https://argoproj.github.io/argo-workflows/artifact-repository-ref/).
778+
# Each map key is the name of configmap
779+
# @default -- `{}` (See [values.yaml])
780+
artifactRepositoryRef: {}
781+
# # -- 1st ConfigMap
782+
# # If you want to use this config map by default, name it "artifact-repositories".
783+
# # Otherwise, you can provide a reference to a
784+
# # different config map in `artifactRepositoryRef.configMap`.
785+
# artifact-repositories:
786+
# # -- v3.0 and after - if you want to use a specific key, put that key into this annotation.
787+
# annotations:
788+
# workflows.argoproj.io/default-artifact-repository: default-v1-s3-artifact-repository
789+
# # 1st data of configmap. See above artifactRepository or customArtifactRepository.
790+
# default-v1-s3-artifact-repository:
791+
# archiveLogs: false
792+
# s3:
793+
# bucket: my-bucket
794+
# endpoint: minio:9000
795+
# insecure: true
796+
# accessKeySecret:
797+
# name: my-minio-cred
798+
# key: accesskey
799+
# secretKeySecret:
800+
# name: my-minio-cred
801+
# key: secretkey
802+
# # 2nd data
803+
# oss-artifact-repository:
804+
# archiveLogs: false
805+
# oss:
806+
# endpoint: http://oss-cn-zhangjiakou-internal.aliyuncs.com
807+
# bucket: $mybucket
808+
# # accessKeySecret and secretKeySecret are secret selectors.
809+
# # It references the k8s secret named 'bucket-workflow-artifect-credentials'.
810+
# # This secret is expected to have have the keys 'accessKey'
811+
# # and 'secretKey', containing the base64 encoded credentials
812+
# # to the bucket.
813+
# accessKeySecret:
814+
# name: $mybucket-credentials
815+
# key: accessKey
816+
# secretKeySecret:
817+
# name: $mybucket-credentials
818+
# key: secretKey
819+
# # 2nd ConfigMap
820+
# another-artifact-repositories:
821+
# annotations:
822+
# workflows.argoproj.io/default-artifact-repository: gcs
823+
# gcs:
824+
# bucket: my-bucket
825+
# keyFormat: prefix/in/bucket/{{workflow.name}}/{{pod.name}}
826+
# serviceAccountKeySecret:
827+
# name: my-gcs-credentials
828+
# key: serviceAccountKey
829+
773830
emissary:
774831
# -- The command/args for each image on workflow, needed when the command is not specified and the emissary executor is used.
775832
## See more: https://argoproj.github.io/argo-workflows/workflow-executors/#emissary-emissary

0 commit comments

Comments
 (0)