SlideShare une entreprise Scribd logo
1  sur  39
Télécharger pour lire hors ligne
Automating the CI / CD pipeline
of your containerized
applications
Lauri Nevala, co-founder and engineer@KontenaInc
@nevalau
Kontena briefly
© 2016 Kontena, Inc.
What is Kontena?
Open Source container platform built to
maximize developer happiness. Works on
any cloud, easy to setup, simple to use.
The Container Platform
All Batteries Included!
Built-In Image Registry
Sometimes projects can not use publicly
hosted container image registries like
DockerHub. Kontena comes with built-in
container image registry providing private and
secure solution.
Built-In VPN Access
All containers are run inside a virtual private
network by default. Nothing is exposed to
Internet unless explicitly defined. With
Kontena’s built-in VPN access developers can
securely access those resources.
Built-In Load Balancer
Kontena comes with built-in load balancer.
Based on Haproxy. It features fully automatic,
zero-downtime operation due to deep
integration with Kontena’s service discovery
and orchestration technology.
Aggregated Stats & Logs
Kontena provides real-time log and statistics
streams containers. The streams may be
grouped and aggregated to produce service
level streams. This allows easy viewing of logs
and statistics for your application CPU,
memory, disk and network usage.
User Management with Audit Trail
All events and actions performed through
Kontena CLI or APIs are logged into audit trail.
Combined with users and access control, the
audit trail support makes Kontena a reliable
and secure solution for any enterprise
deployments.
Built-In Secrets Management
When your application requires access to APIs
or databases, you'll often need to use secrets
such as passwords and access tokens for
authenticating the access. Kontena Vault is a
secure key/value storage that can be used to
manage secrets in Kontena.
“Includes all the sh*t you don’t need to
implement by yourself”
What is Drone?
•Docker based CI/CD platform
•Easy to install & maintain
•Isolated builds (Docker containers)
•Pluggable (Docker containers)
•Integrates to Github / Gitlab and others
•Travis like “just works” feeling
© 2016 Kontena, Inc.
Why should I care?
© 2015 Kontena, Inc.
© 2015 Kontena, Inc.
Sometimes size does matter
Why Should I Care?
•Lightweight, low memory footprint
•Single binary, written in Go
•Docker native
•Simple YAML configuration
•Supports any language that can run in Docker
© 2016 Kontena, Inc.
Installation
•Single binary, just execute
•Docker image (preferred way)
•Configurationthrough environment variables
•0.5 introduced build agents, easy to scale
© 2016 Kontena, Inc.
Installation: The Docker Way
© 2016 Kontena, Inc.
$ docker run -d
-v /var/lib/drone:/var/lib/drone
-v /var/run/docker.sock:/var/run/docker.sock
--env-file /etc/drone/dronerc
--restart=always --publish=80:8000
--detach=true --name=drone
drone/drone:0.4
Installation: The Kontena Way
© 2016 Kontena, Inc.
server:
image: drone/drone:0.5
instances: 1
stateful: true
deploy:
strategy: ha
wait_for_port: 80
ports:
- 8080:80
environment:
- DRONE_DEBUG=true
- DRONE_GITHUB=true
- DRONE_SERVER_ADDR=0.0.0.0:80
- DRONE_OPEN=true
- DATABASE_DRIVER=sqlite3
- DATABASE_CONFIG=/var/lib/drone/drone.sqlite
secrets:
- secret: DRONE_GITHUB_CLIENT_ID
name: DRONE_GITHUB_CLIENT
type: env
....
volumes:
- /var/lib/drone
agent:
image: drone/drone:0.5
stateful:no
instances:3
depends_on:
- server
environment:
- DRONE_DEBUG=true
- DRONE_SERVER=http://%{project}-server:80
secrets:
- secret: DRONE_SHARED_SECRET
name: DRONE_SECRET
type: env
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command:agent
Configuration
•Remote driver
• Bitbucket, Github, Gitlab, Gogs
•Database
• SQLite (default), Postgres, MySQL
•Plugins
• Filter
• Global params
© 2016 Kontena, Inc.
Concepts – the “.drone.yml”
•Plugins
•Pipeline
•Services
•Matrix
•Secrets
•Constraints
© 2016 Kontena, Inc.
Concepts - Plugins
• Plugin is actually just a Docker image
• Container created and executed part of pipeline
• Exit code determines success/failure
© 2016 Kontena, Inc.
pipeline:
test:
image: ruby:2.3
commands:
- bundle install --path=bundler
- rspec spec/
Concepts – Pipeline
•Arbitrary set of “plugins” to run as the build process
•Success determined by exit code
•Defined in .drone.yml
© 2016 Kontena, Inc.
Concepts – Services
• Set of services needed in the build process
• Available on the same network namespace as build containers
• Handy for eg. Databases used in testing
© 2016 Kontena, Inc.
Concepts – Matrix
• Build a single commit against many configurations
• Interpolated as variables in yaml parsing
© 2016 Kontena, Inc.
Concepts – Matrix
© 2016 Kontena, Inc.
pipeline:
build:
image: golang:${GO_VERSION}
commands:
- go get
- go build
- go test
services:
database:
image: ${DATABASE}
matrix:
GO_VERSION:
- 1.4
- 1.3
DATABASE:
- mysql:5.5
- mysql:6.5
- mariadb:10.1
Concepts – Secrets
• Keep your secrets out of VCS
• Injected into build containers
• Some plugins use automatically
• Available in the env
• Available only to specific container in build
• Blast radius
© 2016 Kontena, Inc.
Concepts – Secrets
© 2016 Kontena, Inc.
$ drone secret ls nevalla/todo-example
DOCKER_USERNAME
Images: plugins/docker
Events: push, tag, deployment
DOCKER_PASSWORD
Images: plugins/docker
Events: push, tag, deployment
DOCKER_EMAIL
Images: plugins/docker
Events: push, tag, deployment
KONTENA_TOKEN
Images: jnummelin/kontena-cli
Events: push, tag, deployment
KONTENA_URL
Images: jnummelin/kontena-cli
Events: push, tag, deployment
KONTENA_GRID
Images: jnummelin/kontena-cli
Events: push, tag, deployment
Concepts – Constraints
• Limit execution of build steps at runtime
• Branches: [master, develop]
• Events: tag, push, pull_request, …
• Platform: [ linux/*, windows/amd64 ]
• “Deploy when pushed to master” type of things
© 2016 Kontena, Inc.
Demo!
Setup Kontena Grid
1. Create Kontena Master
© 2016 Kontena, Inc.
kontena digitalocean master create --token=$DO_TOKEN
Generating self-signed SSL certificate...
Creating DigitalOcean droplet kontena-master-rough-
butterfly-2 ...
Waiting for kontena-master-rough-butterfly-2 to start...
Kontena Master is now running at https://192.86.22.19
Use kontena login --name=rough-butterfly-2
https://192.86.22.19 to complete Kontena Master setup
$
done
done
$
2. Login
© 2016 Kontena, Inc.
kontena login --name devops-dam https://192.86.22.19
Email: lauri@kontena.io
Password: **************
_ _
| | _____ _ __ | |_ ___ _ __ __ _
| |/ / _ | '_ | __/ _  '_  / _` |
| < (_) | | | | || __/ | | | (_| |
|_|____/|_| |_|_____|_| |_|__,_|
-------------------------------------
Copyright (c)2016 Kontena, Inc.
Logged in as lauri@kontena.io
Welcome! See 'kontena --help' to get started.
$
$
3. Add Nodes
© 2016 Kontena, Inc.
kontena grid create drone
Using grid: drone
$ kontena digitalocean node create --token=$DO_TOKEN
Creating DigitalOcean droplet proud-waterfall-3 ...
Waiting for node proud-waterfall-3 join to grid drone ...
kontena digitalocean node create --token=$DO_TOKEN
Creating DigitalOcean droplet cold-dream-44...
Waiting for node cold-dream-44 join to grid drone ...
kontena digitalocean node create --token=$DO_TOKEN
Creating DigitalOcean droplet falling-resonance-59...
Waiting for node falling-resonance-59 join to grid drone
...
$
done
done
done
done
done
$
done
$
$
Deploy Drone
Create Secrets – kontena.yml
© 2016 Kontena, Inc.
version: '2'
name: drone
services:
server:
image: drone/drone:0.5
instances: 1
…
secrets:
- secret: DRONE_GITHUB_CLIENT_ID
name: DRONE_GITHUB_CLIENT
type: env
- secret: DRONE_GITHUB_CLIENT_SECRET
name: DRONE_GITHUB_SECRET
type: env
- secret: DRONE_SHARED_SECRET
name: DRONE_AGENT_SECRET
type: env
- secret: DRONE_ADMIN_USERNAMES
name: DRONE_ADMIN
type: env
Create GitHub OAuth Application
© 2016 Kontena, Inc.
Write secrets
© 2016 Kontena, Inc.
$ kontena vault write DRONE_GITHUB_CLIENT_ID 909da55bb031dd5
$ kontena vault write DRONE_GITHUB_CLIENT_SECRET xxxyyyzzz
$ kontena vault write DRONE_SHARED_SECRET RleCk8iaqnyngszUQQh
$ kontena vault write DRONE_ADMIN_USERNAMES nevalla
$
Deploy Drone
© 2016 Kontena, Inc.
$ kontena app deploy
creating server
creating agent
deploying server ... done
deploying agent ... done
$
git push
webhook
docker push
dockerpull
Next Steps
Try Kontena
• Quick Start Guide:
https://kontena.io/docs/getting-started/quick-start
• Drone Example:
https://github.com/kontena/examples/tree/master/drone/0.5
• Give Feedback, join discussion@ slack, tweet, star on GitHub
$25 Credits for Testing
https://www.packet.net/promo/kontena/
Thank You!
www.kontena.io
We are hiring!
kontena.io/jobs

Contenu connexe

Tendances

Tendances (20)

Running Docker in Production - The Good, the Bad and The Ugly
Running Docker in Production - The Good, the Bad and The UglyRunning Docker in Production - The Good, the Bad and The Ugly
Running Docker in Production - The Good, the Bad and The Ugly
 
Orchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresOrchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failures
 
Practical Design Patterns in Docker Networking
Practical Design Patterns in Docker NetworkingPractical Design Patterns in Docker Networking
Practical Design Patterns in Docker Networking
 
Docker and Microsoft - Windows Server 2016 Technical Deep Dive
Docker and Microsoft - Windows Server 2016 Technical Deep DiveDocker and Microsoft - Windows Server 2016 Technical Deep Dive
Docker and Microsoft - Windows Server 2016 Technical Deep Dive
 
Docker Datacenter Overview and Production Setup Slides
Docker Datacenter Overview and Production Setup SlidesDocker Datacenter Overview and Production Setup Slides
Docker Datacenter Overview and Production Setup Slides
 
Docker SF Meetup January 2016
Docker SF Meetup January 2016Docker SF Meetup January 2016
Docker SF Meetup January 2016
 
Building High Availability Application with Docker
Building High Availability Application with DockerBuilding High Availability Application with Docker
Building High Availability Application with Docker
 
Docker to the Rescue of an Ops Team
Docker to the Rescue of an Ops TeamDocker to the Rescue of an Ops Team
Docker to the Rescue of an Ops Team
 
Docker for Java Developers
Docker for Java DevelopersDocker for Java Developers
Docker for Java Developers
 
Docker for any type of workload and any IT Infrastructure
Docker for any type of workload and any IT InfrastructureDocker for any type of workload and any IT Infrastructure
Docker for any type of workload and any IT Infrastructure
 
Docker Meetup 08 03-2016
Docker Meetup 08 03-2016Docker Meetup 08 03-2016
Docker Meetup 08 03-2016
 
Docker Online Meetup: Infrakit update and Q&A
Docker Online Meetup: Infrakit update and Q&ADocker Online Meetup: Infrakit update and Q&A
Docker Online Meetup: Infrakit update and Q&A
 
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
 
Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...
Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...
Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...
 
Dev with Docker WCPHX 2019
Dev with Docker WCPHX 2019Dev with Docker WCPHX 2019
Dev with Docker WCPHX 2019
 
Containers without docker
Containers without dockerContainers without docker
Containers without docker
 
DCSF19 How To Build Your Containerization Strategy
DCSF19 How To Build Your Containerization Strategy  DCSF19 How To Build Your Containerization Strategy
DCSF19 How To Build Your Containerization Strategy
 
Cloudfoundry Overview
Cloudfoundry OverviewCloudfoundry Overview
Cloudfoundry Overview
 
Websockets: Pushing the web forward
Websockets: Pushing the web forwardWebsockets: Pushing the web forward
Websockets: Pushing the web forward
 
Taking Docker to Production: What You Need to Know and Decide
Taking Docker to Production: What You Need to Know and DecideTaking Docker to Production: What You Need to Know and Decide
Taking Docker to Production: What You Need to Know and Decide
 

En vedette

Highly efficient container orchestration and continuous delivery with DC/OS a...
Highly efficient container orchestration and continuous delivery with DC/OS a...Highly efficient container orchestration and continuous delivery with DC/OS a...
Highly efficient container orchestration and continuous delivery with DC/OS a...
Christian Bogeberg
 

En vedette (20)

How Docker simplifies CI/CD
How Docker simplifies CI/CDHow Docker simplifies CI/CD
How Docker simplifies CI/CD
 
Jenkins + Docker = Continuous Improvement
Jenkins + Docker = Continuous ImprovementJenkins + Docker = Continuous Improvement
Jenkins + Docker = Continuous Improvement
 
Pluggable Infrastructure with CI/CD and Docker
Pluggable Infrastructure with CI/CD and DockerPluggable Infrastructure with CI/CD and Docker
Pluggable Infrastructure with CI/CD and Docker
 
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...
 
Building a Docker powered feature driven delivery pipeline at hoyhoy.nl
Building a Docker powered feature driven delivery pipeline at hoyhoy.nlBuilding a Docker powered feature driven delivery pipeline at hoyhoy.nl
Building a Docker powered feature driven delivery pipeline at hoyhoy.nl
 
CI/CD Using Ansible and Jenkins for Infrastructure
CI/CD Using Ansible and Jenkins for InfrastructureCI/CD Using Ansible and Jenkins for Infrastructure
CI/CD Using Ansible and Jenkins for Infrastructure
 
Continuous Delivery with Jenkins Workflow
Continuous Delivery with Jenkins WorkflowContinuous Delivery with Jenkins Workflow
Continuous Delivery with Jenkins Workflow
 
Jenkins - From Continuous Integration to Continuous Delivery
Jenkins - From Continuous Integration to Continuous DeliveryJenkins - From Continuous Integration to Continuous Delivery
Jenkins - From Continuous Integration to Continuous Delivery
 
Achieving CI/CD with Kubernetes
Achieving CI/CD with KubernetesAchieving CI/CD with Kubernetes
Achieving CI/CD with Kubernetes
 
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) PipelineAnatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
 
KubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipeline
KubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipelineKubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipeline
KubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipeline
 
Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...
Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...
Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...
 
Ogs 3 d mapping compressed
Ogs 3 d mapping compressedOgs 3 d mapping compressed
Ogs 3 d mapping compressed
 
Towards an adaptable spatial processing architecture
Towards an adaptable spatial processing architectureTowards an adaptable spatial processing architecture
Towards an adaptable spatial processing architecture
 
Highly efficient container orchestration and continuous delivery with DC/OS a...
Highly efficient container orchestration and continuous delivery with DC/OS a...Highly efficient container orchestration and continuous delivery with DC/OS a...
Highly efficient container orchestration and continuous delivery with DC/OS a...
 
Lab n 3 fisica
Lab n 3 fisicaLab n 3 fisica
Lab n 3 fisica
 
Uso de dispositivos móviles en las bibliotecas
Uso de dispositivos móviles en las bibliotecasUso de dispositivos móviles en las bibliotecas
Uso de dispositivos móviles en las bibliotecas
 
We live in narrative environments
We live in narrative environmentsWe live in narrative environments
We live in narrative environments
 
Elniño asesino
Elniño asesinoElniño asesino
Elniño asesino
 
Barcelona MeetUp - Kontena Intro
Barcelona MeetUp - Kontena IntroBarcelona MeetUp - Kontena Intro
Barcelona MeetUp - Kontena Intro
 

Similaire à Automating the CI / CD pipeline of your containerized applications

Similaire à Automating the CI / CD pipeline of your containerized applications (20)

Continuous Delivery of Containers with Drone & Kontena
Continuous Delivery of Containers with Drone & KontenaContinuous Delivery of Containers with Drone & Kontena
Continuous Delivery of Containers with Drone & Kontena
 
The Developer Friendly Container & Micro Services Platform
The Developer Friendly Container & Micro Services PlatformThe Developer Friendly Container & Micro Services Platform
The Developer Friendly Container & Micro Services Platform
 
Beginners Guide To Kontena
Beginners Guide To KontenaBeginners Guide To Kontena
Beginners Guide To Kontena
 
Cicd.pdf
Cicd.pdfCicd.pdf
Cicd.pdf
 
Docker - A high level introduction to dockers and containers
Docker - A high level introduction to dockers and containersDocker - A high level introduction to dockers and containers
Docker - A high level introduction to dockers and containers
 
CA Performance Manager Agility by using Docker Containers for Network Manag...
CA Performance Manager Agility by using Docker Containers for Network Manag...CA Performance Manager Agility by using Docker Containers for Network Manag...
CA Performance Manager Agility by using Docker Containers for Network Manag...
 
The path to a serverless-native era with Kubernetes
The path to a serverless-native era with KubernetesThe path to a serverless-native era with Kubernetes
The path to a serverless-native era with Kubernetes
 
NYC Identity Summit Tech Day: ForgeRock DevOps/Cloud Strategy
NYC Identity Summit Tech Day: ForgeRock DevOps/Cloud StrategyNYC Identity Summit Tech Day: ForgeRock DevOps/Cloud Strategy
NYC Identity Summit Tech Day: ForgeRock DevOps/Cloud Strategy
 
The world of Docker and Kubernetes
The world of Docker and Kubernetes The world of Docker and Kubernetes
The world of Docker and Kubernetes
 
CI/CD with AWS Code Services
CI/CD with AWS Code ServicesCI/CD with AWS Code Services
CI/CD with AWS Code Services
 
Masterless Puppet Using AWS S3 Buckets and IAM Roles
Masterless Puppet Using AWS S3 Buckets and IAM RolesMasterless Puppet Using AWS S3 Buckets and IAM Roles
Masterless Puppet Using AWS S3 Buckets and IAM Roles
 
Cloud Foundry: Hands-on Deployment Workshop
Cloud Foundry: Hands-on Deployment WorkshopCloud Foundry: Hands-on Deployment Workshop
Cloud Foundry: Hands-on Deployment Workshop
 
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
 
Docker 101 - High level introduction to docker
Docker 101 - High level introduction to dockerDocker 101 - High level introduction to docker
Docker 101 - High level introduction to docker
 
DevOps Unleashed: Strategies that Speed Deployments
DevOps Unleashed: Strategies that Speed DeploymentsDevOps Unleashed: Strategies that Speed Deployments
DevOps Unleashed: Strategies that Speed Deployments
 
Csa container-security-in-aws-dw
Csa container-security-in-aws-dwCsa container-security-in-aws-dw
Csa container-security-in-aws-dw
 
What's New in Docker - February 2017
What's New in Docker - February 2017What's New in Docker - February 2017
What's New in Docker - February 2017
 
Kontena@Berlin OpenSource MeetUp
Kontena@Berlin OpenSource MeetUpKontena@Berlin OpenSource MeetUp
Kontena@Berlin OpenSource MeetUp
 
Developing Microservices Directly in AKS/Kubernetes
Developing Microservices Directly in AKS/KubernetesDeveloping Microservices Directly in AKS/Kubernetes
Developing Microservices Directly in AKS/Kubernetes
 
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
 

Dernier

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Dernier (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 

Automating the CI / CD pipeline of your containerized applications

  • 1. Automating the CI / CD pipeline of your containerized applications Lauri Nevala, co-founder and engineer@KontenaInc @nevalau
  • 3. © 2016 Kontena, Inc. What is Kontena? Open Source container platform built to maximize developer happiness. Works on any cloud, easy to setup, simple to use.
  • 5. All Batteries Included! Built-In Image Registry Sometimes projects can not use publicly hosted container image registries like DockerHub. Kontena comes with built-in container image registry providing private and secure solution. Built-In VPN Access All containers are run inside a virtual private network by default. Nothing is exposed to Internet unless explicitly defined. With Kontena’s built-in VPN access developers can securely access those resources. Built-In Load Balancer Kontena comes with built-in load balancer. Based on Haproxy. It features fully automatic, zero-downtime operation due to deep integration with Kontena’s service discovery and orchestration technology. Aggregated Stats & Logs Kontena provides real-time log and statistics streams containers. The streams may be grouped and aggregated to produce service level streams. This allows easy viewing of logs and statistics for your application CPU, memory, disk and network usage. User Management with Audit Trail All events and actions performed through Kontena CLI or APIs are logged into audit trail. Combined with users and access control, the audit trail support makes Kontena a reliable and secure solution for any enterprise deployments. Built-In Secrets Management When your application requires access to APIs or databases, you'll often need to use secrets such as passwords and access tokens for authenticating the access. Kontena Vault is a secure key/value storage that can be used to manage secrets in Kontena.
  • 6. “Includes all the sh*t you don’t need to implement by yourself”
  • 7. What is Drone? •Docker based CI/CD platform •Easy to install & maintain •Isolated builds (Docker containers) •Pluggable (Docker containers) •Integrates to Github / Gitlab and others •Travis like “just works” feeling © 2016 Kontena, Inc.
  • 8. Why should I care? © 2015 Kontena, Inc.
  • 9. © 2015 Kontena, Inc. Sometimes size does matter
  • 10. Why Should I Care? •Lightweight, low memory footprint •Single binary, written in Go •Docker native •Simple YAML configuration •Supports any language that can run in Docker © 2016 Kontena, Inc.
  • 11. Installation •Single binary, just execute •Docker image (preferred way) •Configurationthrough environment variables •0.5 introduced build agents, easy to scale © 2016 Kontena, Inc.
  • 12. Installation: The Docker Way © 2016 Kontena, Inc. $ docker run -d -v /var/lib/drone:/var/lib/drone -v /var/run/docker.sock:/var/run/docker.sock --env-file /etc/drone/dronerc --restart=always --publish=80:8000 --detach=true --name=drone drone/drone:0.4
  • 13. Installation: The Kontena Way © 2016 Kontena, Inc. server: image: drone/drone:0.5 instances: 1 stateful: true deploy: strategy: ha wait_for_port: 80 ports: - 8080:80 environment: - DRONE_DEBUG=true - DRONE_GITHUB=true - DRONE_SERVER_ADDR=0.0.0.0:80 - DRONE_OPEN=true - DATABASE_DRIVER=sqlite3 - DATABASE_CONFIG=/var/lib/drone/drone.sqlite secrets: - secret: DRONE_GITHUB_CLIENT_ID name: DRONE_GITHUB_CLIENT type: env .... volumes: - /var/lib/drone agent: image: drone/drone:0.5 stateful:no instances:3 depends_on: - server environment: - DRONE_DEBUG=true - DRONE_SERVER=http://%{project}-server:80 secrets: - secret: DRONE_SHARED_SECRET name: DRONE_SECRET type: env volumes: - /var/run/docker.sock:/var/run/docker.sock command:agent
  • 14. Configuration •Remote driver • Bitbucket, Github, Gitlab, Gogs •Database • SQLite (default), Postgres, MySQL •Plugins • Filter • Global params © 2016 Kontena, Inc.
  • 15. Concepts – the “.drone.yml” •Plugins •Pipeline •Services •Matrix •Secrets •Constraints © 2016 Kontena, Inc.
  • 16. Concepts - Plugins • Plugin is actually just a Docker image • Container created and executed part of pipeline • Exit code determines success/failure © 2016 Kontena, Inc. pipeline: test: image: ruby:2.3 commands: - bundle install --path=bundler - rspec spec/
  • 17. Concepts – Pipeline •Arbitrary set of “plugins” to run as the build process •Success determined by exit code •Defined in .drone.yml © 2016 Kontena, Inc.
  • 18. Concepts – Services • Set of services needed in the build process • Available on the same network namespace as build containers • Handy for eg. Databases used in testing © 2016 Kontena, Inc.
  • 19. Concepts – Matrix • Build a single commit against many configurations • Interpolated as variables in yaml parsing © 2016 Kontena, Inc.
  • 20. Concepts – Matrix © 2016 Kontena, Inc. pipeline: build: image: golang:${GO_VERSION} commands: - go get - go build - go test services: database: image: ${DATABASE} matrix: GO_VERSION: - 1.4 - 1.3 DATABASE: - mysql:5.5 - mysql:6.5 - mariadb:10.1
  • 21. Concepts – Secrets • Keep your secrets out of VCS • Injected into build containers • Some plugins use automatically • Available in the env • Available only to specific container in build • Blast radius © 2016 Kontena, Inc.
  • 22. Concepts – Secrets © 2016 Kontena, Inc. $ drone secret ls nevalla/todo-example DOCKER_USERNAME Images: plugins/docker Events: push, tag, deployment DOCKER_PASSWORD Images: plugins/docker Events: push, tag, deployment DOCKER_EMAIL Images: plugins/docker Events: push, tag, deployment KONTENA_TOKEN Images: jnummelin/kontena-cli Events: push, tag, deployment KONTENA_URL Images: jnummelin/kontena-cli Events: push, tag, deployment KONTENA_GRID Images: jnummelin/kontena-cli Events: push, tag, deployment
  • 23. Concepts – Constraints • Limit execution of build steps at runtime • Branches: [master, develop] • Events: tag, push, pull_request, … • Platform: [ linux/*, windows/amd64 ] • “Deploy when pushed to master” type of things © 2016 Kontena, Inc.
  • 24. Demo!
  • 26. 1. Create Kontena Master © 2016 Kontena, Inc. kontena digitalocean master create --token=$DO_TOKEN Generating self-signed SSL certificate... Creating DigitalOcean droplet kontena-master-rough- butterfly-2 ... Waiting for kontena-master-rough-butterfly-2 to start... Kontena Master is now running at https://192.86.22.19 Use kontena login --name=rough-butterfly-2 https://192.86.22.19 to complete Kontena Master setup $ done done $
  • 27. 2. Login © 2016 Kontena, Inc. kontena login --name devops-dam https://192.86.22.19 Email: lauri@kontena.io Password: ************** _ _ | | _____ _ __ | |_ ___ _ __ __ _ | |/ / _ | '_ | __/ _ '_ / _` | | < (_) | | | | || __/ | | | (_| | |_|____/|_| |_|_____|_| |_|__,_| ------------------------------------- Copyright (c)2016 Kontena, Inc. Logged in as lauri@kontena.io Welcome! See 'kontena --help' to get started. $ $
  • 28. 3. Add Nodes © 2016 Kontena, Inc. kontena grid create drone Using grid: drone $ kontena digitalocean node create --token=$DO_TOKEN Creating DigitalOcean droplet proud-waterfall-3 ... Waiting for node proud-waterfall-3 join to grid drone ... kontena digitalocean node create --token=$DO_TOKEN Creating DigitalOcean droplet cold-dream-44... Waiting for node cold-dream-44 join to grid drone ... kontena digitalocean node create --token=$DO_TOKEN Creating DigitalOcean droplet falling-resonance-59... Waiting for node falling-resonance-59 join to grid drone ... $ done done done done done $ done $ $
  • 30. Create Secrets – kontena.yml © 2016 Kontena, Inc. version: '2' name: drone services: server: image: drone/drone:0.5 instances: 1 … secrets: - secret: DRONE_GITHUB_CLIENT_ID name: DRONE_GITHUB_CLIENT type: env - secret: DRONE_GITHUB_CLIENT_SECRET name: DRONE_GITHUB_SECRET type: env - secret: DRONE_SHARED_SECRET name: DRONE_AGENT_SECRET type: env - secret: DRONE_ADMIN_USERNAMES name: DRONE_ADMIN type: env
  • 31. Create GitHub OAuth Application © 2016 Kontena, Inc.
  • 32. Write secrets © 2016 Kontena, Inc. $ kontena vault write DRONE_GITHUB_CLIENT_ID 909da55bb031dd5 $ kontena vault write DRONE_GITHUB_CLIENT_SECRET xxxyyyzzz $ kontena vault write DRONE_SHARED_SECRET RleCk8iaqnyngszUQQh $ kontena vault write DRONE_ADMIN_USERNAMES nevalla $
  • 33. Deploy Drone © 2016 Kontena, Inc. $ kontena app deploy creating server creating agent deploying server ... done deploying agent ... done $
  • 36. Try Kontena • Quick Start Guide: https://kontena.io/docs/getting-started/quick-start • Drone Example: https://github.com/kontena/examples/tree/master/drone/0.5 • Give Feedback, join discussion@ slack, tweet, star on GitHub
  • 37. $25 Credits for Testing https://www.packet.net/promo/kontena/