Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Containerizing Continuous Deployment

Containerizing Continuous Deployment

I'll show you some pieces of the container world in `Docker.com` and also some of the best practices to optimize images for a CI/CD Pipeline.

Then I'd like to also show you how to prepare your own images to test and build your Container App to be deployed.

After that we'll see all this in action by testing, building and deploying continuously an App built in `python+flask` and then having been deployed on different environments (e.g test, homolog, production etc) supported by `Rancher.com` - and all this with `Gitlab.com` behind the scenes.

Adriano Vieira

February 10, 2017
Tweet

More Decks by Adriano Vieira

Other Decks in Programming

Transcript

  1. [email protected] @adriano_vieira K e e p C A L M

    S a n d h a v i n g f u n DevOps ✔ C ulture ✔ A utomation ✔ L ean (& Agile) ✔ M etrics (Monitoring & Measurement & Management) ✔ S haring (& Source)
  2. [email protected] @adriano_vieira K e e p C A L M

    S a n d h a v i n g f u n DevOps DevOps
  3. [email protected] @adriano_vieira K e e p C A L M

    S a n d h a v i n g f u n DevOps (+QA+SEC ...) QA Sec DevOps Mkt/...
  4. [email protected] @adriano_vieira K e e p C A L M

    S a n d h a v i n g f u n Containerizing Continuous Deployment
  5. [email protected] @adriano_vieira K e e p C A L M

    S a n d h a v i n g f u n Containerizing Continuous Deployment • Rancher – Ambientes
  6. [email protected] @adriano_vieira K e e p C A L M

    S a n d h a v i n g f u n Containerizing Continuous Deployment • Rancher – Ambientes hosts e stacks
  7. [email protected] @adriano_vieira K e e p C A L M

    S a n d h a v i n g f u n Containerizing Continuous Deployment • Gitlab (gitlab.com) – Análise de ciclos (ex: plan, test, prod)
  8. [email protected] @adriano_vieira K e e p C A L M

    S a n d h a v i n g f u n Containerizing Continuous Deployment • Gitlab (gitlab.com) – Quadro “kanban”
  9. [email protected] @adriano_vieira K e e p C A L M

    S a n d h a v i n g f u n Containerizing Continuous Deployment • Gitlab (gitlab.com) – Comandos / (em “comentários”) – Controle de tempo em issues
  10. [email protected] @adriano_vieira K e e p C A L M

    S a n d h a v i n g f u n Containerizing Continuous Deployment • Gitlab (gitlab.com) – Aprovação em MR – Git LFS – registry para imagens docker * – Pipeline CI/CD *
  11. [email protected] @adriano_vieira K e e p C A L M

    S a n d h a v i n g f u n Containerizing Continuous Deployment • .gitlab-ci.yml – simples ou avançado como precisar – Build com sua ferramenta (maven, grunt, gradle etc) – Artefatos no próprio pipeline/build – Possibilita uso embarcado de docker para todos os jobs – com diferentes templates e imagens por job
  12. [email protected] @adriano_vieira K e e p C A L M

    S a n d h a v i n g f u n Containerizing Continuous Deployment • .gitlab-ci.yml – N estágios quantos necessitar – N ambientes quantos forem os requisitos – Rotinas de profiling e testes que definir (unitários, cobertura, DB etc) – Delivery ou Deployment
  13. [email protected] @adriano_vieira K e e p C A L M

    S a n d h a v i n g f u n Containerizing Continuous Deployment
  14. [email protected] @adriano_vieira K e e p C A L M

    S a n d h a v i n g f u n Containerizing Continuous Deployment Demonstração
  15. [email protected] @adriano_vieira K e e p C A L M

    S a n d h a v i n g f u n Containerizing Continuous Deployment • Containers – Otimizar construção da imagem • + app mesma imagem base • Desempenho do pipeline • Desempenho de deploy • Otimização de área de storage
  16. [email protected] @adriano_vieira K e e p C A L M

    S a n d h a v i n g f u n Containerizing Continuous Deployment • Containers – Scaneie imagens • Conteúdo (ex: microbadger)
  17. [email protected] @adriano_vieira K e e p C A L M

    S a n d h a v i n g f u n • App base image (15 layers, 105MB/253MB) • App (19 layers, 118MB/293MB) Containerizing Continuous Deployment
  18. [email protected] @adriano_vieira K e e p C A L M

    S a n d h a v i n g f u n • pytest image (13 layers, 85MB/253MB) Containerizing Continuous Deployment
  19. [email protected] @adriano_vieira K e e p C A L M

    S a n d h a v i n g f u n Containerizing Continuous Deployment • Containers – Scaneie imagens • Segurança (ex: open-scap*, coreos clair, docker bench)
  20. [email protected] @adriano_vieira K e e p C A L M

    S a n d h a v i n g f u n • SCAP (CVE) Containerizing Continuous Deployment
  21. [email protected] @adriano_vieira K e e p C A L M

    S a n d h a v i n g f u n Containerizing Continuous Deployment Dúvidas? https://speakerdeck.com/adrianovieira
  22. [email protected] @adriano_vieira K e e p C A L M

    S a n d h a v i n g f u n Containerizing Continuous Deployment • Referências – Daniels, Katherine; Davis, Jennifer. Effective DevOps. O'Reilly. 2016 – Morris, Kief. Infrastructure as Code. O'Reilly. 2015 – Get Started with DevOps: A Guide for IT Managers. Rushgrove, Gareth. Puppet. 2016 – GitLab Continuous Integration. Gitlab. Disponível em: https://about.gitlab.com/gitlab-ci – CIS Docker 1.11.0 Benchmark. Pravin Goyal. CIS. 2016. disponível em: https://benchmarks.cisecurity.org/tools2/docker/CIS_Docker_1.11.0_Benchmark_v1.0.0 .pdf – CIS Docker 1.13.0 Benchmark. Pravin Goyal. CIS. 2017. disponível em: https://benchmarks.cisecurity.org/tools2/docker/CIS_Docker_1.13.0_Benchmark_v1.0.0 .pdf • Ferramentas – Usadas na demonstração: • Gitlab-CI+runners (http://gitlab.com) • Pytest (www.pytest.org) • Rancher (http://rancher.com) • Open-scap (https://www.open-scap.org)
  23. [email protected] @adriano_vieira K e e p C A L M

    S a n d h a v i n g f u n Containerizing Continuous Deployment Adriano Vieira [email protected] @adriano_vieira