Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Lab: GitOps with GitLab and K8s

Lab: GitOps with GitLab and K8s

(簡報備存,Lab: GitOps with GitLab and K8s @ iThome Cloud Edge Summit 2022 | 2022/07/26)

GitLab 自 2022 年 5 月進入 15 版之後,原廠最新的 Slogan 為 The One DevOps Platform,意指除了過去大家熟知的 Git、CI/CD 功能之外,GitLab 已經是一個完整將 DevOps 核心概念融入其中的 DevOps 平台。

在這場 90 分鐘的 Lab,講師將帶領各位學員快速的體驗在 GitLab 上實作一個簡單的 GitOps;原來 GitOps 並非是遙不可及的未來,而是一個你我都該了解的 DevOps / IaC 當前趨勢。

課程目標
• 認識 IaC 與 DevOps 的熱門趨勢 - GitOps
• 快速以 GitLab 實作一個簡單的 GitOps,體驗何為 GitOps 

Cheng-Wei Chen

January 21, 2023
Tweet

More Decks by Cheng-Wei Chen

Other Decks in Technology

Transcript

  1. None
  2. Photo by Abele Gigante on Unsplash Cheng Wei Chen @

    iThome Cloud Sumit 2022 Lab: GitOps with GitLab and K8s
  3. Cheng Wei Chen 陳 正瑋 Athemaster 炬識科技 / Technology Consultant


    《Effective DevOps 中⽂版》譯者、GitLab Hero http://chengweichen.com
  4. Agenda ‧GitOps 簡介 ‧解說 Lab 的案例架構 ‧講師案例示範及學員實作 ‧結語

  5. STORY

  6. Commit Code OK! Dev Ops Deploy Code 炸 炸 炸

  7. Commit Code OK! Dev Ops Deploy Code 炸 炸 炸

    啊~我忘了說有⼀個新的 Con fi
  8. Commit Code OK Again ! Dev Ops Code Deploy 炸

    炸 炸 Again Again Again
  9. Commit Code OK Again ! Dev Ops Code Deploy 炸

    炸 炸 Again Again Again Ops 啊!我昨天有⼿動改了 ⼀個 Con fi
  10. Commit Code OK Again x2 Dev Ops Code Deploy 炸

    炸 炸 Again Again Again Agai Aga Aga 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸
  11. Commit Code OK Again x2 Dev Ops Code Deploy 炸

    炸 炸 Again Again Again Agai Aga Aga 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 炸 Infra Infra 有⼀些調整,忘了 跟你說~
  12. Provision Code Deploy Artifacts Production ⼀條龍 ⼯程師 Configuration

  13. Provision Code Deploy CI / CD Production ⼀條龍 ⼯程團隊 Configuration

    Automation
  14. Code Deploy CI / CD Production ⼀條龍 ⼯程團隊 Configuration Automation

    Ops / Infra 團隊 Provision
  15. Photo by Fancycrave on Unsplash GitOps 簡介

  16. GitOps = IaC + MRs + CI/CD GitLab 說的~

  17. GitOps = IaC + MRs + CI/CD Continuous Integration Continuous

    Delivery And Automation
  18. GitOps = IaC + MRs + CI/CD Merge Requests Change

    mechanism Code Review / Approvals
  19. 新 Issue Coding Commit CI/CD Pipeline 建立 Feature branch 測試驗收

    Feature branch Main branch Prod Pipeline 新 Issue Merge Merge Monitor Production branch Feedback Code Review CI/CD Pipeline
  20. GitOps = IaC + MRs + CI/CD Infrastructure as Code

    Git repository / VCS
  21. GitOps = IaC + MRs + CI/CD Infrastructure as Code

    ???
  22. GitOps = IaC + MRs + CI/CD 圖片來源 https://youtu.be/Usb9iUphT6Y

  23. GitOps = IaC + MRs + CI/CD 圖片來源 https://youtu.be/Usb9iUphT6Y

  24. 圖片來源 https://youtu.be/Usb9iUphT6Y GitOps = IaC + MRs + CI/CD

  25. GitOps = IaC + MRs + CI/CD 圖片來源 https://youtu.be/Usb9iUphT6Y

  26. GitOps = IaC + MRs + CI/CD 圖片來源 https://youtu.be/Usb9iUphT6Y

  27. App Infra Worker 1. App 有更新嗎? 2. infra 有更新嗎? 3.有!執⾏異動!

    PULL or PUSH
  28. App Infra Worker 1-1. App 有更新,該做事了! 1-2. infra 有更新,該做事了! 2.收到!開始執⾏異動!

    PULL or PUSH
  29. Photo by Fancycrave on Unsplash 實作練習

  30. DEMO

  31. Photo by Fancycrave on Unsplash 結語

  32. Tools VCS CI CD Container Registry CM IaC Container orchestration

    14.x 15.x
  33. 資料來源 https://gitlab.com/gitops-demo/readme

  34. GitOps = IaC + MRs + CI/CD DevOps

  35. GitOps = IaC + MRs + CI/CD GitOps is IaC

    done right !
  36. DevOps, then GitOps !

  37. GitOps is not for everyone ! (with K8S) ⽔很深請⼩⼼

  38. Photo by Fancycrave on Unsplash 如何開始實踐 GitOps

  39. 1. IaC 2. Automation 3. Code Review & Approve 4.

    Multi environment 5. CI/CD 6. Use Repository 7. Agile & Iteration
  40. 1. IaC 2. Automation 3. Code Review & Approve 4.

    Multi environment 5. CI/CD 6. Use Repository 7. Agile & Iteration DevOps
  41. 1. IaC 讓⼀切都成為 Code

  42. 2. Automation 盡可能⾃動化 如果不成,就紀錄它!

  43. 3. Code Review & Approve 審查、複閱、檢查、稽核

  44. 4. Multi environment 運⽤在所有的環境!

  45. 5. CI/CD ⾃動化的唯⼀觸發點!

  46. 6. Use Repository 分⽀策略、Flow、Workflow

  47. 7. Agile & Iteration ⼩粒度、多迭代