SRE Conference
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 從單體到容器化的導入之路 - 李太毓 (Danny) ###### tags: `2023` {%hackmd @sre-conf/H1pCafrG3 %} ## 導入流程:DevSecOps ### 測試 - Dockerfile建置 - CI/CD Pipeline流程建置 - 部署服務至測試環境 - EKS ### 評估 - 壓力測試 (CPU/Memory) - 監控 - Log collection - penetration Testing ### 生產 - 部署服務至生產環境EKS - Monitoring, Alert ## 容器基本安全 - Dockerfile的指定使用者不建議使用root(建議使用rootless),否則會有許多潛在的提權風險 - Docker Port 別對外 - config 不要放在 Dockerfile 中 ### 可能遭遇問題 - 本地的 Core 與虛擬的 Core 不同導致無法建制 讀者補充:Docker build的時候可以指定指令集 ``` docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 ``` ## 目前CI/CD Pipeline ``` Github -> Jenkins ->(build image)AWS Codebuild ->(Push Image)AWS ECR ->(Pass Test)Ansible ->(Pull/Run)AWS EC2 ``` ## 容器化優勢與劣勢 優勢: 1. 容易移植 - 可以移植到相同核心不同系統環境上運行 2. 快速部署 - 劣勢: - 容器的安全性問題,設置不當會有數據洩漏,容器脫離之問題 K8S 組成:https://kubernetes.io/docs/concepts/overview/components/ 建立 EKS Cluster 注意 - VPC 網路 - RBAC 權限 - AWS 使用權限可以沿用到 Kubernetes 上 - Kubernetes 版本 - 技術困難:太多 know How --- 聊天區 是不是覺得太簡單了? 對 == :D ٩(ˊᗜˋ*)و 這些不是 terraform 或是 IaC 工具建立完就好了 前面多了很多 Container 和 EKS 暫時感受不到 SRE 的關聯 本來期待他會分享 Deployment 或是 Routing 的策略 -> 這個是說 K8s 的 Deployment 嗎? -> 對 4 ~~幹嘛不用Docker Compose還比較快,一次建多個容器~~ -> 為了方便管理嗎?(目前還在學習不確定) ->比較快,如果在本機啟動,其實不需要割雞焉用牛刀,直接起的 Docker Compose 會快很多 -> 了解,感謝您解惑 -> 也可以使用 minikube, k0s --> 推kind、k3d ---> 目前我是使用 kind , Kubeadm 跟 kwok(我是發問方便管理那位) -> k3s也不錯 通常local開發是用docker-compose prod會上k8s用helm或kustomize 比較會想知道ELK跟grafana監控與管理 好奇問問在座大神,若想要了解K8S,但工作上很少碰到,有建議往哪些地方下手嗎? -> 買課程看 --> Udemy 的推推,我自己在學的時候還有摸過[這個](https://github.com/kelseyhightower/kubernetes-the-hard-way),讓我更了解k8s的運作架構,但不確定好不好 -> YT有不少教程,可以找找,但建議最好先有Docker/Podman的概念(我自己是用Podman就是了) -->推個YTer,他的講解都不錯(https://www.youtube.com/@TechWorldwithNana),然後如果你不介意的話也可以去對岸的B站看相關的課程,那邊超多教學相關資源 ->有聽說可以使用Rancher -->可以,不過Rancher會建議搭配K3s/K3d使用,同系統會更好 -> Rancher是個K8s叢集共管的軟體,建置他們有推出rke跟k3s ->我不是大神,不過自學這塊比較難,我 2021 有寫鐵人賽你要不要參考看看, 不過 EKS 版本更新很快,有些是不能參考的 [關於我幫新公司建立整套部屬流程那檔事](https://ithelp.ithome.com.tw/users/20141518/ironman/4653?page=3) --https://www.udemy.com/course/learn-kubernetes/ (也很推這個老師的其它CKAD/CKA課程) Docker 入門推薦一下文章 - [Docker Container 基礎入門篇 1](https://medium.com/@azole/docker-container-%E5%9F%BA%E7%A4%8E%E5%85%A5%E9%96%80%E7%AF%87-1-3cb8876f2b14) - [Docker Container 基礎入門篇 2](https://medium.com/@azole/docker-container-%E5%9F%BA%E7%A4%8E%E5%85%A5%E9%96%80%E7%AF%87-2-c14d8f852ae4) 我來推薦幾個課程好了 Docker : https://www.udemy.com/share/101WlG3@2FRRyWeYEpowDNphxEKw26FwQ3aOzH_kjnyY7XZ9JfH1WmNZdan9YJOdyF1PXRjq/ K8s小白:https://www.udemy.com/share/101to43@UUbiNymja-kHGiilMmAdduRh3agzS9pbwbwUBhs972OVLB88kQMet8DHgrK_vJKW/ 如果你是開發者:https://www.udemy.com/share/101Eno3@JZ9bevC_vYBg_ypBfU5zIr2gB1TtJC9-Nbw0J0ASpSzajRjVsXwMGWwDr4iTZS9U/ 如果你是IT:https://www.udemy.com/share/101Xtg3@Ds8hPYGyh58KAvf-3gQbXTfyAN2wnLkWmG1oQR_XGlmkfQwWYnp70DS9BTX7GT_3/ 如果你寫Java,而且想學微服務:https://www.udemy.com/share/101Hw83@hbxZITh21eqbRuiIRxEHUXHTWajoM5NTaRv09w_tVbokJWAVwGUUYbk1WUinCwqW/ 學完真的可以練習一下就去考CKAD跟CKA -> 目前正在學習,想詢問這個東西對於後續實戰或是面試幫助會很大嗎? --> 這部分更多是靠自己實戰經驗,證照是個輔助 --> 對面是可能有幫助,我會問面試者一些基本的問題,但實戰真的是靠經驗,但沒有基礎,你會不知道從哪開始查問題 -> 所以就是讓你了解基本功能與基礎故障排除等等,但應用實戰面還是要經驗對吧? --> 對,變化千百種啊,所以其實早上的課程很有幫助,維運非常需要工具、可視化、經驗來輔助。而且當你面對一堆AP的開發者...人的問題也很麻煩(證據說話) ---> 感謝說明! 初學者可以用用看雲的k8s會比較容易上手 自建可以考慮rancher的rke或是openshif 不過雲的k8s通常都被雲端業者魔改過 所以想學原汁原味的K8s可以用kubeadm建 -> 我也建議可以參考一下Canonical 的Juju建置 charmed k8s,資料奉上:https://ubuntu.com/kubernetes/docs/quickstart -> 有 Cloud(魔法小卡)的話 kops 也不錯的 自建openshift? -> 基礎開發者版免費,註冊Red Hat帳號就有,基本上照著官方教學或是YT教學絕對不會錯,但不建議新手入門,新手建議先從K3s/K3d, minikube/kind這類基本K8s叢集入手會更好 openshift有社群版(OKD) 原來如此,感謝解惑 其實講knowhow應該可以隨便就30分鐘 突然覺得自己好像平時在搞核子武器 -> 😂 -> 為啥說是核武? -> 因為搞很多"有趣"的東西吧?XDDD -> 跟這個比起來能讓一家香港的銀行所有服務都在 AWS 上的 K8S 上跑應該算核子武器吧

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully