微服務架構郵件系統之 Kubernetes 與 GitOps 維運
顯示簡易詮釋資料 統計資料| 欄位 | 內容 | 語言 |
|---|---|---|
dc.catalog.0080 |
261124 | |
dc.catalog.00818 |
a | |
dc.catalog.00818 |
d | |
dc.catalog.00818 |
| | |
dc.catalog.00818 |
| | |
dc.catalog.0087 |
2026 | |
dc.catalog.020 |
平裝 | |
dc.catalog.041 |
chi | |
dc.catalog.041 |
eng | |
dc.catalog.300c |
30 | |
dc.contributor.advisor |
王昱舜 | |
dc.contributor.advisor |
Wang, Yu-Shuen | |
dc.contributor.author |
呂宗哲 | |
dc.contributor.author |
Lu, Tsung-Che | |
dc.contributor.campus |
光復 | |
dc.contributor.college |
資訊學院 | |
dc.contributor.committee |
王昱舜 | |
dc.contributor.committee |
陳昌盛 | |
dc.contributor.committee |
蔡孟勳 | |
dc.contributor.committee |
謝秉均 | |
dc.contributor.committee |
Wang, Yu-Shuen | |
dc.contributor.committee |
Chen,Chang-Sheng | |
dc.contributor.committee |
Tsai, Meng-Hsun | |
dc.contributor.committee |
Hsieh, Ping-Chun | |
dc.contributor.department |
資訊科學與工程研究所 | |
dc.contributor.idpcode |
3551 | |
dc.contributor.studentid |
312551018 | |
dc.date.NCLavailable |
2026/09/18 | |
dc.date.USTavailable |
2026/09/18 | |
dc.date.issued |
2026 | |
dc.date.issuedROC |
115 | |
dc.date.paperavailable |
立即公開 | |
dc.date.schoolyear |
115 | |
dc.description.abstract |
系級郵件服務屬長期運作且高度依賴穩定性的基礎設施,設定錯誤可能造成信件遺 失、拒收或送達率下降。國立陽明交通大學資工系資訊中心的郵件系統由收信、寄信 認證、對外轉送、投遞路由、信箱儲存、垃圾信過濾、負載平衡等16 個功能角色組成, 角色間具嚴格的郵件流程依賴。原以多台VM 與Docker Compose 部署,每次映像更新 或設定變更均需逐機SSH 操作,節點故障缺乏自動復原機制,設定分散於各主機而難 以稽核。 本研究將此系統完整遷移至Kubernetes,並以GitOps 建立可自動化、可追蹤、可回 溯的維運流程。網路層以Calico IPPool 搭配proxy ARP 直接為Pod 指派可路由位址,使 各角色保有與既有MX、SPF、PTR 記錄對齊的穩定對外身份;儲存層以NFS PV 承載 信箱資料,local-path PVC 滿足佇列與資料庫的低延遲需求;投遞路由以啟動閘門等待 成員名錄穩定,解決Dovecot Director 於容器環境下路由環不完整所引發的投遞服務異 常與信箱鎖競爭;GitLab CI 與Flux CD 構成自映像建置至部署的自動化閉環,設定以 Kustomize base/overlay 管理,並由持續協調(reconcile)系統性偵測設定漂移。遷移採 分階段策略,各階段先於測試區驗證功能正確性,再切換生產區。 評估結果顯示:16 個服務角色完整遷移並保留端到端郵件收發路徑;映像更新與設 定變更可全程經 Git 自動完成;分階段策略於正式切換前暴露並修復九項跨元件設定 缺漏。最貼近維運人力的發現為:最耗費人力的兩項操作——服務映像更新與副本擴充 ——由舊架構逐機人工的分鐘至十分鐘級,降至自動化流程的秒級,其結構性原因在於 將「隨機台數線性重複」的建置動作收斂為「單次攤提、產物可重複使用」。資源用量 則呈非對稱變化:總 RAM 用量較舊架構下降約 51%,總 CPU 用量反而上升約 4 倍, 惟其中郵件角色本身僅增加約6%,增量幾乎全數來自平台元件,顯示容器化的資源效 益具面向特定性,不可一概而論。本研究並自實作提煉三項可轉移的設計原則:以位 址池為有狀態後端提供穩定對外位址、以分階段整合測試作為切換前系統性暴露缺漏 的策略,以及以GitOps 持續協調作為設定漂移的偵測機制。本研究之評估以功能驗收 i 為主軸,未進行含MTTR 在內的量化效能比較;方法適用於節點與上層路由器具備L2 鄰接性的自建機房環境,完整之限制與適用條件見第四章與第六章。 | |
dc.description.abstract |
An institutional mail service is long-running, availability-critical infrastructure where con- figuration errors can cause message loss, delivery failures, or degraded deliverability. At the Information Technology Center, Department of Computer Science, National Yang Ming Chiao Tung University, the mail system comprises 16 specialized roles —inbound MX reception, sub- mission authentication, outbound relay, delivery routing, mailbox storage, spam and antivirus filtering, and load balancing —with strict inter-role dependencies spanning the full mail flow. Historically deployed as Docker Compose stacks on dedicated VMs, every image update or configuration change required host-by-host SSH intervention, node failures lacked automatic recovery, and configuration state drifted silently across machines. This thesis presents a complete migration of the system to Kubernetes, with an operations model centered on GitOps. At the networking layer, Calico IP pools with proxy ARP assign routable Pod addresses directly, preserving external identities aligned with existing MX, SPF, and PTR records. At the storage layer, NFS-backed PersistentVolumes hold mailbox data while local-path volumes serve latency-sensitive spools and databases. A startup gate that waits for member-list stabilization resolves the two distinct failures that an incomplete Dovecot Director ring induces under container scheduling —routing inconsistency that disrupts delivery, and lock contention from concurrent writes to the same mailbox. GitLab CI and Flux CD form an auto- mated build-to-deploy loop; configuration is organized as Kustomize base/overlays, with drift detected systematically through continuous reconciliation. Migration proceeded in stages, with each stage validated in a test zone before production cutover. Results confirm that all 16 roles were migrated with the end-to-end inbound and outbound mail paths preserved, that image and configuration changes flow entirely through Git without manual intervention, and that the staged rollout exposed and fixed nine cross-component con- figuration defects before cutover. The most operator-facing outcome is that the two most labor- iii intensive tasks —image updates and replica scaling —fall from minutes or tens of minutes of per-host manual work to seconds of automated flow, an order-of-magnitude difference driven structurally by collapsing per-machine repetition into a build-once, reuse-many pipeline. The resource footprint changed asymmetrically: aggregate memory usage fell by roughly half while aggregate CPU usage rose roughly four-fold, although the mail roles themselves grew by only about 6% and the increase comes almost entirely from platform components, showing that the resource case for containerization is dimension-specific rather than uniform. Three transferable design principles are distilled from the implementation: pool-based IPAM for address-stable stateful backends, staged integration testing as a systematic pre-cutover defect-exposure strat- egy, and GitOps continuous reconciliation as a mechanism for configuration-drift detection. The evaluation focuses on functional and operational verification; quantitative performance comparison, including MTTR, is left to future work, and the approach targets on-premises en- vironments with L2 adjacency between nodes and upstream routers (see Chapters 4 and 6 for full limitations and applicability conditions). | |
dc.description.abstractopendate |
2026/09/18 | |
dc.description.degree |
碩士 | |
dc.description.tableofcontents |
中文摘要................................................................................................................................. i 英文摘要................................................................................................................................. iii 目錄......................................................................................................................................... v 圖目錄..................................................................................................................................... viii 表目錄..................................................................................................................................... x 第一章 緒論(Introduction).............................................................................................. 1 1.1 研究方法與貢獻...................................................................................................... 2 1.2 論文架構.................................................................................................................. 4 第二章 背景與相關工作(Background and Related Work)............................................ 5 2.1 有狀態郵件系統與高可用需求.............................................................................. 5 2.2 容器編排:從Docker Compose 到Kubernetes..................................................... 6 2.3 GitOps 與宣告式維運............................................................................................. 7 2.4 可路由的Pod 網路與網路政策............................................................................. 9 2.5 容器化環境的日誌收集.......................................................................................... 10 2.6 有狀態系統遷移與本研究定位.............................................................................. 11 第三章 系統設計與遷移實作(System Design and Migration)...................................... 12 3.1 系統概觀與基礎部署設計...................................................................................... 12 3.2 可路由的Pod 網路身份......................................................................................... 14 3.2.1 封包路徑設計................................................................................................. 15 3.2.2 位址配置機制之選擇..................................................................................... 15 3.2.3 與既有設定之整合......................................................................................... 16 3.3 有狀態服務的連續性:投遞路由與信箱資料...................................................... 17 3.3.1 投遞路由的啟動閘門設計............................................................................. 17 3.3.2 信箱資料的一致性邊界................................................................................. 18 3.4 貼合郵件流的最小權限網路政策.......................................................................... 19 3.4.1 政策圖之設計................................................................................................. 19 3.4.2 收斂時機與所暴露之依賴............................................................................. 20 3.5 低開銷的集中式日誌收集...................................................................................... 20 3.5.1 以節點為單位的收集架構............................................................................. 20 3.5.2 共享通訊端所衍生的來源辨識問題............................................................. 21 3.6 分階段遷移與GitOps 維運閉環............................................................................ 22 3.6.1 共用結構作為GitOps 的前提....................................................................... 22 3.6.2 分階段順序的設計理由................................................................................. 23 3.6.3 切換設計與可回溯性..................................................................................... 24 第四章 部署與評估(Deployment and Evaluation)......................................................... 26 4.1 實測環境與運行情境.............................................................................................. 26 4.2 遷移後之郵件功能與對外身份.............................................................................. 27 4.2.1 對外網路身份................................................................................................. 27 4.2.2 端到端郵件路徑............................................................................................. 28 4.3 分階段遷移所暴露之缺漏...................................................................................... 29 4.3.1 捕獲能力受環境覆寫差異所限..................................................................... 30 4.4 GitOps 閉環與維運成本......................................................................................... 30 4.4.1 閉環之運作與叢集穩態................................................................................. 31 4.4.2 集中式日誌所支撐的可觀測性..................................................................... 31 4.4.3 維運流程之改變............................................................................................. 32 4.4.4 流程改變之實測量級..................................................................................... 34 4.5 資源用量之非對稱變化.......................................................................................... 35 4.6 評估方法之限制...................................................................................................... 36 第五章 經驗與設計原則(Lessons Learned and Design Principles).............................. 38 5.1 三項可轉移設計原則.............................................................................................. 38 5.1.1 以位址池取代逐Pod 靜態位址指定............................................................ 38 5.1.2 分階段順序安排以主動暴露跨元件缺漏..................................................... 39 5.1.3 以持續協調取代人工巡查維持設定一致性................................................. 39 5.2 工程陷阱與遷移檢查清單...................................................................................... 39 5.3 對維運人力成本的意涵.......................................................................................... 41 5.4 自動化閉環所集中的信任...................................................................................... 41 第六章 結論(Conclusion)............................................................................................... 43 6.1 研究成果.................................................................................................................. 43 6.2 研究限制與適用範圍.............................................................................................. 44 6.3 未來工作.................................................................................................................. 45 6.4 結語.......................................................................................................................... 46 參考文獻................................................................................................................................. 47 附錄......................................................................................................................................... 51 1 Kustomize 目錄結構範例.......................................................................................... 51 2 GitLab CI 建置範例(buildah)............................................................................... 51 3 Calico IPPool 配置範例(production).................................................................... 52 4 NetworkPolicy 流量規則摘要................................................................................... 52 | |
dc.format |
||
dc.identifier.citation |
[1] P. V. Mockapetris, “Domain Names — Implementation and Specification,” Internet Engi- neering Task Force, RFC 1035, 1987. [2] S. Kitterman, “Sender Policy Framework (SPF) for Authorizing Use of Domains in Email, Version 1,” Internet Engineering Task Force, RFC 7208, 2014. [3] Flux CD Authors, “Flux: The GitOps family of projects,” https://fluxcd.io/, 2024, ac- cessed: May 2026. [4] M. H. Hasan, M. H. Osman, N. Admodisastro, and S. Muhammad, “Legacy systems to cloud migration: A review from the architectural perspective,” Journal of Systems and Software, vol. 202, p. 111702, 2023. [5] D. Sokolowski, “Infrastructure as code for dynamic deployments,” in Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foun- dations of Software Engineering (ESEC/FSE). ACM, 2022, pp. 1775–1779. [6] R. K. Yin, Case Study Research and Applications: Design and Methods, 6th ed. SAGE Publications, 2018. [7] Kubernetes Authors, “Kustomize: Kubernetes native configuration management,” https: //kustomize.io/, 2024, accessed: May 2026. [8] J. C. Klensin, “Simple Mail Transfer Protocol,” Internet Engineering Task Force, RFC 5321, 2008. [9] M. Crispin, “Internet Message Access Protocol — Version 4rev1,” Internet Engineering Task Force, RFC 3501, 2003. [10] J. G. Myers and M. T. Rose, “Post Office Protocol — Version 3,” Internet Engineering Task Force, RFC 1939, 1996. 47 [11] D. Crocker, T. Hansen, and M. Kucherawy, “DomainKeys Identified Mail (DKIM) Signa- tures,” Internet Engineering Task Force, RFC 6376, 2011. [12] D. Karger, E. Lehman, T. Leighton, R. Panigrahy, M. Levine, and D. Lewin, “Consis- tent hashing and random trees: Distributed caching protocols for relieving hot spots on the World Wide Web,” in Proceedings of the Twenty-Ninth Annual ACM Symposium on Theory of Computing (STOC), 1997, pp. 654–663. [13] Dovecot Authors, “Dovecot director,” https://doc.dovecot.org/configuration_manual/ director/, 2024, accessed: May 2026. [14] ——, “Upgrading Dovecot CE from 2.3 to 2.4,” https://doc.dovecot.org/main/installation/ upgrade/2.3-to-2.4.html, 2026, accessed: July 2026; documents removal of Director in 2.4 (CE) / 3.x (Pro). [15] ——, “Lua Director | Dovecot CE,” https://doc.dovecot.org/main/howto/lua_director. html, 2026, accessed: July 2026. [16] B. Burns, B. Grant, D. Oppenheimer, E. Brewer, and J. Wilkes, “Borg, Omega, and Ku- bernetes,” ACM Queue, vol. 14, no. 1, pp. 70–93, 2016. [17] C. Carrión, “Kubernetes scheduling: Taxonomy, ongoing issues and challenges,” ACM Computing Surveys, vol. 55, no. 7, pp. 1–37, 2022. [18] J. Dobies and J. Wood, Kubernetes Operators: Automating the Container Orchestration Platform. O’Reilly Media, 2020. [19] T. A. Limoncelli, “GitOps: A path to more self-service IT,” ACM Queue, vol. 16, no. 3, pp. 13–18, 2018. [20] F. Beetz and S. Harrer, “GitOps: The evolution of DevOps?” IEEE Software, vol. 39, no. 4, pp. 70–75, 2022. [21] B. Yuen, A. Matyushentsev, T. Ekenstam, and J. Suen, GitOps and Kubernetes: Continu- ous Deployment with Argo CD, Jenkins X, and Flux. Manning Publications, 2021. [22] Flux CD Authors, “Flux image update automation,” https://fluxcd.io/flux/guides/image- update/, 2024, accessed: May 2026. 48 [23] M. Seyedkazemi Ardebili and A. Bartolini, “KubeIntellect: A modular LLM- orchestrated agent framework for end-to-end Kubernetes management,” arXiv preprint arXiv:2509.02449, 2025. [24] Tigera, Inc., “Project Calico: Cloud native networking and network security,” https://docs. tigera.io/calico/latest/, 2024, accessed: May 2026. [25] MetalLB Authors, “MetalLB: Load-balancer implementation for bare metal Kubernetes clusters,” https://metallb.universe.tf/, 2024, accessed: May 2026. [26] D. C. Plummer, “An Ethernet Address Resolution Protocol,” Internet Engineering Task Force, RFC 826, 1982. [27] T. Narten, E. Nordmark, W. Simpson, and H. Soliman, “Neighbor Discovery for IP Version 6 (IPv6),” Internet Engineering Task Force, RFC 4861, 2007. [28] Y. Rekhter, T. Li, and S. Hares, “A Border Gateway Protocol 4 (BGP-4),” Internet Engi- neering Task Force, RFC 4271, 2006. [29] G. Budigiri, C. Baumann, J. T. Mühlberg, E. Truyen, and W. Joosen, “Network policies in Kubernetes: Performance evaluation and security analysis,” in 2021 Joint European Con- ference on Networks and Communications & 6G Summit (EuCNC/6G Summit). IEEE, 2021, pp. 281–286. [30] S. Novianti and A. Basuki, “The performance analysis of container networking interface plugins in Kubernetes,” in Proceedings of the 6th International Conference on Sustainable Information Engineering and Technology (SIET). ACM, 2021. [31] The Kubernetes Authors, “Logging architecture,” https://kubernetes.io/docs/concepts/ cluster-administration/logging/, 2024, accessed: July 2026. [32] A. Barabanov and D. Makrushin, “Security audit logging in microservice-based systems: Survey of architecture patterns,” arXiv preprint arXiv:2102.09435, 2021. [33] V. Velepucha and P. Flores, “Monoliths to microservices – migration problems and chal- lenges: A SMS,” in 2021 Second International Conference on Information Systems and Software Technologies (ICI2ST). IEEE, 2021, pp. 135–142. 49 [34] H. Dinh-Tuan and J. Jiang, “Optimizing stateful microservice migration in Kubernetes with MS2M and forensic checkpointing,” arXiv preprint arXiv:2509.05794, 2025. [35] B. Callaghan, B. Pawlowski, and P. Staubach, “NFS Version 3 Protocol Specification,” Internet Engineering Task Force, RFC 1813, 1995. [36] A. Melnikov and K. Zeilenga, “Simple Authentication and Security Layer (SASL),” Inter- net Engineering Task Force, RFC 4422, 2006. [37] J. Sermersheim, “Lightweight Directory Access Protocol (LDAP): The Protocol,” Internet Engineering Task Force, RFC 4511, 2006. [38] Dovecot Authors, “NFS — Dovecot documentation,” https://doc.dovecot.org/2.3/ configuration_manual/nfs/, 2026, accessed: July 2026; describes nolock as a “slightly unsafe optimization”. [39] Project Calico Authors, “GlobalNetworkPolicy does not distinguish between locally orig- inated and forwarded/natted traffic in ebpf mode (issue #7717),” https://github.com/ projectcalico/calico/issues/7717, 2024, accessed: July 2026. [40] R. Gerhards, “The Syslog Protocol,” Internet Engineering Task Force, RFC 5424, 2009. [41] P. Vixie, S. Thomson, Y. Rekhter, and J. Bound, “Dynamic Updates in the Domain Name System (DNS UPDATE),” Internet Engineering Task Force, RFC 2136, 1997. [42] P. Vixie, O. Gudmundsson, D. Eastlake, and B. Wellington, “Secret Key Transaction Au- thentication for DNS (TSIG),” Internet Engineering Task Force, RFC 2845, 2000. | |
dc.identifier.uri |
https://hdl.handle.net/20.500.14371/91083 | |
dc.language.iso |
中文 | |
dc.relation.page |
53 | |
dc.subject.keyword |
Kubernetes | |
dc.subject.keyword |
郵件服務 | |
dc.subject.keyword |
容器化 | |
dc.subject.keyword |
GitOps | |
dc.subject.keyword |
高可用性 | |
dc.subject.keyword |
Flux CD | |
dc.subject.keyword |
mail infrastructure | |
dc.subject.keyword |
containerization | |
dc.subject.keyword |
high availability | |
dc.title |
微服務架構郵件系統之 Kubernetes 與 GitOps 維運 | |
dc.title |
Kubernetes and GitOps Operations for Microservice-Based Mail Systems | en |
dc.type |
Thesis | zh-TW |
檔案
- NgdFVYFNh.pdf (2.07 MB, Adobe PDF)
所屬典藏: 資訊科學與工程研究所