SlideShare a Scribd company logo
(GitOps CI/CD)
KIM CHUNGSUB
subicura
Open Infrastructure &

Cloud Native Days Korea 2019
Open Infrastructure &

Cloud Native Days Korea 2019
Container / Serverless / DevOps / ReactJS
E-Commerce
http://subicura.com
subicura
Open Infrastructure &

Cloud Native Days Korea 2019
Open Infrastructure &

Cloud Native Days Korea 2019
CI(Continuous integration) / CD(Continuous Delivery)
Kubernetes / GitOps / ArgoCD
Open Infrastructure &

Cloud Native Days Korea 2019
CI(Continuous integration) / CD(Continuous Delivery)
Kubernetes / GitOps / ArgoCD
→ commit
01
Open Infrastructure &

Cloud Native Days Korea 2019
Code
svn
SVN Build DeploySFTP
Open Infrastructure &

Cloud Native Days Korea 2019
SVN
svn
SVN
-
- 😱
- ?
- →
Open Infrastructure &

Cloud Native Days Korea 2019
- →
- → chef? ansible?
-
Deploy
쿠버네티스를 이용한 기능 브랜치별 테스트 서버 만들기 (GitOps CI/CD)
Open Infrastructure &

Cloud Native Days Korea 2019
Code
svn
SVN Build DeploySFTP
Open Infrastructure &

Cloud Native Days Korea 2019
Code
1 - Git Docker
git Build Docker Deploy
♥ ♥
Open Infrastructure &

Cloud Native Days Korea 2019
git
git
- git
- Merge Request + Code Review
- GitLab → UI
♥
Open Infrastructure &

Cloud Native Days Korea 2019
=
-
-
-
-
♥
Docker
Open Infrastructure &

Cloud Native Days Korea 2019
-
-
-
- →
- QA
Open Infrastructure &

Cloud Native Days Korea 2019
Google Cloud Next 2019 .
쿠버네티스를 이용한 기능 브랜치별 테스트 서버 만들기 (GitOps CI/CD)
쿠버네티스를 이용한 기능 브랜치별 테스트 서버 만들기 (GitOps CI/CD)
Open Infrastructure &

Cloud Native Days Korea 2019
releasing the code multiple times a day
Open Infrastructure &

Cloud Native Days Korea 2019
!
😳
Open Infrastructure &

Cloud Native Days Korea 2019
!
✊
Open Infrastructure &

Cloud Native Days Korea 2019
- ?
- ?
- ?
- ?
Open Infrastructure &

Cloud Native Days Korea 2019
- ? →
- ? →
- ? →
- ? →
Open Infrastructure &

Cloud Native Days Korea 2019
- ? →
- ? →
- ? →
- ? →
10 1 = ??? 🤩
Open Infrastructure &

Cloud Native Days Korea 2019
Code
2 - GitLab webhook + CI CD
git Build Docker Deploy
Open Infrastructure &

Cloud Native Days Korea 2019
Code
2 - GitLab webhook + CI CD
git Build Job
(branch)
Docker
Deploy Job Deploy

(test01~05)
CI
CD
event
♥
♥
♥
Open Infrastructure &

Cloud Native Days Korea 2019
GitLab webhook
Open Infrastructure &

Cloud Native Days Korea 2019
Build -
branch - 1 image:branch-1
branch - 2 image:branch-2
branch - 3 image:branch-3
Open Infrastructure &

Cloud Native Days Korea 2019
Deploy - Parameterized Build
1~5
git branch = docker image tag
Open Infrastructure &

Cloud Native Days Korea 2019
Jenkins - Input
Open Infrastructure &

Cloud Native Days Korea 2019
Jenkins -
Open Infrastructure &

Cloud Native Days Korea 2019
2
-
-
- , QA
- Jenkins
-
- 2 > 5
Open Infrastructure &

Cloud Native Days Korea 2019
- (1 , 2 ..)
- (0 ~8 )
-
-
-
- Jenkins
Open Infrastructure &

Cloud Native Days Korea 2019
..
02
Kubernetes
GitOps
ArgoCD
Open Infrastructure &

Cloud Native Days Korea 2019
Kubernetes
Open Infrastructure &

Cloud Native Days Korea 2019
Kubernetes
- Cluster Autoscaler →
- Ingress Controller →
- Cert Manager → SSL
- Helm → manifest
- Amazon EKS →
- Spot Instance → Autoscaling Group
Open Infrastructure &

Cloud Native Days Korea 2019
Cluster Autoscaler
- Pod
- Spot
Open Infrastructure &

Cloud Native Days Korea 2019
Ingress Controller + Cert Manager
-
Open Infrastructure &

Cloud Native Days Korea 2019
Helm package manager
apiVersion: v1
kind: Pod
metadata:
name: mypod
spec:
container:
- name: mypod-container
image: {{ .Values.image }}
image: busybox apiVersion: v1
kind: Pod
metadata:
name: mypod
spec:
container:
- name: mypod-container
image: busybox
pod.yaml values.yaml output.yaml
+
- yaml (Image tag, domain)
Open Infrastructure &

Cloud Native Days Korea 2019
Kubernetes ?
$ helm upgrade
Open Infrastructure &

Cloud Native Days Korea 2019
Kubernetes ?
$ helm upgrade
Open Infrastructure &

Cloud Native Days Korea 2019
→ context
→ Jenkins, ( )
→ kubectl, helm
→
→
→
Open Infrastructure &

Cloud Native Days Korea 2019
Kubernetes ?
$ helm upgrade
Open Infrastructure &

Cloud Native Days Korea 2019
Kubernetes ?
$ helm
sync


(no code)
Agent
Open Infrastructure &

Cloud Native Days Korea 2019
Let's GitOps
Open Infrastructure &

Cloud Native Days Korea 2019
Let's GitOps
Open Infrastructure &

Cloud Native Days Korea 2019
Let's GitOps
Open Infrastructure &

Cloud Native Days Korea 2019
Developer
%
GitOps workflow
Git (code) CI
Unit Test
Build

Container

Image
Push

Container

Image
Git (env)
Merge

Request

or

Push
Sync
Agent
kubectl apply
helm / ...
Kubernetes
Deploy
docker registry
Update
k8s manifest
Merge

Request

or

Push
Open Infrastructure &

Cloud Native Days Korea 2019
1.
- CI
2. -
3. MSA
4.
5. CI git git > ci > git > ci
Open Infrastructure &

Cloud Native Days Korea 2019
GitOps
- git
- git
-
- (kubectl, helm, skaffold...)
- ,
-
- Merge Request
-
Open Infrastructure &

Cloud Native Days Korea 2019
Argo CD - Declarative GitOps CD for Kubernetes
- git
- kustomize, helm, ksonnet, jsonnet, plain yaml manifest
- SSO (OIDC, OAuth2, LDAP, SAML 2.0, GitHub, GitLab, ...)
- WEB UI →
- Webhook integration (GitHub, BitBucket, GitLab)
- PreSync, Sync, PostSync hooks
-
Open Infrastructure &

Cloud Native Days Korea 2019
Open Infrastructure &

Cloud Native Days Korea 2019
Open Infrastructure &

Cloud Native Days Korea 2019
03
Open Infrastructure &

Cloud Native Days Korea 2019
CI - Continuous Integration
feature-1 branch
git (app)
image:feature-1
Jenkins build job
env:feature-1
git (env)
Open Infrastructure &

Cloud Native Days Korea 2019
CD - Continuous Deploy
env:feature-1
git (env)
ArgoCD
feature-1.test.com
feature-2.test.com
{branch}.test.com
kubernetes
Open Infrastructure &

Cloud Native Days Korea 2019
-
-
- ({branch_name}.test.com)
- kubectl, helm
- WEB UI
- Spot
Open Infrastructure &

Cloud Native Days Korea 2019
5
Open Infrastructure &

Cloud Native Days Korea 2019
!
Open Infrastructure &

Cloud Native Days Korea 2019
Open Infrastructure &

Cloud Native Days Korea 2019
04
GitLab, Jenkins, ArgoCD
05
Open Infrastructure &

Cloud Native Days Korea 2019
Kubernetes
- Amazon EKS
- terraform (terraform-aws-eks module)
- autoscaling_enabled: true
- spot_price: xx
- Helm package
- cluster-autoscaler(auto discovery), k8s-spot-termination-handler
- nginx-ingress, cert-manager
Open Infrastructure &

Cloud Native Days Korea 2019
Jenkins
- Build job (open merge request - app)
- build
- create & push container image
- update helm chart value
- Deploy job (push - env)
- create argo application
- Close job (accept merge request - app)
- delete argo application
Open Infrastructure &

Cloud Native Days Korea 2019
ArgoCD
- Connect repository
06
Open Infrastructure &

Cloud Native Days Korea 2019
Continuous Integration
- Jenkins X
- Circle CI
- GitLab CI
- Travis CI
- Tekton
- Azure Devops
Open Infrastructure &

Cloud Native Days Korea 2019
Continuous Deploy
- kustomize
- ksonnet
- skaffold
- spinnaker
- weave flux
Open Infrastructure &

Cloud Native Days Korea 2019
Kubernetes Cluster
- GoogleCloud
- Azure
- kops (AWS)
- kubeadm, kubespray
- k3s
07
Open Infrastructure &

Cloud Native Days Korea 2019
released codes every 11.7 seconds on average
Open Infrastructure &

Cloud Native Days Korea 2019
releasing the product bi-weekly
Open Infrastructure &

Cloud Native Days Korea 2019
releases to its production servers 50 times a day
Open Infrastructure &

Cloud Native Days Korea 2019
releasing the code multiple times a day
Open Infrastructure &

Cloud Native Days Korea 2019
*2018 accelerate: state of devops
Open Infrastructure &

Cloud Native Days Korea 2019
" "
Open Infrastructure &

Cloud Native Days Korea 2019
🛠 Kubernetes, Jenkins, ArgoCD 👍
% GitOps 👍
Open Infrastructure &

Cloud Native Days Korea 2019
Kubernetes, Jenkins, ArgoCD
GitOps
Open Infrastructure &

Cloud Native Days Korea 2019
, 👍
⁉ ? !
Open Infrastructure &

Cloud Native Days Korea 2019
- http://slack.opencontainer.co.kr/
- https://www.facebook.com/subicura
- https://twitter.com/subicura
- subicura(at)subicura(dot)com
- !
Open Infrastructure &

Cloud Native Days Korea 2019
Thanks!

More Related Content

쿠버네티스를 이용한 기능 브랜치별 테스트 서버 만들기 (GitOps CI/CD)