Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Immutable infrastructure 介紹與實做:以 kolla 為例


Published on

介紹 Immutable infrastructure 概念,並以 OpenStack Kolla 為例子,說明如何使用 docker 和 ansible 來實作 immutable instructure

Published in: Software
  • Be the first to comment

Immutable infrastructure 介紹與實做:以 kolla 為例

  1. 1. Immutable Infrastructure Kuo-tung Kao
  2. 2. 簡介 任職於 inwinstack 過去的迎廣科技雲端應用研發中 心 OpenStack contributor kjellytw at gmail dot com
  3. 3. 大綱 Immutable infrastructure 介紹 為什麼會有 immutable infrastructure? immutable infrastructure 是什麼 immutable infrastructure 的缺點 OpenStack Kolla 如何實現 Iimmutable infrastructure 名詞解釋:OpenStack, Docker, Ansible, OpenStack Kolla OpenStack Kolla 實做
  4. 4. 為什麼會有 immutable infrastructure? 減輕 operator 的工作 減少無紀錄的環境修改 更容易升級 / 降級 不容易升級失敗 升級失敗也可以快速還原
  5. 5. What’s the Iimmutable Iinfrastructure Don’t modify image manually Create new image when something changes
  6. 6. System Infrastructure is divided into "data" and "other". "Other" are replaced at every deployment. "Other" are modifed with version controll. "Other" include “config”, “program”, “environment”. Package “other” using Container
  7. 7. Running Container V1 volume Running Container V2 volume Stopped Container V1 Running Container V1 volume Stopped Container V2 upgrade downgrade
  8. 8. Immutable Infrastructure Advantage Atomic deployments Easy to upgrade Easy to downgrade Fault recovery Easy to track change
  9. 9. Immutable Infrastructure Downside Create new image when something changes
  10. 10. OpenStack Open source software for creating private and public clouds. OpenStack software controls large pools of compute, storage, and networking resources throughout a datacenter, managed through a dashboard or via the OpenStack API.
  11. 11. Docker Container Llighter, fast than hypervistor Build envirenment from Dockerfile Version Controll Support named volume
  12. 12. Dockerfile Demo
  13. 13. Docker - run container docker run -e MYSQL_ROOT_PASSWORD=pass -d mysql:5.7.12
  14. 14. Ansible Deployment tool Interpret Yaml Jinja2 Easy to write your own module in Python Aagentless
  15. 15. Aansible Demo Sscript
  16. 16. Aansible Demo Sscript
  17. 17. OpenStack Kolla Deploy OpenStack using Docker and Ansible Support Ceph A little downtime when upgrading Easy to upgrade/downgrade Rapid Deployment
  18. 18. How to deploy OpenStack using Kolla tools/ -t binary -b centos tox -e genconfig sudo cp -rf etc/kolla /etc #modify /etc/kolla/globals.yaml tools/ tools/kolla-ansible pull #optional tools/kolla-ansible deploy
  19. 19. Kolla Code Structure docker: build image ansible: generate openstack config run container
  20. 20. 1.Encode the configuration into the build of the container 2.Encode the configuration into environment 3.Create the configuration file that the OpenStack service runs against outside the container 4.Encode the configuration file generated by the deployment tool into a JSON blob which
  21. 21. Kolla Code Structure
  22. 22. Kolla - dockerfile, base Run the same command in every container
  23. 23. Kolla - docker, base the file is generated by kolla_set_configs.
  24. 24. Kolla - dockerfile, heat-api
  25. 25. Create database schema when KOLLA_BOOTSTRAP is set
  26. 26. Kolla - ansible, deploy, deploy.yaml
  27. 27. bootstrap.yaml Create mysql databae using Ansible
  28. 28. Kolla - ansible, deploy, bootstrap_service.yaml Set env var, KOLLA_BOOT STRAP
  29. 29. Kolla - ansible, deploy, start.yaml
  30. 30. Kolla - ansible, deploy, heat- api.json.j2
  31. 31. Kolla - ansible, upgrade, bootstrap_service.yaml
  32. 32. 結論 Immutable infrastructure 讓佈署更容易 容易升級 / 降級 當升級失敗時,能夠快速還原 Kolla 和其他佈署方法相比,擁有快速佈署、快 速升級降級的優點
  33. 33. 參考資料 immutable-infrastructure/
  34. 34. Q&A
  35. 35. Question 用Kolla佈OpenStack, 所謂Downtime很小是因為 在建新的image, 舊的系統仍正在service, total upgrading 時間仍然一樣還試?
  36. 36. Answer 在升級時,你可以事先將 image 建置好。等所 有 image 都建置好後,再進行升級動作。在 還沒執行 Ansible 腳本前,舊的系統依舊正常 運作,不會有任何影響 升級系統時,安裝套件很花時間。而 kolla 將 這時間轉嫁到 build image,而 build image 不會影響原本系統。這就是 kolla 可以快速升 級、快速佈署的原因
  37. 37. Question 用Kolla佈OpenStack,適合用在企業的部屬嗎?
  38. 38. Answer 目前能做的客製化部分不夠多,所以不一定滿 足不同的企業環境需要。不過如果你能夠修 改 ansible 腳本,那麼有助於你突破一些限制 ( cinder multi backend 等) 未來 kolla 會支援 kubernetes 。或許可以等到 kolla 支援 kubernetes 在導入企業。 OpenStack 跑在 kubernetes 將會更強大