iT邦幫忙

第 12 屆 iThome 鐵人賽

DAY 26
0
DevOps

k8s 生態鏈 完美組合系列 第 26

Day26 怎麼使用 telepresence ?

介紹完了 telepresence ,接下來就來談談,怎麼使用跟安裝它

安裝

MacOs的方法如下

$ brew cask install osxfuse
$ brew install datawire/blackbird/telepresence

如果需要其他 OS 的安裝方式,請參考官方文件

使用

先使用簡單的範例

$ telepresence

接下來你就會看到在同一個 session 下面已經可以存取 grpc-client 了。再來你可以嘗試看看在同一個 session 裡面可以

$ curl http://first-helloworld/ping
Hello World%

範例可以參考前幾天的文章

可以發現在那個 session 裡面已經完美進入了 k3s 的網路中了,然後那個 session 其實是 telepresence 幫你啟動了一個 POD ,可以透過

$ kubectl get pods
NAME                                         READY   STATUS                  RESTARTS   AGE
first-hellworld-deployment-566d79fb7-jr5qn   2/2     Running                 0          5d19h
first-hellworld-deployment-566d79fb7-f979g   2/2     Running                 0          5d19h
first-hellworld-deployment-566d79fb7-d9jpq   2/2     Running                 0          5d19h
telepresence-1601774775-3203058-34000        2/2     Running                 0          8m48

實際上你的網路就完全是跟 telepresence-1601774775-3203058-34000 所共享的,你可以直接透過 cluster 裡面的網路 & DNS ,去做任何你想要的 request 。

這就是一個簡單的使用,明天我們來示範一些比較進階的使用方式。


上一篇
Day25 什麼是 telepresence ?
下一篇
Day27 怎麼使用 telepresence ? -2
系列文
k8s 生態鏈 完美組合30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言