400 028 6601

建站动态

根据您的个性需求进行定制 先人一步 抢占小程序红利时代

如何进行argo云原生的CI/CD初探

本篇文章为大家展示了如何进行argo云原生的CI/CD初探,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。

创新互联建站是一家专注于成都网站制作、网站设计与策划设计,黄埔网站建设哪家好?创新互联建站做网站,专注于网站建设十年,网设计领域的专业建站公司;建站业务涵盖:黄埔等地区。黄埔做网站价格咨询:13518219792

kubectl create namespace argo
kubectl apply -n argo -f https://raw.githubusercontent.com/argoproj/argo/v2.10.0-rc4/manifests/install.yaml
# Download the binary
curl -sLO https://github.com/argoproj/argo/releases/download/v2.10.0-rc4/argo-linux-amd64.gz

# Unzip
gunzip argo-linux-amd64.gz

# Make binary executable
chmod +x argo-linux-amd64

# Move binary to path
mv ./argo-linux-amd64 /usr/local/bin/argo

# Test installation
argo version

如何进行argo云原生的CI/CD初探

  1. 需要注意的是namespace选择argo,spec下增加serviceAccountName: argo

  2. 使用kubectl apply -n argo -f https://raw.githubusercontent.com/argoproj/argo/v2.10.0-rc4/manifests/install.yaml创建时,只在命名空间argo里创建了ServiceAccount

  3. 如不修改会报以下错误:Failed to establish pod watch: unknown (get pods) 

  4. 如需在其它命名空间使用,参考后面

如何进行argo云原生的CI/CD初探

#argo-rbac.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: workflow
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: workflow-role
rules:
# pod get/watch is used to identify the container IDs of the current pod
# pod patch is used to annotate the step's outputs back to controller (e.g. artifact location)
- apiGroups:
  - ""
  resources:
  - pods
  verbs:
  - get
  - watch
  - patch
# logs get/watch are used to get the pods logs for script outputs, and for log archival
- apiGroups:
  - ""
  resources:
  - pods/log
  verbs:
  - get
  - watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: workflow-binding
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: workflow-role
subjects:
- kind: ServiceAccount
  name: workflow
kubectl apply -n default -f argo-rbac.yaml

如何进行argo云原生的CI/CD初探

增加一行serviceAccountName: workflow

创建后就可以通过此模板部署k8s程序

如何进行argo云原生的CI/CD初探

上述内容就是如何进行argo云原生的CI/CD初探,你们学到知识或技能了吗?如果还想学到更多技能或者丰富自己的知识储备,欢迎关注创新互联行业资讯频道。


文章标题:如何进行argo云原生的CI/CD初探
分享路径:http://mbwzsj.com/article/ipgehe.html

其他资讯

让你的专属顾问为你服务