O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

給 RD 的 Kubernetes 初體驗 (EKS version)

Simplified version for EKS (1.5 hr)

Kubernetes 是目前雲端環境的顯學。可是,傳統的程式,並不是原封不動搬上去,就能夠自動享受 Kubernetes 所宣稱的種種好處。
新的環境,不僅需要新的 Ops 思維,也需要新的 Dev 思維。我們將以一個半小時的時間,從軟體研發者的角度,探討軟體的設計該做哪些最起碼的改變,並體驗 Kubernetes 引進的新觀念及新效益。

  • Seja o primeiro a comentar

給 RD 的 Kubernetes 初體驗 (EKS version)

  1. 1. Technical Coach William Yeh 葉秉哲  給 RD 的 Kubernetes 初體驗 … with a series of hands-on labs 2019-09-11 EKS version
  2. 2. • PhD in Computer Science, NCTU, Taiwan • CSPO (Certified Scrum Product Owner) from Scrum Alliance • PSM I (Professional Scrum Master I) from Scrum.org • Technical manager @ Titansoft (since Mar 2019) • Server director & Scrum master @ Gogolook • Active speaker and trainer for software architecture, DevOps, agile, and theory of constraints
  3. 3. Containers Kubernetes Cloud Agenda
  4. 4. Containers Kubernetes Cloud Agenda Labs 1.0 — 3.0 4.0 — 5.0 6.0 — 7.0
  5. 5. Agenda Know promising trends Adopt gradually Prepare mindset Goals Containers Kubernetes Cloud Labs 1.0 — 3.0 4.0 — 5.0 6.0 — 7.0
  6. 6. EKS Setup🅐 a - Redeem “Promotional Credit” b - Set Cloud9 and credentials c - Create EKS cluster
  7. 7. Redeem “Promotional Credit”
  8. 8. Set Cloud9 and credentials http://bit.ly/eks-step2 Important!
  9. 9. Create EKS cluster http://bit.ly/eks-step3 Be patient...
  10. 10. Lab Setting�� Tag 1.0 2.0 3.0 4.0 5.0 6.0 7.0
  11. 11. Lab material See the demo first!
  12. 12. Lab material For each revision, pay attention to: 1. image versions 2. diff in code and configuration Use git diff --stat HEAD~1 HEAD to see diff between revisions. Tag 1.0 2.0 3.0 4.0 5.0 6.0 7.0
  13. 13. Image tags Lab # Frontend API 1.0 N/A N/A 2.0 N/A 2.0 3.0 3.0 3.0 4.0 3.0 3.0 5.0 5.0 3.0 6.0 auto auto 7.0 auto auto & stable
  14. 14. Kubernetes 4.0 - Local Kubernetes 5.0 - Configuration ��
  15. 15. https://kubernetes.io/
  16. 16. Lab # 4.0 Local Kubernetes
  17. 17. Lab # 4.0 git checkout 4.0 git log git diff --stat HEAD~1 HEAD
  18. 18. Image tags Lab # Frontend API 1.0 N/A N/A 2.0 N/A 2.0 3.0 3.0 3.0 4.0 3.0 3.0 5.0 5.0 3.0 6.0 auto auto 7.0 auto auto & stable
  19. 19. Concept gaps from Docker to Kubernetes
  20. 20. Container
  21. 21. Service container service pod deployment 3
  22. 22. container service . . . └── k8s ├── todoapi-service.yml └── todofrontend-service.yml Service
  23. 23. Service container service pod deployment --- kind: Service ... --- kind: Deployment ... spec: replicas: 3 template: # pod definition spec: containers: - name: todoapi image: todoapi:3.0 k8s/todoapi-service.yml
  24. 24. service deployment --- kind: Service ... --- kind: Deployment ... spec: replicas: 3 template: # pod definition spec: containers: - name: todoapi image: todoapi:3.0 k8s/todoapi-service.yml
  25. 25. container pod --- kind: Service ... --- kind: Deployment ... spec: replicas: 3 template: # pod definition spec: containers: - name: todoapi image: todoapi:3.0
  26. 26. Container
  27. 27. Pod Container Any examples?
  28. 28. • Shared volumes • IPC • Network Multi-Container Pods in Kubernetes Pod Container Multi-container pods and container communication in Kubernetes https://www.mirantis.com/blog/multi-container-pods-and-container-communication-in-kubernetes/
  29. 29. Deployment & Replica 3
  30. 30. pod --- kind: Service ... --- kind: Deployment ... spec: replicas: 3 template: # pod definition spec: containers: - name: todoapi image: todoapi:3.0 deployment
  31. 31. Selector & label 3 The selector field defines how the Deployment finds which Pods to manage. selector label
  32. 32. service deployment --- kind: Service ... --- kind: Deployment ... spec: replicas: 3 template: # pod definition spec: containers: - name: todoapi image: todoapi:3.0
  33. 33. Service label selector 3 --- kind: Service ... --- kind: Deployment ... spec: replicas: 3 template: # pod definition spec: containers: - name: todoapi image: todoapi:3.0
  34. 34. Recap
  35. 35. Service container pod deployment service 3
  36. 36. Service container service pod deployment --- kind: Service ... --- kind: Deployment ... spec: replicas: 3 template: # pod definition spec: containers: - name: todoapi image: todoapi:3.0 k8s/todoapi-service.yml
  37. 37. pod --- kind: Service ... --- kind: Deployment ... spec: replicas: 3 template: # pod definition spec: containers: - name: todoapi image: todoapi:3.0 deployment service container
  38. 38. Kubernetes Terminology Learn by doing!
  39. 39. Make sure you’re using local Kubernetes kubectl config view kubectl config get-contexts kubectl config use-context docker-for-desktop or kubectl config use-context minikube How to use kubectl to manage multiple Kubernetes clusters https://success.docker.com/article/how-to-use-kubectl-to-manage-multiple-kubernetes-clusters
  40. 40. Lab # 4.0 Review a. Architecture b. Main tasks c. Diff d. Tricks e. Questions?
  41. 41. CAUTION ● There’s one big issue in this Lab 4.0 Can you see? ● What if a image changes but version tag remains unchanged?
  42. 42. Lab # 5.0 Configuration
  43. 43. Lab # 5.0 git checkout 5.0 git log git diff --stat HEAD~1 HEAD
  44. 44. Image tags Lab # Frontend API 1.0 N/A N/A 2.0 N/A 2.0 3.0 3.0 3.0 4.0 3.0 3.0 5.0 5.0 3.0 6.0 auto auto 7.0 auto auto & stable
  45. 45. _v2 Service container pod deployment service Recap: containers as application packaging units 3
  46. 46. Lab # 5.0 Review a. Architecture b. Main tasks c. Diff d. Tricks e. Questions?
  47. 47. Cloud 6.0 - Cloud (EKS for example) 7.0 - Canary release ��
  48. 48. Lab # 6.0 Cloud (EKS for example)
  49. 49. Lab # 6.0 git checkout 6.0 git log git diff --stat HEAD~1 HEAD
  50. 50. Image tags Lab # Frontend API 1.0 N/A N/A 2.0 N/A 2.0 3.0 3.0 3.0 4.0 3.0 3.0 5.0 5.0 3.0 6.0 auto auto 7.0 auto auto & stable
  51. 51. Local/cloud diff - k8s/***/config.***.yml
  52. 52. Local/cloud diff - k8s/***/todoapi-service.yml
  53. 53. Local/cloud diff - k8s/***/todoapi-service.yml ID.dkr.ecr.region.amazonaws.com/todoapi
  54. 54. Local/cloud diff - k8s/***/todofrontend-service.yml
  55. 55. Local/cloud diff - k8s/***/todofrontend-service.yml ACCOUNT_ID.dkr.ecr.region.amazonaws.com/todofrontend
  56. 56. Skaffold skaffold.yaml cloud local
  57. 57. Lab # 6.0 Review a. Architecture b. Main tasks c. Diff d. Tricks e. Questions?
  58. 58. Lab # 7.0 Canary release
  59. 59. Lab # 7.0 git checkout 7.0 git log git diff --stat HEAD~1 HEAD
  60. 60. Image tags Lab # Frontend API 1.0 N/A N/A 2.0 N/A 2.0 3.0 3.0 3.0 4.0 3.0 3.0 5.0 5.0 3.0 6.0 auto auto 7.0 auto auto & stable
  61. 61. _v2 1 stable autoimage tag: 3
  62. 62. Stable/canary diff - k8s/***/todoapi-***.yml
  63. 63. _v2 Service label label 1 selector stable autoimage tag: 3
  64. 64. Lab # 7.0 Review a. Architecture b. Main tasks c. Diff d. Tricks e. Questions?
  65. 65. Conclusion��
  66. 66. app runtime OS kernel app runtime OS kernel app runtime OS kernel Recap: containers as application packaging units traditional deployment way container virtual machine
  67. 67. _v2 Service container pod deployment service label label 3 selector
  68. 68. Agenda Know promising trends Adopt gradually Prepare mindset Goals Containers Kubernetes Cloud Labs 1.0 — 3.0 4.0 — 5.0 6.0 — 7.0
  69. 69. Kubernetes Terminology “Kubernetes 101: Pods, Nodes, Containers, and Clusters” • Author: Daniel Sanche • Date: 2018-01-02 • URL: https://medium.com/google-cloud/kubernetes-101-pods-nodes-c ontainers-and-clusters-c1509e409e16 (or http://bit.ly/post-k8s-101 for short)
  70. 70. Not told today Session affinity https://medium.com/@diegomrtnzg/redirect-your-users-to-the-same-pod -by-using-session-affinity-on-kubernetes-baebf6a1733b StatefulSet https://godleon.github.io/blog/Kubernetes/k8s-StatefulSets-Overview / Persistent Volume & Claim https://godleon.github.io/blog/Kubernetes/k8s-PersistentVolume-Over view/
  71. 71. Next step? https://www.udemy.com/course/certified-kubernetes-application-developer/
  72. 72. Questions?
  73. 73. Attribution ● review by Alina Oleynik from the Noun Project

×