O slideshow foi denunciado.
Seu SlideShare está sendo baixado. ×

利用K8S實現高可靠應用

Mais Conteúdo rRelacionado

Audiolivros relacionados

Gratuito durante 30 dias do Scribd

Ver tudo

利用K8S實現高可靠應用

  1. 1. 利用 Kubernetes 實現 高可靠應用 alfieYFC inwinSTACK alfie.yfc inwinSTACK Alfie Chen 2017/11/21 alfie.c@inwinstack.com
  2. 2. Agenda World of Microservices Kubernetes for Beginners NodeRed Chatbot w/ K8S
  3. 3. World of Microservices Virtual Machines, Containers, etc.
  4. 4. App Development Changes • Huge Applications • Hours to Build • Huge Downtime • Microservices • Container Deployment • Independent Deployments • Fast Version Releases
  5. 5. What is Microservices? Kitchen Office Men’s Room Women’s Room Frontdesk Dining Area entrance
  6. 6. What is Microservices? Kitchen Office Men’s Room Women’s Room Frontdesk Dining Area entrance
  7. 7. Nginx (Reverse Proxy Service) Bootstrap (Front-end Framework) Rails (Web Framework) Sidekiq (Background Processing Framework) Redis (Storage) Postgresql (Database) Elastic (DB Search Engine) What is Microservices?
  8. 8. What is Microservices? Physical Server VM VM VM VM Hypervisor Physical Server Software Program 010101010101010 101010101010101 010101010101010 101010101010101 010101010101010 010101010101010 101010101010101 010101010101010 101010101010101 010101010101010 010101010101010 101010101010101 010101010101010 101010101010101 010101010101010 010101010101010 101010101010101 010101010101010 101010101010101 010101010101010
  9. 9. What is Microservices?
  10. 10. What is Microservices? Kitchen Office Men’s Room Women’s Room Frontdesk Dining Area entrance
  11. 11. What is Microservices? Physical Server Software Program Physical Server VM VM VM VM Hypervisor Physical Server Container Container Container Container Container Engine (Docker)
  12. 12. Kitchen Office Men’s Room Women’s Room Frontdesk Dining Area entrance What is Microservices? Kitchen Office Men’s Room Women’s Room Frontdesk Dining Area entrance Physical Server Container Container Container Container Container Engine (Docker)
  13. 13. Kubernetes for Beginners (kinda..)
  14. 14. Kubernetes Cluster Physical Server Minion kube-proxykubelet Pod Container Container Pod Container Pod Container Pod Container Container Physical Server Minion kube-proxykubelet Pod Container Container Pod Container Pod Container Container 10G Switch Network:172.24.0.0/24 Gateway:172.24.0.254 Physical Server Master Controller Manager etcdSchedulerAPI Server
  15. 15. Kubernetes Cluster Physical Server Minion kube-proxykubelet Pod Container Container Pod Container Pod Container Pod Container Container Physical Server Minion kube-proxykubelet Pod Container Container Pod Container Pod Container Container Physical Server Master Controller Manager etcdSchedulerAPI Server
  16. 16. Concepts & Terms • Controllers o Deployment (deploy) o Stateful Set o Daemon Set (ds) o Jobs https://kubernetes.io/docs/concepts/
  17. 17. Concepts & Terms • Deployment (deploy) o Stateless o Availability > Consistency o Web Frontends o Rolling Update
  18. 18. Concepts & Terms • Deployment (deploy) o Stateless o Availability > Consistency o Web Frontends
  19. 19. Concepts & Terms • Stateful Set o Persistent data o Availability < Consistency o Each has its own identity o Databases, Message queues
  20. 20. Concepts & Terms • Daemon Set o Background process o One pod per node o Node labels o Cluster storage, logs, node monitoring
  21. 21. Concepts & Terms • Jobs o Batch Pattern o Run in parallel o Run to completion (then exit) o Independent but related processes
  22. 22. NodeRed Chatbot w/ K8S Running FB RedBot containers as a Deployment
  23. 23. Why Chatbots? • Make the Most of Emerging Trends • Access Information Faster • Consistent & Controllable Conversation • Integrate Social Media and Sales • Informal Brand Chats
  24. 24. VM Architecture 1 LoadBalancer VMVM VMVM VMVM Response
  25. 25. VM Architecture 2 <func> Pass Master Response Only VM VM MQ Master Slave Response
  26. 26. K8S Architecture Minion Pod Pod Webhook Load-Balance / Node-Port Service
  27. 27. K8S Architecture Benefits: • Resource Utilization • Scalability • Auto Load-balance • Self-healing Challenges: • Logging • Chat Conversation Who am I talking to?!!! Hi! My name is Kamekube! Hi! What’s your name?
  28. 28. Possible Solution? • Load-balance? • Cache? Minion Pod1 Pod2 Pod3 Pod4 DB [Username:Conv0001:Bot3] Pod MB Pod MB Pod MB Pod MB Pod MB Webhook Load-Balance / Node-Port Service
  29. 29. What else? I’m Leaving it to the Smarter People (YOU!)
  30. 30. www.inwinstack.com Thank You! 迎 棧 科 技 股 份 有 限 公 司

×