欢迎光临
我们一直在努力

如何快速安装与使用Argo

小编给大家分享一下如何快速安装与使用Argo,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!

Argo 项目是一组 Kubernetes 原生工具集合,用于运行和管理 Kubernetes 上的作业和应用程序。Argo 提供了一种在 Kubernetes 上创建工作和应用程序的三种计算模式 – 服务模式、工作流模式和基于事件的模式 – 的简单组合方式。所有的 Argo 工具都实现为控制器和自定义资源。

快速安装

  • 下载页面:https://github.com/argoproj/argo-workflows/releases

Linux

下载客户端,通过 curl,如下:

# Download the binarycurl -LO https://github.com/argoproj/argo/releases/download/v3.0.0-rc3/argo-linux-amd64.gz# Unzipgunzip argo-linux-amd64.gz# Make binary executablechmod +x argo-linux-amd64# Move binary to pathmv ./argo-linux-amd64 /usr/local/bin/argo# Test installationargo version
Argo Controller服务安装
kubectl create namespace argo
kubectl apply -n argo -f https://raw.githubusercontent.com/argoproj/argo/v3.0.0-rc3/manifests/install.yaml

开启节点部署pod:

安装完后,使用 kubectl get pod -n argo发现始终处于pending状态,需要开启master节点的任务部署。

kubectl taint nodes --all node-role.kubernetes.io/master-

运行测试

运行示例的workflow:

argo submit -n argo --watch https://raw.githubusercontent.com/argoproj/argo-workflows/master/examples/hello-world.yaml
argo list -n argo
argo get -n argo @latest
argo logs -n argo @latest

 查看UI:

  • 使用 port-forward 来转发端口:

kubectl -n argo port-forward deployment/argo-server 2746:2746

用户界面可访问 http://localhost:2746

  • 使用NodePort:

使用kubectl edit deployment/argo-server -n argo,参照如下nginx-service.yaml,将type改为NodePort,并添加nodePort端口。

apiVersion: v1kind: Servicemetadata:
  name: nginx-servicespec:
  type: NodePort
  sessionAffinity: ClientIP
  selector:app: nginx
  ports:- port: 80  nodePort: 30080
  • kind:Service代表是一个服务

  • type:NodePort k8s将会在每个Node上打开一个端口并且每个Node的端口都是一样的,通过<NodeIP>:NodePort的方式Kubernetes集群外部的程序可以访问Service。

  • selector:哪个服务需要暴露

  • port:service暴露的端口

  • TargetPort:pod的端口

  • nodePort:对外暴露的端口,不设置会默认分配,范围:30000-32767

  • 转发逻辑是:
    <NodeIP>:<nodeport> => <ServiceVIP>:<port>=> <PodIP>:<targetport>

在相应节点上使用http://<NodeIP>:<nodeport>就可以访问服务了。

看完了这篇文章,相信你对“如何快速安装与使用Argo”有了一定的了解,如果想了解更多相关知识,欢迎关注云行业资讯频道,感谢各位的阅读!

赞(0)
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。