owned this note changed 2 years ago
Linked with GitHub

Build a CI/CD platform with Tekton - 郭孟坤 (Mansun Kuo)

歡迎來到 DevOpsDay Taipei 2023 共筆

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

共筆入口:https://hackmd.io/@DevOpsDay/2023
手機版請點選上方 按鈕展開議程列表。

講師背景

資料科學, 資料工程師

Preface

  • 介紹部門

    • 大數據, 機器學習
    • 大約 800 人左右 (Global)
  • DevOps in SMAI

    • Platform for cloud resources
    • Communities of volumteers
      • ci/cd
      • ut
      • static code analysis
      • monitoring
      • devops metrics
      • cicd platform for python
  • 案例

    • 建立一個 CI/CD pipeline
    • 新專案有新需求, 這時沒問題
    • 一次來十個專案, 只有一個人做, 覺得累又疲倦
  • DevOps 狀態

  • 案例(接續)

    • 換公司, 錄影片, 給其他同事看, 減少重工
    • 其他人來詢問
    • 更多人來詢問(被問倒了)
  • What happened

    • 知識傳遞速度不如預期
    • CI/CD 越來越複雜(光環境就分測試、開發、正式環境), 要做的事情越來越多
  • What is a Platform

  • DevOps Type3

Tekton in a nutshell

  • What is Tekton

    • Cloud native 解決方案, 適用於 CI/CD
    • Scalable, serverless, cloud-native
    • Google, RedHat, IBM 都推薦使用
    • 供應鏈安全(Supply chain security)
  • 誰建議使用

    • 在公有雲/私有雲環境想找 Cloud-native 方案
    • 有 OpenShift, IBM Cloud 的公司
  • Tekton Pipeline

    • Step : 最小工作單元
    • Task:
      • 定義多個 step, 接續執行
      • A pod with entrypoint override
    • Pipeline:
      • 組合 Task (DAG)
      • 用 retry, when, finally 來控制
    • Workspace: k8s Volume
    • Result: k8s termination message (4096 byte, 執行結束的訊息)
    • Tekton CI/CD pipelines and tasks overview
  • TaskRuns and PipelineRuns

    • 依照 task/pipeline 的內容執行
  • Trigger and EventListener

    • Event Listener
    • Interceptor
    • Trigger Binding : 透過 JSONPath
    • Trigger Template
  • 功能

    • Dashboard : 預設為 read-only
    • CLI
    • Hub : Tasks, Pipelines 範本

CI/CD Platform for Python

  • In the Beginning
    • 最佳的練習機會
    • 避免重新造輪子
  • Why Tekton
    • 在 yaml 就可以調整
    • 在 OpenShift 預設就有
  • 介紹自己的 Platform
    • code
      • Bitbucket
    • Test&SCA
      • pytest
      • pylint
      • black
    • Artifact
      • Artifact registry
      • JFrog
    • Add-on
      • Email
      • build status
      • metadata
    • registration
      • UI > API > worker <-> Meta
    • CI/CD Pipeline
      • Git Repo (Bitbucket)
    • unittest
    • code review
    • push-based gitops
    • feature flag (程式要放在哪個 branch)
  • conteriner
    • 因 Docker socket 會資安問題, 改用 Kaniko
    • 多了驗證跟資源管理機制
    • 記憶體使用略高
  • 注意事項
    • RBAC
    • task 限制:魔改 container, 因此沒有提供 image 的 command 會執行失敗
    • 內部執行會有憑證問題 (x509 Certificate)

Key Takeaways

  • Build a CI/CD platform
  • Introduce a new thing to uour team
  • 主要還是要看工具能夠解決什麼問題, 而不是只單純說想使用這個工具
Select a repo