Skip to content

Commit 9f8c1c4

Browse files
committedOct 29, 2023
Adding files related to argo-workflows getting-started session
1 parent f5689b6 commit 9f8c1c4

File tree

3 files changed

+77
-0
lines changed

3 files changed

+77
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
### Installing Argo-Workflows Helm Chart
2+
### Please Note that before installing Argo-workflows, you must have nginx-ingress-controller installed on the cluster
3+
### Also make sure to add the host used in the ingress to the /etc/hosts file
4+
5+
### Install Argo-Workflows Helm Chart as following:
6+
kubectl create ns argo
7+
helm repo add argo https://argoproj.github.io/argo-helm
8+
helm install <<NAME>> argo/argo-cd -n argocd -f values.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
server:
2+
extraArgs:
3+
- --auth-mode=server ## The argo-server (and thus the UI) defaults to client authentication, which requires clients to provide their Kubernetes bearer token in order to authenticate, We switch the authentication mode to server so that we can bypass the UI login
4+
# serviceType: NodePort ## use NodePort instead of ingress if you want
5+
# serviceNodePort: 32746
6+
ingress:
7+
enabled: true
8+
ingressClassName: nginx
9+
hosts:
10+
- devops.hobbies
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: Workflow
3+
metadata:
4+
generateName: argo-wf- # Name of this Workflow
5+
spec:
6+
entrypoint: dag-template # Defines "dag-template" as the "main" template
7+
templates:
8+
- name: dag-template # Defining the "dag template" as a Template Invocator, You must use one of "dag" or "steps" as a template invocator
9+
dag:
10+
tasks:
11+
- name: A
12+
template: container-template
13+
- name: B
14+
template: script-template
15+
dependencies: [A]
16+
- name: C
17+
template: resource-template
18+
dependencies: [A]
19+
- name: D
20+
template: delay-template
21+
dependencies: [B, C]
22+
# - name: steps-template # Defining the "steps template" as a Template Invocator, You must use one of "dag" or "steps" as a template invocator
23+
# steps:
24+
# - - name: step1
25+
# template: container-template
26+
# - - name: step2a
27+
# template: script-template
28+
# - name: step2b
29+
# template: resource-template
30+
# - - name: step3
31+
# template: delay-template
32+
33+
34+
- name: container-template # Defining the "container template" as a Template Definition
35+
container:
36+
image: alpine
37+
command: ["/bin/sh", "-c"]
38+
args: ["echo Hello from container template"]
39+
- name: script-template # Defining the "script template" as a Template Definition
40+
script:
41+
image: python:alpine3.6
42+
command: [python]
43+
source: |
44+
import random
45+
i = random.randint(1, 100)
46+
print(i)
47+
- name: resource-template # Defining the "resource template" as a Template Definition
48+
resource:
49+
action: create
50+
manifest: |
51+
apiVersion: v1
52+
kind: ConfigMap
53+
metadata:
54+
generateName: argo-wf-resource-template-cm-
55+
data:
56+
created_by: argo-workflows
57+
- name: delay-template # Defining the "delay template" as a Template Definition
58+
suspend:
59+
duration: "20s"

0 commit comments

Comments
 (0)
Please sign in to comment.