---
# System prepended metadata

title: cluster-role-binding.yaml

---

# cluster-role-binding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: argooperator-clusterrolebinding
subjects:
- kind: ServiceAccount
  name: argooperator
  namespace: argo
roleRef:
  kind: ClusterRole
  name: argooperator-clusterrole
  apiGroup: rbac.authorization.k8s.io




# cluster-role.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: argooperator-clusterrole
rules:
- apiGroups:
  - argoproj.io
  resources:
  - clusterworkflowtemplates
  verbs:
  - get
  - list
  - watch
  - create
  - update
  - patch
  - delete
  - deletecollection



# role.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: argooperatorrole
  namespace: argo
rules:
  - apiGroups:
      - argoproj.io
    resources:
      - workflows
      - workflows/finalizers
      - workflows/status
    verbs:
      - get
      - list
      - watch
      - create
      - update
      - patch
      - delete
      - deletecollection






# rolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: argooperatorrolebinding
  namespace: argo
subjects:
- kind: ServiceAccount
  name: argooperator
  namespace: argo
roleRef:
  kind: Role
  name: argooperatorrole
  apiGroup: rbac.authorization.k8s.io



# secret.yaml
apiVersion: v1
kind: Secret
metadata:
  name: argooperator-sa
  namespace: argo
  annotations:
    kubernetes.io/service-account.name: argooperator
type: kubernetes.io/service-account-token




# service-account.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: argooperator
  namespace: argo
secrets:
- name: argooperator-sa




# DAG:


apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: dag-test-cs598-
spec:
  entrypoint: diamond
  templates:
  - name: diamond
    dag:
      tasks:
      - name: task1
        template: sort
      - name: task2 
        template: sort
        depends: "task1"
      - name: task3
        template: loop
        depends: "task1"
      - name: task4
        template: sort
        depends: "task1"
      - name: task5
        template: loop
        depends: "task1"
      - name: task6
        template: nestloop
        depends: "task1"
      - name: task7
        template: sort
        depends: "task3"
      - name: task8
        template: nestloop
        depends: "task2 && task4 && task6"
      - name: task9
        template: nestloop
        depends: "task2 && task4 && task5"
      - name: task10
        template: nestloop
        depends: "task7 && task8 && task9"
  - name: loop
    container:
      image: hbista2/loop:v2
  - name: sort
    container:
      image: hbista2/sort:v2
  - name: nestloop
    container:
      image: hbista2/nestloop:v2



# DAG FFT:
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: dag-test-cs598-fft-
spec:
  entrypoint: diamond
  templates:
  - name: diamond
    dag:
      tasks:
      - name: task1
        template: sort
      - name: task2 
        template: sort
        depends: "task1"
      - name: task3
        template: loop
        depends: "task1"
      - name: task4
        template: sort
        depends: "task2"
      - name: task5
        template: loop
        depends: "task2"
      - name: task6
        template: loop
        depends: "task3"
      - name: task7
        template: loop
        depends: "task3"
      - name: task8
        template: nestloop
        depends: "task4 && task5"
      - name: task9
        template: loop
        depends: "task4 && task5"
      - name: task10
        template: sort
        depends: "task6 && task7"
      - name: task11
        template: nestloop
        depends: "task6 && task7"
      - name: task12
        template: sort
        depends: "task8 && task10"
      - name: task13
        template: sort
        depends: "task9 && task11"
      - name: task14
        template: nestloop
        depends: "task8 && task9"
      - name: task15
        template: sort
        depends: "task9 && task11"
      - name: task16
        template: loop
        depends: "task12 && task13 && task14 && task15"
  - name: loop
    container:
      image: hbista2/loop:v2
  - name: sort
    container:
      image: hbista2/sort:v2
  - name: nestloop
    container:
      image: hbista2/nestloop:v2



# DAG GE:
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: dag-test-cs598-ge-
spec:
  entrypoint: diamond
  templates:
  - name: diamond
    dag:
      tasks:
      - name: task1
        template: sort
      - name: task2 
        template: nestloop
        depends: "task1"
      - name: task3
        template: nestloop
        depends: "task1"
      - name: task4
        template: sort
        depends: "task1"
      - name: task5
        template: sort
        depends: "task1"
      - name: task6
        template: nestloop
        depends: "task2"
      - name: task7
        template: nestloop
        depends: "task3 && task6"
      - name: task8
        template: loop
        depends: "task4 && task6"
      - name: task9
        template: nestloop
        depends: "task6 && task5"
      - name: task10
        template: nestloop
        depends: "task7"
      - name: task11
        template: nestloop
        depends: "task8 && task10"
      - name: task12
        template: sort
        depends: "task9 && task10"
      - name: task13
        template: nestloop
        depends: "task11"
      - name: task14
        template: loop
        depends: "task12 && task13"
  - name: loop
    container:
      image: hbista2/loop:v2
  - name: sort
    container:
      image: hbista2/sort:v2
  - name: nestloop
    container:
      image: hbista2/nestloop:v2

