owned this note changed 5 years ago
Linked with GitHub

Ansible: From VM to Kubernetes - Wong Hoi Sing Edison

tags: COSCUP2020 中階 TR412-2

歡迎來到 https://hackmd.io/@coscup/2020 共筆

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 →

點擊本頁上方的 開始用 Markdown 一起寫筆記!
手機版請點選上方 按鈕展開議程列表。

簡介

https://coscup.org/2020/zh-TW/agenda/K8H3TM

SlideShare

https://www.slideshare.net/hswong3i/hkoscon-x-coscup-202020200801ansible-from-vm-to-kubernetes

Outline

  • Why DevOps with Ansible ?
  • Ansible with VM
  • Ansible with Docker
  • Ansible with Kubernetes
  • Tips & Tricks
  • Roadmap
  • Q&A

Why DevOps with Ansible ?

  • Simplify complicated logic with error detectione usable modules.
  • or running shell command directly.
  • Simple requirement.

Ansible with VM

  • Ansible cli (Ad-hoc)
  • Ansible playbook
  • Ansible Role
    • Only only tasks, and can be overwrite variable.
    • Molecule: test tool
  • Molecule + Delegate = Ansible Role Installer

Ansible with Docker

  • Why not dockerfile ?
  • Why not ansible-bender ?
  • Molecule + Docker = Docker image creator
  • Support both DOcker and Podman
  • Run as standard Molecule test case.

Ansible with Kubernetes

  • Molecule + Vagrant + Libvirt
  • In case of Ceph OSD, truth block device is required.
    • Not support file-based loop device
  • Molecule + Vagrant + Libvirt = 100% mock up
  • SUpport Travis CI
  • Support multiple instances for clusters test
  • SUpport multiple OS
  • Fully support cgroup / network /

Demo: ansible-collection-kubernetes

https://github.com/alvistack/ansible-collection-kubernetes

  • Support HTTPS with Let's Encyption.

Tips & Tricks

  • Always start development with Test Cases.
  • Simple deployment goes Molecule + Delegate.
  • Complex test case always goes Molecule + vagrant + Libvirt + Travis CI.
  • Create Docker image after Molecule Test Case by Docker commit.
  • Install packages:
    • Official / PPA.
    • Distribution Repo.
    • Official static binary.
    • Compile for Source Code.

Roadmap

  • Migrate everything form Docker to Podman / ??

Q&A

Select a repo