您好,登錄后才能下訂單哦!
小編給大家分享一下如何快速安裝與使用Argo,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!
Argo 項(xiàng)目是一組 Kubernetes 原生工具集合,用于運(yùn)行和管理 Kubernetes 上的作業(yè)和應(yīng)用程序。Argo 提供了一種在 Kubernetes 上創(chuàng)建工作和應(yīng)用程序的三種計(jì)算模式 – 服務(wù)模式、工作流模式和基于事件的模式 – 的簡(jiǎn)單組合方式。所有的 Argo 工具都實(shí)現(xiàn)為控制器和自定義資源。
下載頁(yè)面:https://github.com/argoproj/argo-workflows/releases
下載客戶端,通過(guò) 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
kubectl create namespace argo kubectl apply -n argo -f https://raw.githubusercontent.com/argoproj/argo/v3.0.0-rc3/manifests/install.yaml
開(kāi)啟節(jié)點(diǎn)部署pod:
安裝完后,使用 kubectl get pod -n argo發(fā)現(xiàn)始終處于pending狀態(tài),需要開(kāi)啟master節(jié)點(diǎn)的任務(wù)部署。
kubectl taint nodes --all node-role.kubernetes.io/master-
運(yùn)行示例的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 來(lái)轉(zhuǎn)發(fā)端口:
kubectl -n argo port-forward deployment/argo-server 2746:2746
用戶界面可訪問(wèn) 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代表是一個(gè)服務(wù)
type:NodePort k8s將會(huì)在每個(gè)Node上打開(kāi)一個(gè)端口并且每個(gè)Node的端口都是一樣的,通過(guò)<NodeIP>:NodePort的方式Kubernetes集群外部的程序可以訪問(wèn)Service。
selector:哪個(gè)服務(wù)需要暴露
port:service暴露的端口
TargetPort:pod的端口
nodePort:對(duì)外暴露的端口,不設(shè)置會(huì)默認(rèn)分配,范圍:30000-32767
轉(zhuǎn)發(fā)邏輯是:
<NodeIP>:<nodeport> => <ServiceVIP>:<port>=> <PodIP>:<targetport>
在相應(yīng)節(jié)點(diǎn)上使用http://<NodeIP>:<nodeport>就可以訪問(wèn)服務(wù)了。
看完了這篇文章,相信你對(duì)“如何快速安裝與使用Argo”有了一定的了解,如果想了解更多相關(guān)知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。