-
Notifications
You must be signed in to change notification settings - Fork 4
/
workflow-git-vault.yaml
47 lines (47 loc) · 1.43 KB
/
workflow-git-vault.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
name: git-vault
namespace: argo
spec:
entrypoint: git-clone
serviceAccountName: argo
arguments:
parameters:
- name: git-repo-path
value: '/src'
- name: git-repo-url
value: 'github.com/jayfray12/argo-workflow-vault-integration.git'
- name: git-secret-name
value: 'git-creds'
- name: git-repo-revision
value: 'main'
volumeClaimTemplates:
- metadata:
name: workdir
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Mi
templates:
- name: git-clone
metadata:
annotations:
vault.hashicorp.com/agent-inject: "true"
vault.hashicorp.com/role: "git-creds"
vault.hashicorp.com/secret-volume-path: "/home"
vault.hashicorp.com/agent-inject-secret-token: "secret/git-creds"
vault.hashicorp.com/agent-inject-template-token: |
{{- with secret "secret/git-creds" -}}
{{ .Data.data.token }}
{{- end }}
container:
image: alpine/git
command: [sh, -c]
args: ["git clone -b {{workflow.parameters.git-repo-revision}} https://`cat /home/token`@{{workflow.parameters.git-repo-url}} . && git status && ls && cat README.md"]
workingDir: "/gen-source{{workflow.parameters.git-repo-path}}"
volumeMounts:
- name: workdir
mountPath: /gen-source