Skip to content

NimTechnology

Trình bày các công nghệ CLOUD một cách dễ hiểu.

  • Kubernetes & Container
    • Docker
    • Kubernetes
      • Ingress
    • Helm Chart
    • Isito-EnvoyFilter
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Vault
    • Longhorn – Storage
    • VictoriaMetrics
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Spinnaker
    • Jenkins
    • Harbor
    • TeamCity
    • Git
      • Bitbucket
  • Coding
    • Terraform
      • GCP – Google Cloud
      • AWS – Amazon Web Service
    • Golang
    • Laravel
    • Python
    • Jquery & JavaScript
    • Selenium
  • Log & Monitor
    • Prometheus
    • Grafana
    • ELK
      • Kibana
      • Logstash
  • BareMetal
  • Toggle search form

[ArgoWorkflows] Lesson2: Demo Steps Template and DAG Template on ArgoWorkflows

Posted on January 4, 2022 By nim No Comments on [ArgoWorkflows] Lesson2: Demo Steps Template and DAG Template on ArgoWorkflows

Ở bài đâu tiên chúng ta chỉ mới tạo những simple templates.
Chả thấy kiểu như pipeline.

Contents

  • 1) Steps Template serial
  • Steps Template parallel
  • Suspend Template
  • DAG Template

1) Steps Template serial

Sau đây chúng ta có như pipeline hiện thì trên ui như sau.

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  name: wf-steps-templates-serial
spec:
  entrypoint: steps-templates-serial
  templates:
  - name: steps-templates-serial
    steps:
    - - name: step1
        template: task-template
    - - name: step2
        template: task-template
    - - name: step3
        template: task-template

  - name: task-template
    script:
      image: python:3.8-slim
      command: [python]
      source: |
        print("Nimtechnology - Task executed.")
Bạn thấy chỗ này là 2 gạch ngang “- -“

THì bạn cứ apply hày create đều được

log của container.

Steps Template parallel

Giờ các bạn muốn steps chạy parallel thì làm sao

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  name: wf-steps-templates-parallel
spec:
  entrypoint: steps-templates-parallel
  templates:
  - name: steps-templates-parallel
    steps:
    - - name: step1
        template: task-template
    - - name: step2
        template: task-template
      - name: step3
        template: task-template
    - - name: step4
        template: task-template

  - name: task-template
    script:
      image: python:3.8-slim
      command: [python]
      source: |
        print("Nimtechnology - Task executed.")
Bạn sẽ thấy step2 và step3 chạy cùng nhau.

Suspend Template

Giờ mình tạo 1 step kiểu như sleep hay suspend(treo) mấy giây.

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  name: wf-steps-templates-suspend
spec:
  entrypoint: steps-templates-suspend
  templates:
  - name: steps-templates-suspend
    steps:
    - - name: step1
        template: task-template
    - - name: step2
        template: task-template
      - name: step3
        template: task-template
    - - name: delay
        template: deylay-template
    - - name: step4
        template: task-template

  - name: task-template
    script:
      image: python:3.8-slim
      command: [python]
      source: |
        print("Nimtechnology - Task executed.")

  - name: deylay-template
    suspend:
      duration: "10s"

DAG Template

Cũng giống như step template về mặt flows.

Dag thì nó tường mình hơn khi việc Task này phụ thuộc task kia như thế nào.

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  name: wf-dag-templates-suspend
spec:
  entrypoint: dag-templates-suspend
  templates:
  - name: dag-templates-suspend
    dag:
      tasks:
      - name: Task1
        template: task-template
      - name: Task2
        template: task-template
        dependencies: [Task1]
      - name: Task3
        template: task-template
        dependencies: [Task1]
      - name: Delay
        template: deylay-template
        dependencies: [Task2, Task3]
      - name: Task4
        template: task-template
        dependencies: [Delay]

  - name: task-template
    script:
      image: python:3.8-slim
      command: [python]
      source: |
        print("Nimtechnology - Task executed.")

  - name: deylay-template
    suspend:
      duration: "10s"
ArgoWorkflows

Post navigation

Previous Post: [Jenkins] Scripted Pipeline lesson 18: Triggers _ PollSCM
Next Post: [Minio] Install MinIO on Kubernetes through minio-operator

More Related Articles

[Argo-Workflows] Lesson3: Argo CLI and Input Parameters ArgoWorkflows
[Argo-Workflows] Lesson5: Output Parameter ArgoWorkflows
[ArgoWorkflows] Lesson 1: Installing Awgo-WorkFlows by the helm-chart and Demo a few simple templates. ArgoWorkflows
[Argo-Workflows] Lesson4: Script result – receive the output result of another task to make the input parameter. ArgoWorkflows

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Tham Gia Group DevOps nhé!
Để Nim có nhiều động lực ra nhiều bài viết.
Để nhận được những thông báo mới nhất.

Recent Posts

  • [Smartctl] Instruction check the health disk of Raspberry. January 16, 2023
  • [kubectl/Argocd] How to create a kubectl config file for serviceaccount or from the cluster secret of Argocd January 12, 2023
  • [Helm/Github] Create a public Helm chart repository with GitHub Pages January 8, 2023
  • [AWS] How to increase the disk size of a Windows EC2 machine? January 4, 2023
  • [Redis] ElastiCache-Redis Cross-Region Replication|Global DataStore January 3, 2023

Archives

  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021

Categories

  • BareMetal
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Git
      • Bitbucket
    • Harbor
    • Jenkins
    • Spinnaker
    • TeamCity
  • Coding
    • Golang
    • Jquery & JavaScript
    • Laravel
    • Python
    • Selenium
    • Terraform
      • AWS – Amazon Web Service
      • GCP – Google Cloud
  • Kubernetes & Container
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Docker
    • Helm Chart
    • Isito-EnvoyFilter
    • Kubernetes
      • Ingress
    • Longhorn – Storage
    • Vault
    • VictoriaMetrics
  • Log & Monitor
    • ELK
      • Kibana
      • Logstash
    • Grafana
    • Prometheus
  • Uncategorized
  • Admin

Copyright © 2023 NimTechnology.