CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application...

64
CLOUD 1

Transcript of CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application...

Page 1: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

CLOUD

1

Page 2: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

ABOUT THESE TRAINING MATERIALS

2 . 1

Page 3: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

TRAINING MATERIALS WRITTEN BY ALTER WAY CLOUDCONSULTING

ex Osones -

Copyright © 2014 - 2019 alter way CloudConsultingLicense: Sources: HTML/PDF:

Creative Commons BY-SA 4.0 license

https://cloud-consulting.alterway.fr

Creative Commons BY-SA 4.0https://github.com/Alterway/formations/

https://osones.com/formations/

2 . 2

Page 4: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

INTRODUCTION

3 . 1

Page 5: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

GOALS OF THE TRAINING: CLOUDUnderstand concepts and benefits of cloudKnow the vocabulary related to cloudOverview of cloud market players and focus on AWS andOpenStackKnow how to take advantage of IaaSBe able to decide what is cloud compatible or notAdapt its system administration and development methodsto a cloud environment

3 . 2

Page 6: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

CLOUD, OVERVIEW

4 . 1

Page 7: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

FORMAL DEFINITION

4 . 2

Page 8: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

SPECIFICATIONSProvide one or more service(s)...

Self serviceThrough thenetworkSharing resourcesFast elasticityMetering

Inspired by the NIST definitionhttps://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-

145.pdf

4 . 3

Page 9: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

SELF SERVICEUser goes directly to the serviceNo humain intermediaryImmediate responsesServices catalog for theirdiscovery

4 . 4

Page 10: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

THROUGH THE NETWORKUser uses the service through the networkThe service provider is remote to the consumerNetwork = internet or notUsage of standard network protocols (typically:HTTP)

4 . 5

Page 11: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

SHARING RESSOURCESA cloud provided services to multiple users/organizations(multi-tenant)Tenant or project: logical isolation of resourcesResources are available in large quantities (consideredunlimited)Resources usage is not visibleAccurate location of resources is not visible

4 . 6

Page 12: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

FAST ELASTICITYProvisionning and deletion of resources almostinstantaneousEnables scalingAbility to automate these scaling actionsVirtually no limit to this elasticity

4 . 7

Page 13: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

METERINGUsage of cloud resources is monitored by the providerThe provider can do capacity planning and billing from theseinformationsUser is therefore billed depending on accurate usage ofresourcesUser can take advantage of these informations

4 . 8

Page 14: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

MODELSservice models: IaaS, PaaS, SaaSdeployment models: public, private,hybrid

4 . 9

Page 15: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

IAASInfrastructure as a ServiceInfrastructure:ComputeStorageNetworkTarget users: administrators (system, storage,network)

4 . 10

Page 16: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

PAASPlatform as a ServiceTwo concepts:Environment to develop/deploy an application(language/framework specific - example: Python/Django)Higher level resources than infrastructure, example: DBMSTarget users: application developers

4 . 11

Page 17: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

SAASSoftware as a ServiceTarget users: end usersNot to be confused with the economic definition ofSaaS

4 . 12

Page 18: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

SOMETHING AS A SERVICE?Load balancing as a Service (Infra)Database as a Service (Platform)MyApplication as a Service(Software)etc.

4 . 13

Page 19: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

SERVICE MODELS IN ONE DIAGRAM

IaaS - PaaS - SaaS (source: Wikipedia)

Page 20: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

4 . 14

Page 21: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

PUBLIC OR PRIVATE CLOUD?Who is it for?

Public: everyone, available on internetPrivate: to an organization, available on itsnetwork

4 . 15

Page 22: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

HYBRID CLOUDUsage of multiple public and/or private cloudsAttractive concept but implementation is hard a prioriSome use cases fit perfectlyContinuous integration (CI)Incentives:Avoid lock-inCloud bursting

4 . 16

Page 23: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

VIRTUALIZATION INSTANTLet's make it clear.

Virtualization is a technology that can implement thecompute functionA cloud providing compute resources can use virtualizationBut it can also use:Bare-metalContainers

4 . 17

Page 24: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

APIS ARE KEYReminder: API stands for Application Programming InterfaceIn the software sense: Interface for a program to use a libraryIn the cloud sense: Interface for a program to use a service(XaaS)Programming interface (through the network, often HTTP)Explicit boundary between the provider and the userDefines how the user interacts with the cloud to manage theirresourcesManages: CRUD (Create, Read, Update, Delete)

4 . 18

Page 25: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

API RESTOne ressource == one URI (Uniform Resource Identifier)Usage of HTTP verbs to define operations (CRUD)GETPOSTPUTDELETEUsage of HTTP return codesResources are represented in the HTTP responses'body

4 . 19

Page 26: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

REST - EXAMPLESGET http://endpoint/volumes/GET http://endpoint/volumes/?size=10POST http://endpoint/volumes/DELETE http://endpoint/volumes/xyz

4 . 20

Page 27: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

REAL EXAMPLEGET /v2.0/networks/d32019d3-bc6e-4319-9c1d-6722fc136a22{ "network":{ "status":"ACTIVE", "subnets":[ "54d6f61d-db07-451c-9ab3-b9609b6b6f0b" ], "name":"private-network", "provider:physical_network":null, "admin_state_up":true, "tenant_id":"4fd44f30292945e481c7b8a0c8908869", "provider:network_type":"local", "router:external":true, "shared":true, "id":"d32019d3-bc6e-4319-9c1d-6722fc136a22", "provider:segmentation_id":null }}

4 . 21

Page 28: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

WHY CLOUD? ECONOMICAL POINT OF VIEWConsider IT resources as service provider resourcesShift the "investment" budget (Capex) to the "operation"budget (Opex)Cut costs by sharing resources, and maybe with economies ofscaleReduce delivery timesMatch costs to the real usage of resources

4 . 22

Page 29: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

WHY CLOUD? TECHNICAL POINT OF VIEWAbstract from the lower layers (server, network, OS, storage)Get rid of the technical administration of resources andservices (DB, firewalls, load-balancing, etc.)Design infrastructures which can scale on the flyAct on resources through lines of code and manageinfrastructures "as code"

4 . 23

Page 30: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

MARKET

4 . 24

Page 31: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

AMAZON WEB SERVICES (AWS), LEADER

AWS logoStarted in 2006At first: "e-commerce" web services fordevelopersThen: other services for developersAnd finally: infrastructure resourcesRecently, SaaS

4 . 25

Page 32: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

PUBLIC IAAS ALTERNATIVES TO AWSGoogle Cloud PlatformGoogle Cloud PlatformMicrosoft AzureMicrosoft AzureRackspaceDreamHostDigitalOceanIn France:Cloudwatt (Orange BusinessServices)Numergy (SFR)OVHIkoulaScalewayOutscale

4 . 26

Page 33: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

PRIVATE IAASOpenStackOpenStackCloudStackEucalyptusOpenNebula

4 . 27

Page 34: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

OPENSTACK IN A FEW WORDS

OpenStack logoWas born in 2010OpenStack Foundation since 2012Written in Python and distributed under Apache 2.0 licenseLarge support from the industry and various contributions

4 . 28

Page 35: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

PUBLIC PAAS EXAMPLESAmazon Elastic Beanstalk( )Google App Engine ( )Heroku ( )

https://aws.amazon.com/fr/elasticbeanstalkhttps://cloud.google.com/appengine

https://www.heroku.com

4 . 29

Page 36: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

PRIVATE PAAS SOLUTIONSCloud Foundry, Foundation ( )OpenShift, Red Hat ( )Solum, OpenStack ( )

https://www.cloudfoundry.orghttps://www.openshift.org

https://wiki.openstack.org/wiki/Solum

4 . 30

Page 37: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

INFRASTRUCTURE AS A SERVICE CONCEPTS

4 . 31

Page 38: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

BASICSInfrastructure:ComputeStorageNetwork

4 . 32

Page 39: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

COMPUTE RESOURCESInstanceImageFlavorKeypair (SSH)

4 . 33

Page 40: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

INSTANCEDedicated to computeShort typical lifetime, to be consideredephemeralShould not store persistent dataNon persistent root diskBased on an image

4 . 34

Page 41: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

CLOUD IMAGEDisk image containing an already installed OSInfinitely instanciableCan talk to the metadata API

4 . 35

Page 42: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

METADATA APIhttp://169.254.169.254Available from the instanceProvides informations about the instanceExposes userdataThe cloud-init tool helps take advantage of thisAPI

4 . 36

Page 43: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

FLAVORInstance type in AWSDefines an instance model regarding CPU, RAM, disk (root),ephemeral diskThe ephemeral disk has, like the root disk, the advantage ofoften being local and thus fast

4 . 37

Page 44: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

KEYPAIRSSH public key + private keyCloud manages and stores the public keyThis public key is used to give SSH access to theinstances

4 . 38

Page 45: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

NETWORK RESOURCES 1/2L2 networkNetwork portL3 networkRouterFloating IPSecurity group

4 . 39

Page 46: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

NETWORK RESOURCES 2/2Load Balancing as aServiceVPN as a ServiceFirewall as a Service

4 . 40

Page 47: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

STORAGE RESOURCESCloud provides two kinds of storage

BlockObject

4 . 41

Page 48: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

BLOCK STORAGEVolumesVolumes that can be attached to an instanceAccess to raw devices such as /dev/vdbAbility to use any kind of file systemAbility to use LVM, encryption, etc.Compatible with all existing applicationsRequires provisioning space by defining volumesize

4 . 42

Page 49: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

SHARED STORAGE?Block storage is notnot a shared storage solution likeNFSNFS is at a higher layer: file systemA volume is a priori connected to a single host

4 . 43

Page 50: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

"BOOT FROM VOLUME"Starting an instance with its root disk on a volumevolume

Root disk data persistenceGets similar to classicalserver

4 . 44

Page 51: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

OBJECT STORAGEAPI: CRUD on dataPush and retrieve objectsobjects in/from a containercontainer/bucketNo data hierachy, no directories, no file systemRead/write access through APIs onlyNo provisioning necessaryApplication must be designed to take advantage of objectstorage

4 . 45

Page 52: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

ORCHESTRATIONOrchestrate creation and management of resources in thecloudArchitecture definition in a templatetemplateResources created from a templatetemplate make a stackstackThere are also orchestration tools (rather than services)

4 . 46

Page 53: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

USAGE BEST PRACTICES

4 . 47

Page 54: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

WHY BEST PRACTICES?Two differents possible views:

Don't change anythingRisk not meeting expectationsLimit usage to test & dev use caseAdapt to new cloud compliant practices to take advantage ofit

4 . 48

Page 55: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

HIGH AVAILABILITY (HA)Cloud control plane (APIs) is HAManaged resources might notbe

4 . 49

Page 56: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

PET VS CATTLEHow to consider instances?

PetCattle

4 . 50

Page 57: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

INFRASTRUCTURE AS CODEWith code

Provision infrastructure resourcesConfigure said resources, instances inparticular

The job is changing: Infrastructure Developer

4 . 51

Page 58: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

SCALINGScale out rather than Scale upScale out: horizontal scalingScale up: vertical scalingAuto-scalingManaged by the cloudManaged by an externalcomponent

4 . 52

Page 59: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

CLOUD READY APPLICATIONSStore their data in an appropriateplaceAre architected to be fault tolerantEtc.

Cf. https://12factor.net/

4 . 53

Page 60: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

BEHIND CLOUD

4 . 54

Page 61: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

HOW TO IMPLEMENT A COMPUTE SERVICEVirtualization(system) ContainersBare metal

4 . 55

Page 62: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

STORAGE IMPLEMENTATION: (SOFTWARE DEFINED STORAGE)SDS

WarningWarning: not to be confused with the block vs object topic

Use of commodity hardwareNo hardware RAIDSoftware is responsible for the dataHardware failures are taken into account and managedThe CephCeph project and the OpenStack SwiftOpenStack Swift componentimplement SDS

See also ScalityScality4 . 56

Page 63: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

SDS - CAP THEOREM

Page 64: CLOUD - osones.com · Containers 4.17. APIS ARE KEY Reminder: API stands for Application Programming Interface In the software sense: Interface for a program to use a library In the

Consistency - Availability - Partition tolerance

4 . 57