Declarative Modeling for Cloud Deployments Giuseppe Attardi Department of Distributed Computing & Storage OpenStack Day Italia Roma 21/9/2018
GARR Federated Cloud Computing Platform Objectives GARR Offer
cloud.garr.it
Declarative Modeling for Cloud Automation Key Idea Benefits
Cloud Automation
Automation Tools
Procedural vs Declarative Typical Ansible code Connect to each server Install packages for a web application Configure web application, styles Create database credentials Connect database to server by copying credentials Create table and populate data Juju Specify: by editing configuration files (e.g. sed) Applications Number of servers Optional: set parameters Juju does: chooses servers and provisions them Installs packages and configure them Generates passwords and communicates them Initializes database
A Single Automation Tool for all Tasks Platform Deployment: OpenStack Application Deployment: Big Data Analytics
Juju
Juju Architecture and Workflow
Day Two Operations Evolution Scaling Scaling applications Coordinate among servers Propagate changes to connected applications Perform configuration updates From development to production Security updates Maintain Certificates Platform upgrades OpenStack upgrades (every 6 months) Kubernetes upgrades Upgrading the charms themselves with improved functionality
Quick Deployment Times
Deployment as a Service Self-service app deployment
Self-service App Deployment Select Moodle App Deploy Scale Deploy on public cloud
Scaling Moodle in the Cloud
Jupyter Notebook Server
Multiple Clouds
External Public Clouds: AWS $ juju clouds Cloud Regions aws Default Type Description 12 us-east-1 ec2 Amazon Web Services aws-china 1 cn-north-1 ec2 Amazon China aws-gov 1 us-gov-west-1 ec2 Amazon (USA Government) 18 centralus azure Microsoft Azure azure-china 2 chinaeast azure Microsoft Azure China cloudsigma 5 hnl cloudsigma CloudSigma Cloud google 4 us-east1 gce Google Cloud Platform azure juju deploy ~/mediawiki-single $ juju status Model Controller Cloud/Region Version default aws-us-east-1 aws/us-east-1 2.0.2 App Charm Store OS Notes mediawiki Version Status unknown Scale 1 mediawiki jujucharms Rev 3 ubuntu exposed mysql waiting 0 mysql jujucharms 29 ubuntu Unit Workload Agent Machine Public address mediawiki/1* unknown idle 2 54.161.6.44 Ports Message Machine State DNS Inst id Series AZ 2 started 54.161.6.44 i-02d632e9b1d7b8507 trusty us-east-1a
App Deployed on AWS
Juju Details
Juju Concepts Charm: Unit of deployment Bundle: Composition of charms Event: Occur during lifetime of services Hook: Steps to be performed to handle event Action: Specific management function on a service install config-changed relation-joined, relation-changed leader-elected pool-storage-attached
Charm Interfaces and Relations
Executable Steps Hooks Handlers are triggered when an event occurs Can be written in any language Hooks must be idempotent To avoid inconsistencies or divergence if run more than once Actions Actions are executable scripts defined in the charms High level functionality related to the application: Pause and resume service Can be executed on one or more instances of the application
Container Platform
Kubernetes Container orchestrator Deployable on clouds or bare metal Open Source Manage applications, not machines
Kubernetes Concepts Pod Replication Controller / Deployment Service One or More Containers Ensures that a specified Grouping of pods, act as Shared IP number of pod replicas are one, has stable virtual IP Shared Storage Volume running at any one time and DNS name Shared Resources Shared Lifecycle Label Key/Value pairs associated with Kubernetes objects (e.g. env=production)
GARR Container Platform Based on Kubernetes Deployed on bare metal Integrated with OpenStack: Credentials Storage Support for AI applications: GPUs ML libraries Shared data repositories
Demo: GuestBook Microservices frontend frontend-service Redis in-memory store
frontend-deployment.yaml apiversion: apps/v1 kind: Deployment metadata: name: frontend labels: app: guestbook spec: selector: matchlabels: app: guestbook tier: frontend replicas: 3 template: metadata: labels: app: guestbook tier: frontend spec: containers: - name: php-redis image: gcr.io/google-samples/gb-frontend:v4 resources: requests: cpu: 100m memory: 100Mi env: - name: GET_HOSTS_FROM value: dns ports: - containerport: 80
Kubernetes Dashboard
Serverless Server: linux Virtual server: OpenStack Container: Kubernetes Serverless: Kubeless
Conclusions Declarative Modeling is conceptually and practically convenient A declarative tool like Juju was essential for deploying the GARR Cloud Platform Benefits overcome drawbacks Ask for a live demo and see for yourself
Get Involved Contest Join Us
Thank you