SlideShare a Scribd company logo
commit => #GitHub =>
#CircleCI => #Docker =>
#Kubernetes #AWS cluster
6. sraz přátel Symfony v Praze
31.3.2016
continuous integration
… deployment
… delivery
Kouzelná Almara
1 Java aplikace v Tomcatu
(RESTful API + Wicket UI)
Tomcat…?
hot deploy 🤘
PermGen 💩
fuck it!
🐙
#BitBucket => #Bamboo => SSH upload
WARka => jetty-runner.jar + automatický reload
po uploadu nového WARu (Node.JS skript)
Skrz
3 frontend PHP(-FPM) aplikace,
2 3 ReactPHP aplikace, ~30 RabbitMQ consumers,
1 Go aplikace
SVN 👹
fuck it!
🐙
#BitBucket => BB hook => checkout git do
~/commits/<commit> => hook.sh =>
(na stagingu automaticky) swap.sh
hitserver, adserver, ranking, RabbitMQ
consumers
supervisord 🤘
porty 💩
hitserver, adserver, ranking, RabbitMQ
consumers
supervisord 💩
porty 💩
Liftago
7 Java aplikací, 2 Node.JS aplikace,
Python skripty v crontabu
💩 Jelastic 💩
💩 Dogado 💩
fuck! fuck fuck!
🐙
❓ Java/PHP/Go/Node/…
❓ Java 7 vs. 8, PHP 5.3 vs. 7.0, …
❓ supervisor/autorestart
❓ rolling deployment
❓ porty
❓ nezávislé na hostingu
❓ Java/PHP/Go/Node/… ✅ Docker
❓ Java 7 vs. 8, PHP 5.3 vs. 7.0, … ✅ Docker
❓ supervisor/autorestart ✅ Kubernetes
❓ rolling deployment ✅ Kubernetes
❓ porty ✅ Kubernetes
❓ nezávislé na providerovi ✅ Kubernetes
Kubernetes
commit => #GitHub => #CircleCI => #Docker => #Kubernetes #AWS cluster
commit => #GitHub => #CircleCI => #Docker => #Kubernetes #AWS cluster
commit => #GitHub => #CircleCI => #Docker => #Kubernetes #AWS cluster
Pods
Docker container
billing:2016-03-31.345
Label
app=billing
Label
env=prod
Docker container
logrotate:latest
Volume
/var/lib/invoices
Volume
/var/log
10.0.0.34
8080
Reconciliation loop
Observed state Desired state
Reconciliation loop
Observed state Desired statecreate
Reconciliation loop
Observed state Desired statescale
Reconciliation loop
Observed state Desired statehealth check
Replication controller
Pod
billing 10.0.0.34
Replication
controller
billing-prod
app=billing
env=prod
replicas=3
app=billing
env=prod
Pod
billing 10.0.0.35
app=billing
env=prod
Pod
billing 10.0.0.36
app=billing
env=prod
Replication controller
Pod
billing 10.0.0.34
Replication
controller
billing-prod
app=billing
env=prod
replicas=1
app=billing
env=prod
Service
Pod
billing 10.0.0.34
Replication
controller
billing-prod
app=billing
env=prod
Pod
billing 10.0.0.35
app=billing
env=prod
Pod
api 10.0.0.14
app=api
env=prod
??? ???
Service
Pod
billing 10.0.0.34
Replication
controller
billing-prod
app=billing
env=prod
Pod
api 10.0.0.14
app=api
env=prod
??? !!!
Service
Pod
billing 10.0.0.34
Replication
controller
billing-prod
app=billing
env=prod
Pod
billing 10.0.0.35
app=billing
env=prod
Pod
api 10.0.0.14
app=api
env=prod
Service
billing-prod 10.1.0.1
Service
Pod
billing 10.0.0.34
Replication
controller
billing-prod
app=billing
env=prod
Pod
api 10.0.0.14
app=api
env=prod
Service
billing-prod 10.1.0.1
Service
Replication
controller
billing-prod
Pod
billing 10.0.0.66
app=billing
env=prod
Pod
api 10.0.0.14
app=api
env=prod
Service
billing-prod 10.1.0.1
…a více
• Job (cron scheduler plánovaný na 1.3)
• DaemonSet
• Horizontal Pod Autoscaler
• Secret
• Ingress
commit => #GitHub => #CircleCI => #Docker => #Kubernetes #AWS cluster
$ kubectl create -f - <<EOF
> apiVersion: v1
> kind: ReplicationController
> metadata:
> name: billing-prod
> spec:
> replicas: 3
> template:
> metadata:
> labels:
> app: billing
> env: prod
> spec:
> containers:
> - name: billing
> image: docker-registry.liftago.com/billing:latest
> imagePullPolicy: Always
…
…
> env:
> - name: SPRING_PROFILES_ACTIVE
> value: prod
> ports:
> - containerPort: 8080
> livenessProbe:
> httpGet:
> path: /health
> port: 8080
> initialDelaySeconds: 60
> timeoutSeconds: 5
> readinessProbe:
> httpGet:
> path: /health
> port: 8080
> initialDelaySeconds: 1
> timeoutSeconds: 1
> imagePullSecrets:
> - name: docker-repository.liftago.com
> EOF
$ kubectl create -f <<EOF
> apiVersion: v1
> kind: Service
> metadata:
> name: billing-prod
> labels:
> app: billing
> env: prod
> spec:
> clusterIP: 10.1.0.1
> ports:
> - port: 80
> targetPort: 8080
> protocol: TCP
> selector:
> app: billing
> env: prod
> EOF
$ kubectl get po -l app=billing,env=prod
NAME READY STATUS RESTARTS AGE
billing-prod-e3jcm 1/1 Running 0 1m
billing-prod-4sdfb 1/1 Running 0 1m
billing-prod-sd134 1/1 Running 0 1m
$ kubectl get rc -l app=billing,env=prod
NAME DESIRED CURRENT AGE
billing-prod 3 3 1m
$ kubectl get svc -l app=billing,env=prod
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
billing-prod 10.1.0.1 <none> 80/TCP 1m
$ kubectl exec -it billing-prod-e3jcm bash
$ cat /etc/hosts
127.0.0.1 billing-prod-e3jcm
…
kubernetes.io
github.com/jakubkulhan/kube-jessie-ansible
github.com/jakubkulhan/dockerfiles
A co ty
commity/#GitHub/#CircleCI?
🤔
machine:
java:
version: oraclejdk8
environment:
DOCKER_TAG: $(date +%Y-%m-%d).$CIRCLE_BUILD_NUM
services:
- docker
post:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS $DOCKER_REGISTRY
dependencies:
post:
- sudo wget 'http://storage.googleapis.com/kubernetes-release/release/v1.2.0/bin/linux/amd64/kubectl' -O /usr/local/bin/kubectl
- sudo chmod 755 /usr/local/bin/kubectl
# docker pull suggested by https://discuss.circleci.com/t/caching-docker-image-with-docker-hub/1784
- docker pull $DOCKER_REGISTRY/$CIRCLE_PROJECT_REPONAME:latest || true
test:
…
deployment:
kubernetes:
branch: master
commands:
- docker build -t $DOCKER_REGISTRY/$CIRCLE_PROJECT_REPONAME:$DOCKER_TAG .
- docker push $DOCKER_REGISTRY/$CIRCLE_PROJECT_REPONAME:$DOCKER_TAG
- docker tag -f $DOCKER_REGISTRY/$CIRCLE_PROJECT_REPONAME:$DOCKER_TAG $DOCKER_REGISTRY/$CIRCLE_PROJECT_REPONAME:latest
- docker push $DOCKER_REGISTRY/$CIRCLE_PROJECT_REPONAME:latest
- >
kubectl config set-cluster kubernetes --server=$KUBERNETES_MASTER &&
kubectl config set-credentials circleci --token=$KUBERNETES_TOKEN &&
kubectl config set-context kubernetes --cluster=kubernetes --user=circleci &&
kubectl config use-context kubernetes
- kubectl rolling-update billing-prod --image=$DOCKER_REGISTRY/$CIRCLE_PROJECT_REPONAME:$DOCKER_TAG --update-period=10s
Díky!
Otázky?
twitter.com/jakubkulhan
medium.com/@jakubkulhan
github.com/jakubkulhan

More Related Content

PDF
Drone CI/CD 自動化測試及部署
PDF
Golang Project Layout and Practice
PDF
Ondřej Šika: Docker, Traefik a CI - Mějte nasazené všeny větve na kterých pra...
PDF
KubeCon EU 2016: Getting the Jobs Done With Kubernetes
PDF
Docker command
PDF
Docker deploy
PDF
Conan.io - The C/C++ package manager for Developers
PDF
Dessi docker kubernetes paas cloud
Drone CI/CD 自動化測試及部署
Golang Project Layout and Practice
Ondřej Šika: Docker, Traefik a CI - Mějte nasazené všeny větve na kterých pra...
KubeCon EU 2016: Getting the Jobs Done With Kubernetes
Docker command
Docker deploy
Conan.io - The C/C++ package manager for Developers
Dessi docker kubernetes paas cloud

What's hot (20)

PPTX
PuppetConf 2017: Use Puppet to Tame the Dockerfile Monster- Bryan Belanger, A...
PDF
Build microservice with gRPC in golang
PDF
Git, CMake, Conan - How to ship and reuse our C++ projects?
PDF
Steam Learn: Composer
KEY
Linecook - A Chef Alternative
PDF
Rest, sockets em golang
PDF
Lab Zero Lunchdown: Deploying Elixir and Phoenix Applications
PPT
Build service with_docker_in_90mins
PDF
Preparation study of_docker - (MOSG)
PPTX
Start tracking your ruby infrastructure
PDF
Kubernetes - from sketch to production
PDF
Docker remote-api
PDF
ECMAScript 6
PDF
PROCESS WARP「プロセスがデバイス間で移動する」仕組みを作る
PPT
Python virtualenv & pip in 90 minutes
PPT
Learn RabbitMQ with Python in 90mins
PDF
Taming AEM deployments
PPT
Learn basic ansible using docker
PDF
What's Special About Elixir
PDF
HOW TO DEAL WITH BLOCKING CODE WITHIN ASYNCIO EVENT LOOP
PuppetConf 2017: Use Puppet to Tame the Dockerfile Monster- Bryan Belanger, A...
Build microservice with gRPC in golang
Git, CMake, Conan - How to ship and reuse our C++ projects?
Steam Learn: Composer
Linecook - A Chef Alternative
Rest, sockets em golang
Lab Zero Lunchdown: Deploying Elixir and Phoenix Applications
Build service with_docker_in_90mins
Preparation study of_docker - (MOSG)
Start tracking your ruby infrastructure
Kubernetes - from sketch to production
Docker remote-api
ECMAScript 6
PROCESS WARP「プロセスがデバイス間で移動する」仕組みを作る
Python virtualenv & pip in 90 minutes
Learn RabbitMQ with Python in 90mins
Taming AEM deployments
Learn basic ansible using docker
What's Special About Elixir
HOW TO DEAL WITH BLOCKING CODE WITHIN ASYNCIO EVENT LOOP
Ad

Viewers also liked (20)

PDF
Jakub Kulhan - Jak se dělal nový Skrz.cz na Symfony a Elasticsearch
PDF
Miro Stopka – Kvalitní vs. výnosný kód
PDF
Ansible
PDF
Profiling PHP Applications
TXT
VIM - nejefektivnější editor na světě
PDF
ReactPHP + Symfony = profit aneb 1000req/s přes Symfony s minimálními nár...
PPTX
ORM Designer: Speed up your ORM development
PPTX
06 prez10(tvorba webu)
PPTX
Deployment PHP aplikací | WebExpo 2011
PPSX
Av technika 13
PPTX
Jaroslav zlamal
PDF
WebSockets - how to do real-time applications in PHP
PPTX
Nikola luxova
PDF
Tomáš Votruba - Jak přežít Symfony 3 (1. sraz přátel Symfony v Praze)
ODP
What makes a good developer from a management perspective
PPTX
Martin Froněk - Jak využít soft skills ve svůj prospěch 2 (15. sraz přátel PH...
PPTX
Čtvrtkon #44 - Symfony php framework
PPT
Neo4j Jízdomat
PPTX
Symfony vs Nette vs Phalcon
PDF
Vývojáři sobě: 0. sraz - PHP: Appka v Nette
Jakub Kulhan - Jak se dělal nový Skrz.cz na Symfony a Elasticsearch
Miro Stopka – Kvalitní vs. výnosný kód
Ansible
Profiling PHP Applications
VIM - nejefektivnější editor na světě
ReactPHP + Symfony = profit aneb 1000req/s přes Symfony s minimálními nár...
ORM Designer: Speed up your ORM development
06 prez10(tvorba webu)
Deployment PHP aplikací | WebExpo 2011
Av technika 13
Jaroslav zlamal
WebSockets - how to do real-time applications in PHP
Nikola luxova
Tomáš Votruba - Jak přežít Symfony 3 (1. sraz přátel Symfony v Praze)
What makes a good developer from a management perspective
Martin Froněk - Jak využít soft skills ve svůj prospěch 2 (15. sraz přátel PH...
Čtvrtkon #44 - Symfony php framework
Neo4j Jízdomat
Symfony vs Nette vs Phalcon
Vývojáři sobě: 0. sraz - PHP: Appka v Nette
Ad

Similar to commit => #GitHub => #CircleCI => #Docker => #Kubernetes #AWS cluster (20)

KEY
Plack perl superglue for web frameworks and servers
KEY
Intro to PSGI and Plack
PDF
Istio Playground
PDF
KubeCon EU 2016: Creating an Advanced Load Balancing Solution for Kubernetes ...
PDF
Shakr - Container CI/CD with Google Cloud Platform
PPTX
Introduction to Kubernetes
PDF
Swift Cloud Workshop - Swift Microservices
PPTX
Modernizando ci cd com openshift pipelines tdc poa
PDF
Python Flask app deployed to OPenShift using Wercker CI
PDF
ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021
PDF
Scaling docker with kubernetes
PDF
Evolution of kube-proxy (Brussels, Fosdem 2020)
PDF
Deep Dive into SpaceONE
PPTX
TechUG - Kubernetes 101 - May 2020
PDF
Testing applications with traffic control in containers / Alban Crequy (Kinvolk)
PDF
Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...
PDF
Containerizing your Security Operations Center
PDF
Making a small QA system with Docker
PDF
Running gRPC Services for Serving Legacy API on Kubernetes
PDF
Build resource server &amp; client for OCF Cloud (2018.8.30)
Plack perl superglue for web frameworks and servers
Intro to PSGI and Plack
Istio Playground
KubeCon EU 2016: Creating an Advanced Load Balancing Solution for Kubernetes ...
Shakr - Container CI/CD with Google Cloud Platform
Introduction to Kubernetes
Swift Cloud Workshop - Swift Microservices
Modernizando ci cd com openshift pipelines tdc poa
Python Flask app deployed to OPenShift using Wercker CI
ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021
Scaling docker with kubernetes
Evolution of kube-proxy (Brussels, Fosdem 2020)
Deep Dive into SpaceONE
TechUG - Kubernetes 101 - May 2020
Testing applications with traffic control in containers / Alban Crequy (Kinvolk)
Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...
Containerizing your Security Operations Center
Making a small QA system with Docker
Running gRPC Services for Serving Legacy API on Kubernetes
Build resource server &amp; client for OCF Cloud (2018.8.30)

Recently uploaded (20)

PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
Sustainable Sites - Green Building Construction
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PDF
Digital Logic Computer Design lecture notes
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
PPT on Performance Review to get promotions
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Internet of Things (IOT) - A guide to understanding
Sustainable Sites - Green Building Construction
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Strings in CPP - Strings in C++ are sequences of characters used to store and...
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Lesson 3_Tessellation.pptx finite Mathematics
Digital Logic Computer Design lecture notes
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
OOP with Java - Java Introduction (Basics)
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
CYBER-CRIMES AND SECURITY A guide to understanding
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Lecture Notes Electrical Wiring System Components
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPT on Performance Review to get promotions
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx

commit => #GitHub => #CircleCI => #Docker => #Kubernetes #AWS cluster