Introduction to GitOps Deployment to Kubernetes by @sakajunquality. 10 November 2018

1. Introduction to GitOps Deployment to Kubernetes by @sakajunquality. 10 November 2018
2. About me Jun Sakata / @sakajunquality - Google Developers Expert, Cloud Software Engineer at Ubie inc. From Japan Loves: #kubernetes and #beer
3. Ubie Inc. - Medical Startup in Japan. - Most of the workloads are on Kubernetes. - Since Oct. 2018
4. Agenda - Concept of GitOps - Very Prototype of GitOps in Ubie - Future Perspectives
5. Google Cloud Platform - As the company is using GCP, services used in the slides are products of GCP. - But the whole story and idea, I believe, can be applied to any Cloud or On-Prem.
6. Concept of GitOps
7. GitOps - Operations by Pull Request https://www.weave.works/blog/gitops-operations-by-pull-request
8. GitOps Basics - Two different types of git repository. - Application Repo: Application source code Config Repo: Declarative manifest for configuration Application Config
9. Concept of GitOps - All the manifest is managed declaratively in Git. - Any “apply” is through CI.
10. Concept of GitOps - In Other Words... - Manifest in the Git represents the current state of the infrastructure. - Any kind of manual “apply” is prohibited.
11. Very Prototype of GitOps in Ubie
12. Infrastructure in Ubie - Several services are running on Kubernetes cluster. - Frontend Several backend microservices - Kubernetes (in Ubie) = Google Kubernetes Engine. - All the workloads are on Google Cloud Platform. Migrated from Heroku on Oct. 2018.
13. My GitOps Philosophy in Ubie - Workflow itself should be simple. - Each components should be decoupled. - New application should be easily integrated. (as much as possible)
14. GitOps Steps in Ubie
15. GitOps Steps in Ubie
16. GitOps Steps in Ubie
17. GitOps Steps in Ubie
18. GitOps Steps in Ubie
19. GitOps Steps in Ubie
20. GitOps First Step
21. GitOps First Step - Commit and Push to the manifest repo manually. - Create an release Pull-Request manually. - Merge the Pull-Request to deploy.
22. GitOps First Step: Problems Obviously there are problems, - We make mistakes. - Difficult to make changes to manifest repo for engineers.
23. GitOps Second Step
24. GitOps Second Step - Commit to the manifest repo and Create an release Pull-Request automatically. - Merge the Pull Request to deploy.
25. GitOps Second Step: GitOps App - App that subscribes event from CI (Cloud Build) through MQ (Cloud Pub/Sub), - Create an Release Pull-Request on Github. Notify the Pull-Request via Slack.
26. GitOps Second Step: GitOps App - Slack Notification After docker image is finished, Pull-Request url is notified via slack.
27. GitOps Second Step: GitOps App - Github Pull-Request Engineer just need to merge the Pull-Request.
28. GitOps Second Step: GitOps App - Rollback When you need to rollback, - Revert the merged Pull-Request. - Merge the reverted Pull-Request.
29. No manual changes to the manifest (in terms of application release)
30. GitOps App
31. GitOps App - Using custom app written in Go. - OSS exists though. - https://github.com/weaveworks/flux
32. Example in google/go-github is helpful to create a GitOps App https://github.com/google/go-github/blob/master/example/commitpr/main.go
33. Future Perspective
34. Some Improvements from the Prototype - Support for pre/post jobs like migration. - Support for ad-hoc pre/post jobs. - Must consider rollback! - Deployment notification - Must be easy for developers. - Canary Release / Release Analytics Currently working on it...
35. Some Improvements from the Prototype After changes are merged to manifest repo, manifest just is applied through kubectl apply with CI (Cloud Build), there are other options, like more complex CI.
36. Conclusion
37. Conclusion - By GitOps, workflow for Kubernetes can be simple. - GitOps can be introduced step by step. - Let’s start simply :)
38. For more info I will publish an article with more detail, and share on my twitter: @sakajunquality
39. Thank you.