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
      • Pod
    • Helm Chart
    • OAuth2 Proxy
    • Isito-EnvoyFilter
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Vault
    • Longhorn – Storage
    • VictoriaMetrics
    • MetalLB
    • Kong Gateway
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Argo Events
    • Spinnaker
    • Jenkins
    • Harbor
    • TeamCity
    • Git
      • Bitbucket
  • Coding
    • DevSecOps
    • Terraform
      • GCP – Google Cloud
      • AWS – Amazon Web Service
      • Azure Cloud
    • Golang
    • Laravel
    • Python
    • Jquery & JavaScript
    • Selenium
  • Log, Monitor & Tracing
    • DataDog
    • Prometheus
    • Grafana
    • ELK
      • Kibana
      • Logstash
  • BareMetal
    • NextCloud
  • Toggle search form

[ArgoWorkflows] Lesson 1: Installing Awgo-WorkFlows by the helm-chart and Demo a few simple templates.

Posted on January 2, 2022May 16, 2023 By nim No Comments on [ArgoWorkflows] Lesson 1: Installing Awgo-WorkFlows by the helm-chart and Demo a few simple templates.

Contents

Toggle
  • 1) Install Awgo WorkFlows.
    • 1.1) explain a few configuration.
  • 2) Simple template
    • 2.1) container-template
    • 2.2) script-template
    • 2.3) resource-template

1) Install Awgo WorkFlows.

helm repo add argo https://argoproj.github.io/argo-helm

>>>value.yaml
server:
  extraArgs:
    - --auth-mode=server
singleNamespace: true
controller:
  containerRuntimeExecutor: emissary
  workflowDefaults:
   spec:
     serviceAccountName: argo-workflows-server
workflow:
  serviceAccount:
    create: true

1.1) explain a few configuration.

useStaticCredentials: true

When useStaticCredentials is set to true, Argo Workflows uses the static AWS credentials provided to it (typically through a Kubernetes Secret), instead of attempting to use other methods of obtaining AWS credentials, such as IAM roles for service accounts (IRSA) or instance metadata.

The static credentials generally refer to the AWS Access Key ID and Secret Access Key. These should be stored securely, such as in a Kubernetes Secret, and provided to the Argo Workflows components that need them.

2) Simple template

2.1) container-template

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: wf-container-template- # Name of this workflow
spec:
  entrypoint: container-template # defines "whalesay" as the "main" template
  templates:
  - name: container-template      #defining the "whalesay" template
    container:
      image: python:3.8-slim
      command: [echo, "Nimtechnology"]

Để chạy được cái này bạn chọn create nhé.
Mình apply thì nó báo lỗi.

kubectl -n argo create -f hello-world.yaml

https://argoproj.github.io/argo-workflows/workflow-executors/#kubelet-kubelet

Chỗ generateName: bạn nên đặt kiểu xxx-
Argoworkflow sẽ thêm 5 kí tự vào đó, để đảm bảo nó là unique.(Duy nhất)

generateName sẽ hỉnh là tên pod luôn

Workflow Executors thì mình đang chạy mode: Emissary (emissary)

Mình thấy có 3 pod.
Click vào trong sem có j hay

2.2) script-template

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: wf-script-template- # Name of this workflow
spec:
  entrypoint: script-template # defines "whalesay" as the "main" template
  templates:
  - name: script-template      #defining the "whalesay" template
    script:
      image: python:3.8-slim
      command: [python]
      source: |
        print("Nimtechnology - the script template was executed successfully.")

Anh/em tiếp tục: kubectl -n argo create

Ở nhưng Bài đầu này mình cũng gần như chưa thấy nhiều sự khách biệt giữa container-template và script-template.
Hiện tại mình chỉ thấy khách ở việc run command trong container.

2.3) resource-template

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: wf-resource-template- # Name of this workflow
spec:
  entrypoint: resource-template # defines "whalesay" as the "main" template
  templates:
  - name: script-template      #defining the "whalesay" template
    resource:
      action: create
      manifest: |
        apiVersion: argoproj.io/v1alpha1
        kind: Workflow
        metadata:
          generateName: wf-test
        spec:
          entrypoint: test-template
          templates:
          - name: test-template
            script:
              image: python:3.8-slim
              command: [python]
              source: |
                print("Nimtechnology - the script template was executed successfully.")
kubectl -n argo create -f wf-resource-template.yaml
>>>outout
workflow.argoproj.io/wf-resource-template-2t5n9 created

Đại loại thì lỗi trên là nó dùng 1 service acount là default mà SA default này lại ko có quyên tạo resource “workflows”

resolve this problem: https://github.com/argoproj/argo-workflows/issues/1021

Mình đoán là argo workflows sẽ có SA đáp đứng được điều kiện trên. Giờ đi tìm thôi.

chúng ta có 2 service accounts
Mình thấy argo-workflows-server này có tương lại
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  labels:
    app.kubernetes.io/component: server
    app.kubernetes.io/instance: argo-workflows
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: argo-workflows-server
    app.kubernetes.io/part-of: argo-workflows
    helm.sh/chart: argo-workflows-0.9.4
  name: argo-workflows-server
  namespace: argo
rules:
  - apiGroups:
      - ''
    resources:
      - configmaps
      - events
    verbs:
      - get
      - watch
      - list
  - apiGroups:
      - ''
    resources:
      - pods
      - pods/exec
      - pods/log
    verbs:
      - get
      - list
      - watch
      - delete
  - apiGroups:
      - ''
    resources:
      - secrets
    verbs:
      - get
  - apiGroups:
      - ''
    resources:
      - events
    verbs:
      - watch
      - create
      - patch
  - apiGroups:
      - argoproj.io
    resources:
      - eventsources
      - sensors
      - workflows
      - workfloweventbindings
      - workflowtemplates
      - cronworkflows
    verbs:
      - create
      - get
      - list
      - watch
      - update
      - patch
      - delete

Anh em có thể thấy là role khá nhiều quyền. Lấy service account service argo-workflows-server sài thôi

file value của helm chart sẽ là:

server:
  extraArgs:
    - --auth-mode=server
singleNamespace: true
controller:
  containerRuntimeExecutor: emissary
  workflowDefaults:
   spec:
     serviceAccountName: argo-workflows-server
workflow:
  serviceAccount:
    create: true

Giờ create lại yaml resource:

ArgoWorkflows, CI/CD

Post navigation

Previous Post: [Jenkins] Scripted Pipeline lesson 17: Triggers _ Cron.
Next Post: [Jenkins] Scripted Pipeline lesson 18: Triggers _ PollSCM

More Related Articles

[Kaniko/Bitbucket/ECR] Accomplish the workflow: CI by bitbucket pipeline, Kaniko build image and push image to ECR AWS - Amazon Web Service
[Argo-Workflows] Lesson22: Reference to Workflow Templates ArgoWorkflows
Hướng dẫn phần quền user trên Jenkins. CI/CD
[Argo Rollouts] How We Brought Automated Rollback to 2100+ Micro-serv… CI/CD
[Argo-Workflows] Lesson20: Cron Workflow ArgoWorkflows
[Argo-Workflows] Lesson6: Output Parameter File 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

  • [Azure/Loadbalancer] Creating an internal load balancer on Azure Kubernetes Service (AKS). May 13, 2025
  • [Azure] The subscription is not registered to use namespace ‘Microsoft.ContainerService’ May 8, 2025
  • [Azure] Insufficient regional vcpu quota left May 8, 2025
  • [WordPress] How to add a Dynamic watermark on WordPress. May 6, 2025
  • [vnet/Azure] VNet provisioning via Terraform. April 28, 2025

Archives

  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • 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
    • NextCloud
  • CI/CD
    • Argo Events
    • ArgoCD
    • ArgoWorkflows
    • Git
      • Bitbucket
    • Harbor
    • Jenkins
    • Spinnaker
    • TeamCity
  • Coding
    • DevSecOps
    • Golang
    • Jquery & JavaScript
    • Laravel
    • NextJS 14 & ReactJS & Type Script
    • Python
    • Selenium
    • Terraform
      • AWS – Amazon Web Service
      • Azure Cloud
      • GCP – Google Cloud
  • Kubernetes & Container
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Docker
    • Helm Chart
    • Isito-EnvoyFilter
    • Kong Gateway
    • Kubernetes
      • Ingress
      • Pod
    • Longhorn – Storage
    • MetalLB
    • OAuth2 Proxy
    • Vault
    • VictoriaMetrics
  • Log, Monitor & Tracing
    • DataDog
    • ELK
      • Kibana
      • Logstash
    • Fluent
    • Grafana
    • Prometheus
  • Uncategorized
  • Admin

Copyright © 2025 NimTechnology.