Ansible: Infrastructure as Code
OpenShift on Azure
Ignacio Sánchez
Roberto Carratalá
Agenda
Development
Evolution
IaC
Ansible
Molecule
Azure DemoOCP
Evolution of Software Development
● Versioning
○ Shared folders
○ Early versioning: CVS
○ Branching: Subversion
○ Tagging, releasing
○ Decentralized, parallel: Git
○ Pull request, code review
Development
Evolution
IaC Ansible OCP Azure DemoMolecule
Evolution of Software Development
● Build and deploy
○ Automated building
○ Continuous Integration
○ Continuous Delivery/Deployment
● Testing
○ Source code analysis
○ Continuous testing
Development
Evolution
IaC Ansible OCP Azure DemoMolecule
Evolution of Software Development
● Agile
○ Scrum/Kanban
○ Continuous releases, sprints
○ Product mindset, squads, guilds
Product
Backlog
Sprint
Backlog
Release
Development
Evolution
IaC Ansible OCP Azure DemoMolecule
Evolution of Software Development
Silo Organization Agile Organization
Development
Evolution
IaC Ansible OCP Azure DemoMolecule
¿What about Infrastructure?
Development
Evolution
IaC Ansible OCP Azure DemoMolecule
Infrastructure is part of the Squad
DEV OPS
Development
Evolution
IaC Ansible OCP Azure DemoMolecule
● Management of infrastructure
in a descriptive model using the
same versioning model as
source code
○ Virtual Machines
○ Networking
○ Storage
○ Etc.
Infrastructure as Code (IaC)
Development
Evolution
IaC Ansible OCP Azure DemoMolecule
IaC Life Cycle
DeployTestingIntegrationCode
It’s software after all...
Development
Evolution
IaC Ansible OCP Azure DemoMolecule
Requirements of IaC
PRIVATE PUBLIC
HYBRID
Development
Evolution
IaC Ansible OCP Azure DemoMolecule
Benefits of IaC
● Speed
● Version tracking
● Dependency management
● Reproducible environments
● Quality
● Focus
● Easy I+D
Development
Evolution
IaC Ansible OCP Azure DemoMolecule
¿How to make it happen?
Development
Evolution
IaC Ansible OCP Azure DemoMolecule
Ansible
● Ansible
● Ansible Modules for Azure
● Ansible Networking
● Host Provisioning / Configuration
● Openshift Ansible
Development
Evolution
IaC Ansible OCP Azure DemoMolecule
Immutable Infrastructure
● Infrastructure paradigm in which servers are never modified after
they're deployed.
● If something needs to be updated, fixed, or modified in any way, new
servers built from a common image with the appropriate changes are
provisioned to replace the old ones.
● After they're validated, they're put into use and the old ones are
decommissioned.
Development
Evolution
IaC Ansible OCP Azure DemoMolecule
Benefits of Immutable Infrastructure
● The benefits of an immutable infrastructure include more consistency
and reliability in your infrastructure and a simpler, more predictable
deployment process.
● It mitigates or entirely prevents issues that are common in mutable
infrastructures, like configuration drift and snowflake servers.
● Includes comprehensive deployment automation, fast server
provisioning in a cloud computing environment, and solutions for
handling stateful or ephemeral data like logs.
Development
Evolution
IaC Ansible OCP Azure DemoMolecule
Molecule
● Provisions Azure Virtual Machines and necessary hardware
● Runs role against the new VMs
● Performs linting and code analysis
● Executes automated tests like Testinfra
● Destroys all provisioned hardware
Development
Evolution
IaC Ansible OCP Azure DemoMolecule
Openshift Container Platform
● Architecture
● Master Nodes
● Infra Nodes
● Application Nodes
● Registry / Etcd / Router
● SDN
● Storage
● Bastion
Development
Evolution
IaC Ansible OCP Azure DemoMolecule
Openshift Architecture
Development
Evolution
IaC Ansible OCP Azure DemoMolecule
Openshift on Azure
● Resource groups
● Azure DNS
● Azure Virtual Networks
● Network Security
Groups
● Availability set
● Virtual Machines
● Load Balancer
● Storage Account
● Service Principal
Development
Evolution
IaC Ansible OCP Azure DemoMolecule
Ansible Deployment of OCP in Azure
Development
Evolution
IaC Ansible OCP Azure DemoMolecule
bootstrap.sh
host-preparationbastionopenshift-infra
configuration.yml
prerequisites deploy_cluster
Ansible Deployment of OCP in Azure
● Provision the Microsoft Azure Instances
● Configuration the Openshift Bastion
● Openshift Host preparation
● Deploy cluster of OpenShift
● Post deployment activities
Development
Evolution
IaC Ansible OCP Azure DemoMolecule
Ansible Deployment of OCP in Azure
Development
Evolution
IaC Ansible OCP Azure DemoMolecule
DEMO
https://github.com/drhelius/ansible-azure-openshift
Development
Evolution
IaC Ansible OCP Azure DemoMolecule
Links of Interest
● Ansible Azure OpenShift Code
● Infrastructure as Code
● Configure OpenShift for Azure Guide
● Reference Architecture - Deploying Openshift 3.9 in Azure
● OpenShift Container Platform Reference Architecture
Implementation Guides
Q / A
THANK YOU

Ansible: Infrastructure as Code for OpenShift

  • 1.
    Ansible: Infrastructure asCode OpenShift on Azure Ignacio Sánchez Roberto Carratalá
  • 2.
  • 3.
    Evolution of SoftwareDevelopment ● Versioning ○ Shared folders ○ Early versioning: CVS ○ Branching: Subversion ○ Tagging, releasing ○ Decentralized, parallel: Git ○ Pull request, code review Development Evolution IaC Ansible OCP Azure DemoMolecule
  • 4.
    Evolution of SoftwareDevelopment ● Build and deploy ○ Automated building ○ Continuous Integration ○ Continuous Delivery/Deployment ● Testing ○ Source code analysis ○ Continuous testing Development Evolution IaC Ansible OCP Azure DemoMolecule
  • 5.
    Evolution of SoftwareDevelopment ● Agile ○ Scrum/Kanban ○ Continuous releases, sprints ○ Product mindset, squads, guilds Product Backlog Sprint Backlog Release Development Evolution IaC Ansible OCP Azure DemoMolecule
  • 6.
    Evolution of SoftwareDevelopment Silo Organization Agile Organization Development Evolution IaC Ansible OCP Azure DemoMolecule
  • 7.
  • 8.
    Infrastructure is partof the Squad DEV OPS Development Evolution IaC Ansible OCP Azure DemoMolecule
  • 9.
    ● Management ofinfrastructure in a descriptive model using the same versioning model as source code ○ Virtual Machines ○ Networking ○ Storage ○ Etc. Infrastructure as Code (IaC) Development Evolution IaC Ansible OCP Azure DemoMolecule
  • 10.
    IaC Life Cycle DeployTestingIntegrationCode It’ssoftware after all... Development Evolution IaC Ansible OCP Azure DemoMolecule
  • 11.
    Requirements of IaC PRIVATEPUBLIC HYBRID Development Evolution IaC Ansible OCP Azure DemoMolecule
  • 12.
    Benefits of IaC ●Speed ● Version tracking ● Dependency management ● Reproducible environments ● Quality ● Focus ● Easy I+D Development Evolution IaC Ansible OCP Azure DemoMolecule
  • 13.
    ¿How to makeit happen? Development Evolution IaC Ansible OCP Azure DemoMolecule
  • 14.
    Ansible ● Ansible ● AnsibleModules for Azure ● Ansible Networking ● Host Provisioning / Configuration ● Openshift Ansible Development Evolution IaC Ansible OCP Azure DemoMolecule
  • 15.
    Immutable Infrastructure ● Infrastructureparadigm in which servers are never modified after they're deployed. ● If something needs to be updated, fixed, or modified in any way, new servers built from a common image with the appropriate changes are provisioned to replace the old ones. ● After they're validated, they're put into use and the old ones are decommissioned. Development Evolution IaC Ansible OCP Azure DemoMolecule
  • 16.
    Benefits of ImmutableInfrastructure ● The benefits of an immutable infrastructure include more consistency and reliability in your infrastructure and a simpler, more predictable deployment process. ● It mitigates or entirely prevents issues that are common in mutable infrastructures, like configuration drift and snowflake servers. ● Includes comprehensive deployment automation, fast server provisioning in a cloud computing environment, and solutions for handling stateful or ephemeral data like logs. Development Evolution IaC Ansible OCP Azure DemoMolecule
  • 17.
    Molecule ● Provisions AzureVirtual Machines and necessary hardware ● Runs role against the new VMs ● Performs linting and code analysis ● Executes automated tests like Testinfra ● Destroys all provisioned hardware Development Evolution IaC Ansible OCP Azure DemoMolecule
  • 18.
    Openshift Container Platform ●Architecture ● Master Nodes ● Infra Nodes ● Application Nodes ● Registry / Etcd / Router ● SDN ● Storage ● Bastion Development Evolution IaC Ansible OCP Azure DemoMolecule
  • 19.
  • 20.
    Openshift on Azure ●Resource groups ● Azure DNS ● Azure Virtual Networks ● Network Security Groups ● Availability set ● Virtual Machines ● Load Balancer ● Storage Account ● Service Principal Development Evolution IaC Ansible OCP Azure DemoMolecule
  • 21.
    Ansible Deployment ofOCP in Azure Development Evolution IaC Ansible OCP Azure DemoMolecule bootstrap.sh host-preparationbastionopenshift-infra configuration.yml prerequisites deploy_cluster
  • 22.
    Ansible Deployment ofOCP in Azure ● Provision the Microsoft Azure Instances ● Configuration the Openshift Bastion ● Openshift Host preparation ● Deploy cluster of OpenShift ● Post deployment activities Development Evolution IaC Ansible OCP Azure DemoMolecule
  • 23.
    Ansible Deployment ofOCP in Azure Development Evolution IaC Ansible OCP Azure DemoMolecule
  • 24.
  • 25.
    Links of Interest ●Ansible Azure OpenShift Code ● Infrastructure as Code ● Configure OpenShift for Azure Guide ● Reference Architecture - Deploying Openshift 3.9 in Azure ● OpenShift Container Platform Reference Architecture Implementation Guides
  • 26.
  • 27.

Editor's Notes

  • #15 Who knows Ansible? And for what purpose? For Infrastructure?
  • #18 For testing the infrastructure, in Ansible you can use Molecule. Hard to prove the playbooks, to the infrastructure that you use
  • #19 How many of you used / knows Openshift?