---
# System prepended metadata

title: 安裝 Argo Workflows、CD、Rollouts、Events 與實作應用
tags: [工具]

---

# 安裝 Argo Workflows、CD、Rollouts、Events 與實作應用



## 安裝 Argo Workflows


* 新增 argo workflow repo
```
$ helm repo add argo https://argoproj.github.io/argo-helm

$ helm repo update
```
* 顯示所有 values.yaml

```
$ helm show values argo/argo-workflows
```
* 設定 `argo-workflows-server` service 開啟 NodePort
```
$ nano argo-workflows-values.yaml
server:
  serviceType: NodePort
  extraArgs:
    - --auth-mode=server     # 關閉 argo web ui 登入時身份驗證
```


* 安裝 Argo Workflows
```
$ helm install argo-workflows argo/argo-workflows -n argo --create-namespace -f argo-workflows-values.yaml
```
* 賦予 argo serviceaccount 有 cluster-admin 的權限，否則 argo 創建出來的 pod 沒有權限
```
$ kubectl create clusterrolebinding argo-admin --clusterrole=cluster-admin --serviceaccount=argo:default -n argo
```

* 檢查 pod 是否部署成功
```
$ kubectl -n argo get all
NAME                                                      READY   STATUS    RESTARTS   AGE
pod/argo-workflows-server-55746bb9d4-g9hff                1/1     Running   0          6m34s
pod/argo-workflows-workflow-controller-85bc78db56-gk5pr   1/1     Running   0          6m34s

NAME                            TYPE       CLUSTER-IP    EXTERNAL-IP   PORT(S)          AGE
service/argo-workflows-server   NodePort   10.96.236.9   <none>        2746:31398/TCP   6m34s

NAME                                                 READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/argo-workflows-server                1/1     1            1           6m34s
deployment.apps/argo-workflows-workflow-controller   1/1     1            1           6m34s

NAME                                                            DESIRED   CURRENT   READY   AGE
replicaset.apps/argo-workflows-server-55746bb9d4                1         1         1       6m34s
replicaset.apps/argo-workflows-workflow-controller-85bc78db56   1         1         1       6m34s
```

### 安裝 argo CLI

```
$ curl -s https://raw.githubusercontent.com/tarokok8s/Tarokok8s/refs/heads/main/Workload/DevOps/tools/argo/install.sh | bash

$ argo version
argo: v3.7.1
  BuildDate: 2025-08-12T06:15:24Z
  GitCommit: a7cd8a49bf184ad864275acc1bf3189ebefa118c
  GitTreeState: clean
  GitTag: v3.7.1
  GoVersion: go1.24.5
  Compiler: gc
  Platform: linux/amd64
```
### 使用 nodeport 方式登入 argo workflows UI
![image](https://hackmd.io/_uploads/r1fEJjKFgx.png)

## 安裝 Argo CD

* 新增 argo cd repo
```
$ helm repo add argo-cd https://argoproj.github.io/argo-helm

$ helm repo update
```

* 顯示所有 values.yaml

```
$ helm show values argo-cd/argo-cd
```


```
$ nano argo-cd-values.yaml
server:
  service:
    type: NodePort
```

* 開始安裝 argo cd
```
$ helm install argo-cd argo-cd/argo-cd -n argocd --create-namespace -f argo-cd-values.yaml
```
* 檢查 pod 是否部署成功
```
$ kubectl -n argocd get all
NAME                                                            READY   STATUS    RESTARTS   AGE
pod/argo-cd-argocd-application-controller-0                     1/1     Running   0          2m
pod/argo-cd-argocd-applicationset-controller-5764c9b846-zhmt5   1/1     Running   0          2m
pod/argo-cd-argocd-dex-server-7d49db56d7-zdp79                  1/1     Running   0          2m
pod/argo-cd-argocd-notifications-controller-558cc94484-88ghq    1/1     Running   0          119s
pod/argo-cd-argocd-redis-7d5fc4445c-mrb5l                       1/1     Running   0          2m
pod/argo-cd-argocd-repo-server-5bb5cc6cbb-g9s8c                 1/1     Running   0          2m
pod/argo-cd-argocd-server-85db499559-zwv77                      1/1     Running   0          2m

NAME                                               TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE
service/argo-cd-argocd-applicationset-controller   ClusterIP   10.96.66.57     <none>        7000/TCP                     2m1s
service/argo-cd-argocd-dex-server                  ClusterIP   10.96.148.53    <none>        5556/TCP,5557/TCP            2m1s
service/argo-cd-argocd-redis                       ClusterIP   10.96.191.138   <none>        6379/TCP                     2m1s
service/argo-cd-argocd-repo-server                 ClusterIP   10.96.5.10      <none>        8081/TCP                     2m1s
service/argo-cd-argocd-server                      NodePort    10.96.32.253    <none>        80:30080/TCP,443:30443/TCP   2m1s

NAME                                                       READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/argo-cd-argocd-applicationset-controller   1/1     1            1           2m1s
deployment.apps/argo-cd-argocd-dex-server                  1/1     1            1           2m1s
deployment.apps/argo-cd-argocd-notifications-controller    1/1     1            1           2m1s
deployment.apps/argo-cd-argocd-redis                       1/1     1            1           2m1s
deployment.apps/argo-cd-argocd-repo-server                 1/1     1            1           2m1s
deployment.apps/argo-cd-argocd-server                      1/1     1            1           2m1s

NAME                                                                  DESIRED   CURRENT   READY   AGE
replicaset.apps/argo-cd-argocd-applicationset-controller-5764c9b846   1         1         1       2m1s
replicaset.apps/argo-cd-argocd-dex-server-7d49db56d7                  1         1         1       2m1s
replicaset.apps/argo-cd-argocd-notifications-controller-558cc94484    1         1         1       2m
replicaset.apps/argo-cd-argocd-redis-7d5fc4445c                       1         1         1       2m1s
replicaset.apps/argo-cd-argocd-repo-server-5bb5cc6cbb                 1         1         1       2m1s
replicaset.apps/argo-cd-argocd-server-85db499559                      1         1         1       2m1s

NAME                                                     READY   AGE
statefulset.apps/argo-cd-argocd-application-controller   1/1     2m1s
```

* 獲取 argo cd UI 的 admin 密碼

```
$ kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d
Vc37KTsJiliMxjmu
```

### 使用 nodeport 方式登入 argo cd UI

![image](https://hackmd.io/_uploads/ry5HzsYFex.png)


### 安裝 argo cd CLI

* 安裝最新版本
```
$ curl -sSL -o argocd-linux-amd64 https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64

$ sudo install -m 555 argocd-linux-amd64 /usr/local/bin/argocd

$ rm argocd-linux-amd64

$ argocd version
argocd: v3.1.0+03c4ad8
  BuildDate: 2025-08-13T21:03:54Z
  GitCommit: 03c4ad854c1e6d922a121cd40f505d9bc6e402da
  GitTreeState: clean
  GoVersion: go1.24.6
  Compiler: gc
  Platform: linux/amd64
{"level":"fatal","msg":"Argo CD server address unspecified","time":"2025-08-25T16:48:14+08:00"}
```

## 安裝 Argo rollouts

* 新增 argo cd repo
```
$ helm repo add argo-rollout https://argoproj.github.io/argo-helm

$ helm repo update
```
* 顯示所有 values.yaml

```
$ helm show values argo-rollout/argo-rollouts
```


* 開始安裝 argo rollouts
```
$ helm install argo-rollout argo-rollout/argo-rollouts -n argo-rollouts --create-namespace
```
* 檢查 pod 是否部署成功
```
$ kubectl -n argo-rollouts get all
NAME                                             READY   STATUS    RESTARTS   AGE
pod/argo-rollout-argo-rollouts-bcd84d457-dl4kv   1/1     Running   0          69s
pod/argo-rollout-argo-rollouts-bcd84d457-rvngl   1/1     Running   0          69s

NAME                                         READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/argo-rollout-argo-rollouts   2/2     2            2           69s

NAME                                                   DESIRED   CURRENT   READY   AGE
replicaset.apps/argo-rollout-argo-rollouts-bcd84d457   2         2         2       69s
```

### 安裝 kubectl argo rollout plugin

```
$ curl -LO https://github.com/argoproj/argo-rollouts/releases/latest/download/kubectl-argo-rollouts-linux-amd64

$ chmod +x ./kubectl-argo-rollouts-linux-amd64

$ sudo mv ./kubectl-argo-rollouts-linux-amd64 /usr/local/bin/kubectl-argo-rollouts

$ kubectl argo rollouts version
kubectl-argo-rollouts: v1.8.3+49fa151
  BuildDate: 2025-06-04T22:15:54Z
  GitCommit: 49fa1516cf71672b69e265267da4e1d16e1fe114
  GitTreeState: clean
  GoVersion: go1.23.9
  Compiler: gc
  Platform: linux/amd64
```

## 安裝 Argo Events
> 注意!安裝 Argo Events 前須先安裝好 Argo Workflows

* 新增 argo events repo
```
$ helm repo add argo-events https://argoproj.github.io/argo-helm

$ helm repo update
```
* 顯示所有 values.yaml

```
$ helm show values argo-events/argo-events
```

* 開始安裝 argo events
```
$ helm install argo-events argo-events/argo-events -n argo-events --create-namespace
```
* 部署 EventBus
  - EventBus 物件是在為 Argo Events 建立與設定「事件匯流排（message/event bus）」，也就是叢集內用來傳遞事件的訊息代理（broker）
```
$ kubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/stable/examples/eventbus/native.yaml
```

* 檢查 pod 是否部署成功

```
$ kubectl -n argo-events get all
NAME                                                  READY   STATUS    RESTARTS   AGE
pod/argo-events-controller-manager-776485b96f-vwjnx   1/1     Running   0          17h
pod/eventbus-default-stan-0                           2/2     Running   0          2m59s
pod/eventbus-default-stan-1                           2/2     Running   0          2m42s
pod/eventbus-default-stan-2                           2/2     Running   0          2m25s

NAME                                TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)                      AGE
service/eventbus-default-stan-svc   ClusterIP   None         <none>        4222/TCP,6222/TCP,8222/TCP   3m

NAME                                             READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/argo-events-controller-manager   1/1     1            1           17h

NAME                                                        DESIRED   CURRENT   READY   AGE
replicaset.apps/argo-events-controller-manager-776485b96f   1         1         1       17h

NAME                                     READY   AGE
statefulset.apps/eventbus-default-stan   3/3     3m
```


## 實作與應用

1. Argo Workflows 實作應用[連結](https://hackmd.io/@7vxmAdNPTmmlYGSRMuvbmw/rkeItt0txe)
2. Argo CD 實作應用[連結](https://hackmd.io/@7vxmAdNPTmmlYGSRMuvbmw/HkR3XNJcll)
3. Argo Rollouts 實作應用[連結](https://hackmd.io/@7vxmAdNPTmmlYGSRMuvbmw/rybahQg9ex)
4. Argo Events 實作應用[連結](https://hackmd.io/@7vxmAdNPTmmlYGSRMuvbmw/HkcOJol9el)










## 參考
https://argo-workflows.readthedocs.io/en/latest/installation/

https://argo-workflows.readthedocs.io/en/latest/argo-server-auth-mode/




