Tekton3

參考github上的Hands-On Tekton練習

ZONGRU Li
6 min readJun 16, 2022

找到一個YT影片(LINK)

內容使用的github練習(LINK)

基本上依據前一篇整理的建置Minikube環境與tkn CLI安裝

但是還要加入安裝git:

#Ubuntu安裝git:
sudo apt-get install git

接著準備好後

#拉取git source:
git clone https://github.com/joellord/handson-tekton
cd handson-tekton

內容我就先fork到自己那邊去了:

然後會有幾個已經建好的元件YAML檔,可以直接使用

1.建立Hello World task:

#執行clone下來的YAML檔:
cat ./demo/01-hello.yaml
kubectl apply -f ./demo/01-hello.yamltkn task start --showlog hello

2.新增Parameter to the Task:

#執行:
cat ./demo/02-param.yaml
kubectl apply -f ./demo/02-param.yamltkn task start --showlog hellotkn task start --showlog -p person=Joel hello

實際用其他指令也會看到很奇怪的異常:

tkn task describe hello

後面找到一篇跟我一樣狀況(LINK)

有人解答說tkn cli版本太舊:

即便這就是官方當前2022/06/16提供的安裝方式得到的版本...

所以看起來只能先找找有沒有辦法更新tkn,或是只能用TaskRunyaml來跑

先移除相關元件:

kubectl delete task hello
#解安裝當前的tkn cli工具(參考相關apt指令LINK):
sudo apt-get remove tektoncd-cli
#測試:
tkn version

接著找到tektoncd/cli github上比較新的安裝方式(LINK):

#所以我只補上後兩句試試:
echo "deb http://ppa.launchpad.net/tektoncd/cli/ubuntu impish main"|sudo tee /etc/apt/sources.list.d/tektoncd-ubuntu-cli.list
sudo apt update && sudo apt install -y tektoncd-cli

再來重跑一次前面的params的教學:

#重跑params的教學:
kubectl apply -f ./demo/02-param.yaml
tkn task start --showlog hellotkn task start --showlog -p person=Joel hello

看來有缺一些套件

也就是我可能沒有移除乾淨

重跑完整的移除流程:

#整理應該要跑的移除tkn流程:
sudo apt-get remove tektoncd-cli
#移除設定檔:
sudo apt-get purge tektoncd-cli
#排除相依的dependency:
sudo apt autoremove

再重新安裝:

#所以我只補上後兩句試試:
echo "deb http://ppa.launchpad.net/tektoncd/cli/ubuntu impish main"|sudo tee /etc/apt/sources.list.d/tektoncd-ubuntu-cli.list
sudo apt update && sudo apt install -y tektoncd-cli

畫面不貼了,跟上面一樣

再重跑:

#重跑params的教學:
kubectl apply -f ./demo/02-param.yaml (這個跑過了)
tkn task start --showlog hellotkn task start --showlog -p person=Joel hello

看起來還是一樣錯誤...

#可以查看這東西有的版本:
cd /lib/x86_64-linux-gnu
strings libc-*.so | grep GLIBC

看來只能升級一下用新的Ubuntu機台了…先記錄到這邊重開新機台用用

--

--

ZONGRU Li
ZONGRU Li

Written by ZONGRU Li

2022/11/17 開源部分個人筆記給LINE "Java程式語言討論區"社群,希望能對社群的技術學習做一點點貢獻.(掩面....記得退訂閱!

No responses yet