SlideShare une entreprise Scribd logo
1  sur  19
Télécharger pour lire hors ligne
DevOps Workflow
From 0 to kube in 60 min
Christian Kniep, v2018-02-20
Technical Account Manager, Docker Inc.http://qnib.org/devops-workflow
Motivation
Iteration barriers
ClusterLaptop
Works on my Laptop!
Why is DevOps not enough.
ProdDevelopment
Dev
Artifact: code
Env: interactive
Ops
Artifact: pkg/img
Env: automated
DevOps
Release/Integration
Release
Artifact: pkg/img
Env: automated
DevRelOps
Prod
Ops
Artifact: pkg/img
Env: automated
Development
Dev
Artifact: code
Env: interactive
DevRel*Ops
Prod
Ops
Artifact: pkg/img
Env: automated
Development
Dev
Artifact: code
Env: interactive
Q&A
Performance
Release/Integration
Release
Artifact: pkg/img
Env: automated
Experiment
Experiment
Experiment
● Ship the image using a (private) Docker Registry
● Orchestrate the Image: docker-compose.yml
Build, Ship & Run
Where ‘Run’ == ‘Orchestrate’
● Build the image: Dockerfile + context -> Docker Image
For the developer the orchestration should be transparent and out of scope.
Artifacts are:
1. Dockerfile + context (git repository)
2. docker-compose.yml (git repository)
Application Containerization
Portability, Reproducibility
As a developer I want to work on a
webapp for DockerCon EU, which
represents a simple three tier stack.
● web: JS app I am working on
● words: API serving business logic
● db: Database backend
web
api
db
api
Prerequisite for Workshop
http://qnib.org/devops-workflow
Docker Desktop
- Docker4Mac / Docker4Win edge-channel (provides kubernetes)
- DockerCE for Linux
Git Repository
git clone https://github.com/ChristianKniep/k8s-wordsmith-demo.git
cd k8s-wordsmith-demo.git
git checkout update/container_to_kube
docker-compose pull
cd swarmprom ; docker-compose pull
#1 Building the Image(s)
First Step as a Developer
docker-compose build
$ export TAG=$(date +%s)
$ docker-compose build
WARNING: Some services (api) use the 'deploy' key, which will be ignored.
Building web
Step 1/12 : FROM golang:1.9.1-alpine3.6 as builder
*snip*
Successfully tagged qnib/k8s-wordsmith-web:1518955537
Building api
*snip*
Successfully tagged qnib/k8s-wordsmith-api:1518955537
Building db
*snip*
Successfully tagged qnib/k8s-wordsmith-db:1518955537
#2 Simple Container
One-shot Orchestration
docker-compose build
$ docker-compose up
WARNING: Some services (api) use the 'deploy' key, which will be ignored.
Creating network "k8swordsmithdemo_default" with the default driver
Creating k8swordsmithdemo_web_1 ... done
Creating k8swordsmithdemo_api_1 ... done
Creating k8swordsmithdemo_db_1 ... done
Attaching to k8swordsmithdemo_db_1, k8swordsmithdemo_api_1,
k8swordsmithdemo_web_1
db_1 | The files belonging to this database system will be owned by user
"postgres".
db_1 | This user must also own the server process.
#3 Deploying Stack in SWARM
Simple yet Powerful Orchestration
SWARM at a Glance
Easy to understand and reason about
$ cd swarmprom
$ docker stack deploy -c docker-compose.yml prom
Creating network prom_net
Creating config prom_service_rules
Creating config prom_node_name
Creating config prom_caddy_config
Creating config prom_dockerd_config
Creating config prom_node_rules
Creating config prom_task_rules
Creating service prom_caddy
Creating service prom_dockerd-exporter
Creating service prom_cadvisor
Creating service prom_grafana
Creating service prom_node-exporter
Creating service prom_prometheus
Deploy Auxiliary Stack to Monitor SWARM
Fork of: https://github.com/stefanprodan/swarmprom
Docker stack deploy
Using the Docker SWARM API
$ docker stack deploy -c docker-compose.yml words
Ignoring unsupported options: build
Creating network words_default
Creating service words_web
Creating service words_db
Creating service words_api
$ docker service ls --format="{{.Name}}t{{.Replicas}}t{{.Image}}t{{.Ports}}"
words_api 5/5 qnib/k8s-wordsmith-api:1518955537
words_db 1/1 qnib/k8s-wordsmith-db:1518955537
words_web 1/1 qnib/k8s-wordsmith-web:1518955537 *:8080->80/tcp
$
$ docker stack deploy -c docker-compose.yml words #2>dev/null
Updating service words_web (id: fv7z1lryqmysxhzobdjrbgecl)
image qnib/k8s-wordsmith-web:1518955537 could not be accessed on a
registry to record its digest. Each node will access
qnib/k8s-wordsmith-web:1518955537 independently, possibly leading to
different nodes running different versions of the image.
#4 Deploying Stack in Kubernetes
Using CustomResourceDefinitions
Docker stack deploy #2
Using the docker-CRD within Kube
$ docker stack rm words
Removing service words_api
Removing service words_db
Removing service words_web
Removing network words_default
$ export DOCKER_ORCHESTRATOR=kubernetes
$ docker stack deploy -c docker-compose.yml words
Stack words was created
Waiting for the stack to be stable and running...
- Service api has one container running
- Service db has one container running
- Service web has one container running
Stack words is stable and running
$
#5 Deploying Stack in Kubernetes
Using Kubernetes Object Files
Kubectl deploy #2
Using the kubectl CLI
$ export
DOCKER_ORCHESTRATOR=kubernetes
$ kubectl apply -f .
deployment "kube-api" created
service "kube-api" created
deployment "kube-db" created
service "kube-db" created
deployment "kube-web" created
service "kube-web" created
$
THANK YOU :)
christian.kniep@docker.com

Contenu connexe

Tendances

Simply your Jenkins Projects with Docker Multi-Stage Builds
Simply your Jenkins Projects with Docker Multi-Stage BuildsSimply your Jenkins Projects with Docker Multi-Stage Builds
Simply your Jenkins Projects with Docker Multi-Stage Builds
Eric Smalling
 
How to integrate front end tool via gruntjs
How to integrate front end tool via gruntjsHow to integrate front end tool via gruntjs
How to integrate front end tool via gruntjs
Bo-Yi Wu
 

Tendances (20)

Lessons Learned: Using Concourse In Production
Lessons Learned: Using Concourse In ProductionLessons Learned: Using Concourse In Production
Lessons Learned: Using Concourse In Production
 
Improve your Java Environment with Docker
Improve your Java Environment with DockerImprove your Java Environment with Docker
Improve your Java Environment with Docker
 
Rapid Development With Docker Compose
Rapid Development With Docker ComposeRapid Development With Docker Compose
Rapid Development With Docker Compose
 
DCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker Captains
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
 
Jenkins, pipeline and docker
Jenkins, pipeline and docker Jenkins, pipeline and docker
Jenkins, pipeline and docker
 
Testing as a container
Testing as a containerTesting as a container
Testing as a container
 
Concourse - CI for the cloud
Concourse - CI for the cloudConcourse - CI for the cloud
Concourse - CI for the cloud
 
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
 
為 Node.js 專案打造專屬管家進行開發流程整合及健康檢測
為 Node.js 專案打造專屬管家進行開發流程整合及健康檢測為 Node.js 專案打造專屬管家進行開發流程整合及健康檢測
為 Node.js 專案打造專屬管家進行開發流程整合及健康檢測
 
Techbash 2017 - Modernizing Traditional.NET Apps with Docker
Techbash 2017 - Modernizing Traditional.NET Apps with DockerTechbash 2017 - Modernizing Traditional.NET Apps with Docker
Techbash 2017 - Modernizing Traditional.NET Apps with Docker
 
Jenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Jenkins Days - Workshop - Let's Build a Pipeline - Los AngelesJenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Jenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
 
Simply your Jenkins Projects with Docker Multi-Stage Builds
Simply your Jenkins Projects with Docker Multi-Stage BuildsSimply your Jenkins Projects with Docker Multi-Stage Builds
Simply your Jenkins Projects with Docker Multi-Stage Builds
 
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chef
 
Ci For The Web 2.0 Guy Or Gal
Ci For The Web 2.0 Guy Or GalCi For The Web 2.0 Guy Or Gal
Ci For The Web 2.0 Guy Or Gal
 
Developer South Coast 2018: Docker on Windows - The Beginner's Guide
Developer South Coast 2018: Docker on Windows - The Beginner's GuideDeveloper South Coast 2018: Docker on Windows - The Beginner's Guide
Developer South Coast 2018: Docker on Windows - The Beginner's Guide
 
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
 
Developer South Coast 2018: Modernizing .NET Apps with Docker
Developer South Coast 2018: Modernizing .NET Apps with DockerDeveloper South Coast 2018: Modernizing .NET Apps with Docker
Developer South Coast 2018: Modernizing .NET Apps with Docker
 
How to integrate front end tool via gruntjs
How to integrate front end tool via gruntjsHow to integrate front end tool via gruntjs
How to integrate front end tool via gruntjs
 
Jenkins days workshop pipelines - Eric Long
Jenkins days workshop  pipelines - Eric LongJenkins days workshop  pipelines - Eric Long
Jenkins days workshop pipelines - Eric Long
 

Similaire à DevOps Workflow: A Tutorial on Linux Containers

Similaire à DevOps Workflow: A Tutorial on Linux Containers (20)

DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slides
 
廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班
 
Docker 進階實務班
Docker 進階實務班Docker 進階實務班
Docker 進階實務班
 
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day ThailandCI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
 
Docker as development environment
Docker as development environmentDocker as development environment
Docker as development environment
 
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
 
Omaha (Google Update) server
Omaha (Google Update) serverOmaha (Google Update) server
Omaha (Google Update) server
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development Pipeline
 
Continuous Delivery with Docker and Amazon ECS
Continuous Delivery with Docker and Amazon ECSContinuous Delivery with Docker and Amazon ECS
Continuous Delivery with Docker and Amazon ECS
 
Pluralsight Webinar: Simplify Your Project Builds with Docker
Pluralsight Webinar: Simplify Your Project Builds with DockerPluralsight Webinar: Simplify Your Project Builds with Docker
Pluralsight Webinar: Simplify Your Project Builds with Docker
 
[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안
 
Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020
 
Develop with docker 2014 aug
Develop with docker 2014 augDevelop with docker 2014 aug
Develop with docker 2014 aug
 
Kubernetes - training micro-dragons without getting burnt
Kubernetes -  training micro-dragons without getting burntKubernetes -  training micro-dragons without getting burnt
Kubernetes - training micro-dragons without getting burnt
 
How to create your own hack environment
How to create your own hack environmentHow to create your own hack environment
How to create your own hack environment
 
Mihai Criveti - PyCon Ireland - Automate Everything
Mihai Criveti - PyCon Ireland - Automate EverythingMihai Criveti - PyCon Ireland - Automate Everything
Mihai Criveti - PyCon Ireland - Automate Everything
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java bin
 
Docker Containers: Developer’s experience and building robust developer envir...
Docker Containers: Developer’s experience and building robust developer envir...Docker Containers: Developer’s experience and building robust developer envir...
Docker Containers: Developer’s experience and building robust developer envir...
 
Production sec ops with kubernetes in docker
Production sec ops with kubernetes in dockerProduction sec ops with kubernetes in docker
Production sec ops with kubernetes in docker
 

Plus de inside-BigData.com

Preparing to program Aurora at Exascale - Early experiences and future direct...
Preparing to program Aurora at Exascale - Early experiences and future direct...Preparing to program Aurora at Exascale - Early experiences and future direct...
Preparing to program Aurora at Exascale - Early experiences and future direct...
inside-BigData.com
 
Transforming Private 5G Networks
Transforming Private 5G NetworksTransforming Private 5G Networks
Transforming Private 5G Networks
inside-BigData.com
 
Biohybrid Robotic Jellyfish for Future Applications in Ocean Monitoring
Biohybrid Robotic Jellyfish for Future Applications in Ocean MonitoringBiohybrid Robotic Jellyfish for Future Applications in Ocean Monitoring
Biohybrid Robotic Jellyfish for Future Applications in Ocean Monitoring
inside-BigData.com
 
Machine Learning for Weather Forecasts
Machine Learning for Weather ForecastsMachine Learning for Weather Forecasts
Machine Learning for Weather Forecasts
inside-BigData.com
 
Energy Efficient Computing using Dynamic Tuning
Energy Efficient Computing using Dynamic TuningEnergy Efficient Computing using Dynamic Tuning
Energy Efficient Computing using Dynamic Tuning
inside-BigData.com
 
Versal Premium ACAP for Network and Cloud Acceleration
Versal Premium ACAP for Network and Cloud AccelerationVersal Premium ACAP for Network and Cloud Acceleration
Versal Premium ACAP for Network and Cloud Acceleration
inside-BigData.com
 
Introducing HPC with a Raspberry Pi Cluster
Introducing HPC with a Raspberry Pi ClusterIntroducing HPC with a Raspberry Pi Cluster
Introducing HPC with a Raspberry Pi Cluster
inside-BigData.com
 

Plus de inside-BigData.com (20)

Major Market Shifts in IT
Major Market Shifts in ITMajor Market Shifts in IT
Major Market Shifts in IT
 
Preparing to program Aurora at Exascale - Early experiences and future direct...
Preparing to program Aurora at Exascale - Early experiences and future direct...Preparing to program Aurora at Exascale - Early experiences and future direct...
Preparing to program Aurora at Exascale - Early experiences and future direct...
 
Transforming Private 5G Networks
Transforming Private 5G NetworksTransforming Private 5G Networks
Transforming Private 5G Networks
 
The Incorporation of Machine Learning into Scientific Simulations at Lawrence...
The Incorporation of Machine Learning into Scientific Simulations at Lawrence...The Incorporation of Machine Learning into Scientific Simulations at Lawrence...
The Incorporation of Machine Learning into Scientific Simulations at Lawrence...
 
How to Achieve High-Performance, Scalable and Distributed DNN Training on Mod...
How to Achieve High-Performance, Scalable and Distributed DNN Training on Mod...How to Achieve High-Performance, Scalable and Distributed DNN Training on Mod...
How to Achieve High-Performance, Scalable and Distributed DNN Training on Mod...
 
Evolving Cyberinfrastructure, Democratizing Data, and Scaling AI to Catalyze ...
Evolving Cyberinfrastructure, Democratizing Data, and Scaling AI to Catalyze ...Evolving Cyberinfrastructure, Democratizing Data, and Scaling AI to Catalyze ...
Evolving Cyberinfrastructure, Democratizing Data, and Scaling AI to Catalyze ...
 
HPC Impact: EDA Telemetry Neural Networks
HPC Impact: EDA Telemetry Neural NetworksHPC Impact: EDA Telemetry Neural Networks
HPC Impact: EDA Telemetry Neural Networks
 
Biohybrid Robotic Jellyfish for Future Applications in Ocean Monitoring
Biohybrid Robotic Jellyfish for Future Applications in Ocean MonitoringBiohybrid Robotic Jellyfish for Future Applications in Ocean Monitoring
Biohybrid Robotic Jellyfish for Future Applications in Ocean Monitoring
 
Machine Learning for Weather Forecasts
Machine Learning for Weather ForecastsMachine Learning for Weather Forecasts
Machine Learning for Weather Forecasts
 
HPC AI Advisory Council Update
HPC AI Advisory Council UpdateHPC AI Advisory Council Update
HPC AI Advisory Council Update
 
Fugaku Supercomputer joins fight against COVID-19
Fugaku Supercomputer joins fight against COVID-19Fugaku Supercomputer joins fight against COVID-19
Fugaku Supercomputer joins fight against COVID-19
 
Energy Efficient Computing using Dynamic Tuning
Energy Efficient Computing using Dynamic TuningEnergy Efficient Computing using Dynamic Tuning
Energy Efficient Computing using Dynamic Tuning
 
HPC at Scale Enabled by DDN A3i and NVIDIA SuperPOD
HPC at Scale Enabled by DDN A3i and NVIDIA SuperPODHPC at Scale Enabled by DDN A3i and NVIDIA SuperPOD
HPC at Scale Enabled by DDN A3i and NVIDIA SuperPOD
 
State of ARM-based HPC
State of ARM-based HPCState of ARM-based HPC
State of ARM-based HPC
 
Versal Premium ACAP for Network and Cloud Acceleration
Versal Premium ACAP for Network and Cloud AccelerationVersal Premium ACAP for Network and Cloud Acceleration
Versal Premium ACAP for Network and Cloud Acceleration
 
Zettar: Moving Massive Amounts of Data across Any Distance Efficiently
Zettar: Moving Massive Amounts of Data across Any Distance EfficientlyZettar: Moving Massive Amounts of Data across Any Distance Efficiently
Zettar: Moving Massive Amounts of Data across Any Distance Efficiently
 
Scaling TCO in a Post Moore's Era
Scaling TCO in a Post Moore's EraScaling TCO in a Post Moore's Era
Scaling TCO in a Post Moore's Era
 
CUDA-Python and RAPIDS for blazing fast scientific computing
CUDA-Python and RAPIDS for blazing fast scientific computingCUDA-Python and RAPIDS for blazing fast scientific computing
CUDA-Python and RAPIDS for blazing fast scientific computing
 
Introducing HPC with a Raspberry Pi Cluster
Introducing HPC with a Raspberry Pi ClusterIntroducing HPC with a Raspberry Pi Cluster
Introducing HPC with a Raspberry Pi Cluster
 
Overview of HPC Interconnects
Overview of HPC InterconnectsOverview of HPC Interconnects
Overview of HPC Interconnects
 

Dernier

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 

DevOps Workflow: A Tutorial on Linux Containers

  • 1. DevOps Workflow From 0 to kube in 60 min Christian Kniep, v2018-02-20 Technical Account Manager, Docker Inc.http://qnib.org/devops-workflow
  • 3. ClusterLaptop Works on my Laptop! Why is DevOps not enough. ProdDevelopment Dev Artifact: code Env: interactive Ops Artifact: pkg/img Env: automated DevOps Release/Integration Release Artifact: pkg/img Env: automated DevRelOps Prod Ops Artifact: pkg/img Env: automated Development Dev Artifact: code Env: interactive DevRel*Ops Prod Ops Artifact: pkg/img Env: automated Development Dev Artifact: code Env: interactive Q&A Performance Release/Integration Release Artifact: pkg/img Env: automated Experiment Experiment Experiment
  • 4. ● Ship the image using a (private) Docker Registry ● Orchestrate the Image: docker-compose.yml Build, Ship & Run Where ‘Run’ == ‘Orchestrate’ ● Build the image: Dockerfile + context -> Docker Image For the developer the orchestration should be transparent and out of scope. Artifacts are: 1. Dockerfile + context (git repository) 2. docker-compose.yml (git repository)
  • 5. Application Containerization Portability, Reproducibility As a developer I want to work on a webapp for DockerCon EU, which represents a simple three tier stack. ● web: JS app I am working on ● words: API serving business logic ● db: Database backend web api db api
  • 6. Prerequisite for Workshop http://qnib.org/devops-workflow Docker Desktop - Docker4Mac / Docker4Win edge-channel (provides kubernetes) - DockerCE for Linux Git Repository git clone https://github.com/ChristianKniep/k8s-wordsmith-demo.git cd k8s-wordsmith-demo.git git checkout update/container_to_kube docker-compose pull cd swarmprom ; docker-compose pull
  • 7. #1 Building the Image(s) First Step as a Developer
  • 8. docker-compose build $ export TAG=$(date +%s) $ docker-compose build WARNING: Some services (api) use the 'deploy' key, which will be ignored. Building web Step 1/12 : FROM golang:1.9.1-alpine3.6 as builder *snip* Successfully tagged qnib/k8s-wordsmith-web:1518955537 Building api *snip* Successfully tagged qnib/k8s-wordsmith-api:1518955537 Building db *snip* Successfully tagged qnib/k8s-wordsmith-db:1518955537
  • 10. docker-compose build $ docker-compose up WARNING: Some services (api) use the 'deploy' key, which will be ignored. Creating network "k8swordsmithdemo_default" with the default driver Creating k8swordsmithdemo_web_1 ... done Creating k8swordsmithdemo_api_1 ... done Creating k8swordsmithdemo_db_1 ... done Attaching to k8swordsmithdemo_db_1, k8swordsmithdemo_api_1, k8swordsmithdemo_web_1 db_1 | The files belonging to this database system will be owned by user "postgres". db_1 | This user must also own the server process.
  • 11. #3 Deploying Stack in SWARM Simple yet Powerful Orchestration
  • 12. SWARM at a Glance Easy to understand and reason about
  • 13. $ cd swarmprom $ docker stack deploy -c docker-compose.yml prom Creating network prom_net Creating config prom_service_rules Creating config prom_node_name Creating config prom_caddy_config Creating config prom_dockerd_config Creating config prom_node_rules Creating config prom_task_rules Creating service prom_caddy Creating service prom_dockerd-exporter Creating service prom_cadvisor Creating service prom_grafana Creating service prom_node-exporter Creating service prom_prometheus Deploy Auxiliary Stack to Monitor SWARM Fork of: https://github.com/stefanprodan/swarmprom
  • 14. Docker stack deploy Using the Docker SWARM API $ docker stack deploy -c docker-compose.yml words Ignoring unsupported options: build Creating network words_default Creating service words_web Creating service words_db Creating service words_api $ docker service ls --format="{{.Name}}t{{.Replicas}}t{{.Image}}t{{.Ports}}" words_api 5/5 qnib/k8s-wordsmith-api:1518955537 words_db 1/1 qnib/k8s-wordsmith-db:1518955537 words_web 1/1 qnib/k8s-wordsmith-web:1518955537 *:8080->80/tcp $ $ docker stack deploy -c docker-compose.yml words #2>dev/null Updating service words_web (id: fv7z1lryqmysxhzobdjrbgecl) image qnib/k8s-wordsmith-web:1518955537 could not be accessed on a registry to record its digest. Each node will access qnib/k8s-wordsmith-web:1518955537 independently, possibly leading to different nodes running different versions of the image.
  • 15. #4 Deploying Stack in Kubernetes Using CustomResourceDefinitions
  • 16. Docker stack deploy #2 Using the docker-CRD within Kube $ docker stack rm words Removing service words_api Removing service words_db Removing service words_web Removing network words_default $ export DOCKER_ORCHESTRATOR=kubernetes $ docker stack deploy -c docker-compose.yml words Stack words was created Waiting for the stack to be stable and running... - Service api has one container running - Service db has one container running - Service web has one container running Stack words is stable and running $
  • 17. #5 Deploying Stack in Kubernetes Using Kubernetes Object Files
  • 18. Kubectl deploy #2 Using the kubectl CLI $ export DOCKER_ORCHESTRATOR=kubernetes $ kubectl apply -f . deployment "kube-api" created service "kube-api" created deployment "kube-db" created service "kube-db" created deployment "kube-web" created service "kube-web" created $