在 Kubernetes 中列出 Service 下的所有 Pod

cover

Kubernetes (簡稱 k8s) 中,Service Endpoint(服務終端點)是一個抽象的概念,代表著一個服務的網絡位置。它是一個內部或外部的 IP 地址,可以用來訪問運行在 Kubernetes 集群中的應用程序服務。而如何在 Kubernetes 中列出 Service 下的所有 Pod 呢?這篇文章將會介紹如何使用 kubectl 來列出 Service 下的所有 Pod。

[Read More]

設計流程及系統架構圖好工具 D2

cover

在之前寫過一篇『三款好用的繪圖工具來解決系統架構或流程圖』,內文介紹了 PlantUML、Diagrams 及 Excalidraw 三套不同的工具,而本篇要來介紹一套用 Go 語言寫的工具 D2: Declarative Diagramming,這套工具可以讓你使用簡單的語法來繪製系統架構圖或流程圖,並且可以將圖片轉換成 SVG 或 PNG 格式。在介紹之前,我來講講為什麼要用這些流程圖工具,對工作上或團隊內部有什麼優點?

[Read More]

軟體工程師會被 AI 取代嗎?

Cover

看了 HackBear 泰瑞剛發佈的影片『我要被AI取代了嗎?』,今年火熱的 ChatGTP 已經是軟體工程師每天需要用到的工具了,但是這個工具真的會取代軟體工程師嗎?我們來看看影片內容。

看完影片後,自己想想有哪些事情是不會被 AI 取代的,大家也不用害怕 ChatGPT,而是要善用 AI 帶來的好處,讓自己的工作更有效率。

[Read More]

網路服務 SaaS、PaaS 和 IaaS 的差異

cover

一般來說,開發的應用程式可以部署在 SaaS、PaaS 或 IaaS 平台上。這些平台都是雲端運算的不同模式,可以根據自己的需求來選擇最適合自己的模式。本文將介紹 SaaS、PaaS 和 IaaS 的差異。根據團隊成員組成來決定要用什麼平台,這對於新創團隊來說是非常重要的議題。像是如果團隊有熟悉 Linux 維護的同仁,可以選擇像是 LinodeDigitalOcean 這類的 IaaS 服務,如果團隊有熟悉 Heroku、Google App Engine 這類的 PaaS Linode 是一個 IaaS (Infrastructure as a Service) 提供商,它提供了虛擬化的硬體環境,使用者可以在這個環境中建立虛擬機器和存儲裝置。使用者需要負責管理這些虛擬機器和存儲裝置,包括安裝和維護作業系統和應用程式。因此,Linode 可以歸類在 IaaS 的範疇。我個人就很常使用 Linode

[Read More]

Compiling multi-architecture images with Docker BuildKit using Drone CI/CD

cover

In 2020, Docker announced support for multi-architecture images, and later, Docker BuildKit officially supported multi-architecture images. This article introduces how to use Drone CI/CD with Docker BuildKit to compile multi-architecture images, and this feature is free and does not require a paid Docker Hub account. However, the Drone Docker Plugin provided by Drone CI/CD does not currently support multi-architecture images, so you need to write your own Drone Pipeline to achieve our goal. The official website has also proposed this proposal: ‘Support cross-arch Docker builds within Docker using QEMU’ to achieve this goal, using QEMU. The key point is to use Docker BuildKit to complete it under the environment where the Host supports Qemu.

[Read More]

用 Drone CI/CD 搭配 Docker BuildKit 編譯多架構映像檔

cover

在 2020 年就有 Docker 宣布支援多架構映像檔,後來才有正式的 Docker BuildKit 支援多架構映像檔,這篇文章來介紹如何使用 Drone CI/CD 搭配 Docker BuildKit 編譯多架構映像檔,而且這個功能是免費的,不需要付費的 Docker Hub 帳號。但是在 Drone CI/CD 官方提供的 Drone Docker Plugin 目前是不支援多架構映像檔,所以需要自己撰寫 Drone Pipeline,來達到我們的目的,官方也有人提出了這樣的 Proposal: 『Support cross-arch Docker builds within Docker using QEMU』,使用 QEMU 來達成目的,底下來介紹如何使用,關鍵點就是在 Host 支援 Qemu 的環境下,使用 Docker BuildKit 完成。

[Read More]

用 ChatGPT 幫忙進行 Code Review 給建議

Cover

上一篇文章我們介紹了如何使用 ChatGPT 來自動生成 Commit Message,這篇文章來介紹如何使用 ChatGPT 來進行 Code Review。在月初開發的 CodeGPT 已經讓開發者可以使用 GPT-3.5-Turbo 來進行生成 Commit 總結,這個功能省下開發者不少整理開發內容時間,但是我覺得還是不夠,大家除了開發外,還花了很多時間在進行 Code Review,所以如果有工具,可以讓開發者可以提前知道優化的項目,這可以省下不少 Review 的時間。

[Read More]

用 ChatGPT 自動幫開發者產生 Commit Message

Cover

相信大家對 ChatGPT 不會很陌生,這是目前在生成式人工智慧 (AIGC: AI Generated Content) 內的當紅炸子雞,然而 ChatGPT 對於軟體工程師有什麼影響呢?能否透過 ChatGPT 改善團隊流程或協助開發?而我現在想到最直接的就是用 ChatGTP 幫忙寫 Git Commit Message,然而怎麼把 Commit Message 寫好可以參考這篇文章,為了能達成這目的,我用 Go 語言寫了一個 CLI 工具 CodeGPT (請大家幫忙分享),來協助軟體工程師整理開發內容。底下先看看使用 CodeGPT 來產生 Commit Message 的成果:

[Read More]

Automated solution for updating running Docker containers - watchtower

CI

Nowadays, most of us have containerized our services, and effectively managing and upgrading containers without affecting existing services is a critical issue. Two steps are required in the CI/CD process: first, packaging the environment as a Docker image and uploading it to the company’s private Docker registry; and second, after the upload is complete, possibly connecting to the machine via SSH, pulling the new image, and restarting the running service via the Graceful Shutdown mechanism. You can learn more about Graceful Shutdown in this article. I am going to introduces Watchtower, a brand new tool that automatically upgrades and updates running containers, allowing for further CD process streamlining. Developers only need to upload the Docker image, and the remote servers can update the running container automatically.

[Read More]