Cloud Foundry is a highly-available Platform-as-a-Service that provides organizations a stable environment to host their applications. Pivotal Cloud Foundry also includes the concept of tiles, which provide functionality for other services. When installed, tiles gain the benefits of being managed by the PaaS such as reliability and high availability. Examples of these tiles include MySQL, RabbitMQ, and Spring Cloud Services. Administrators can generate brokered instances of these services which are then available to any application running in the PaaS.
Organizations often find themselves in the position of owning custom functionality (e.g. a payment processing service) that would best be implemented as a tile in the PCF installation. Pivotal has recently introduced a new tile generation utility, which makes the generation of custom tiles a practical endeavor. In this session, attendees will learn: the benefits of generating a tile, some of the criteria used to decide whether a tile or some other mechanism is best for your organization, a short demonstration of a tile generation utility provided by Pivotal, and how to operationalize the maintenance of a tile.
12. Step 1: Turn into a Service Broker
• Had to implement the five endpoints
13. • Need a dashboard to start/stop
scaling, set parameters
• Need endpoint in the app to
provide/update that data
• Need a way to link to that
dashboard from PCF ecosystem
Step 1: Dashboard
14. Step 1: Attaching to Apps Console
• Return a specific field in the JSON on the create service instance
method:
{“dashboard_url”:”http://memory-based-autoscaler-
web.apps.labb.ecsteam.io/{service instance guid}/{app name}”}
• This links the dashboard to the apps console “Manage” link
15. • With single-tenant, app failures not
a problem
• With multi-tenant, need to protect
against app failures, updates, etc…
• My-sql database
• Need to create tables if they don’t
exist
• Initialize app based on state in db
• New dependency for broker
Step 1: Persistence
17. Tile Definition
• .pivotal file
• A zip containing the executables and bosh manifest
• Self-Contained functionality
• Can include
• Bosh-managed VMs
• Applications
• Service brokers
• Buildpacks
• Combination of all
• Managed through Ops Manager console
• Configured, deployed, upgraded, etc…
18. When to Develop a Custom Tile
• Need to provision services for the system
• Self-contained custom functionality
• May have a different lifecycle than applications
• May have different use permissions than other applications
• Integrate third-party functionality
• Databases, message brokers, etc…
• New VMs inside the foundation
• bosh can manage these
19. Current method of generating a tile
• Generate a bosh manifest
• Create a product template
• Add lifecycle errands (more bosh)
• Package up applications, manifests, etc… into .pivotal tile
• (optional) migration file
20. • bosh
• Very manual, difficult to automate
• No syntax checking, have to deploy
to find errors
Issues with Current Method
Learning curves of popular technologies
Skill
Time
Java Spring
Spring Boot Bosh
22. Step 2: begin tile generation
• Install tile utility
• pip install –r requirements.txt
• May need to install pip
• bosh cli is also a requirement
• tile init – create shell tile.yml file
• Modify tile.yml
23. Step 2: Header
# The high-level description of your tile.
# Replace these properties with real values.
#
name: memory-based-autoscaler # By convention lowercase with dashes
icon_file: resources/icon.jpeg
label: Memory Based Autoscaler
description: Performs an automatic scaling of apps based on the memory
usage of a bound application.
28. Step 2: properties
properties:
- name: example_property
type: string
default: specify a value
label: Label for the field on the GUI
description: Longer description of the field's purpose
29. Step 2: forms
forms:
- name: security
label: Security
description: Connection Security Parameters
properties:
- name: skip_ssl_validation
type: boolean
default: false
label: Skip SSL Validation for self-signed certificates when
connecting to the firehose
description: Skip SSL Validation for self-signed certificates
when connecting to the firehose
31. Step 3: build the tile
tile build
• Creates the .pivotal file
• Updates tile-version.yml
32. Step 4: Upload, configure, and apply changes
• What happens:
• Org and space get created
• New admin user gets created
• Application gets deployed
• p-mysql service gets created and bound to the app
• App is registered as a service broker and enabled for all orgs, putting it in the
marketplace
• Environment variables (including admin user/password) are bound to the
application
• Now apps can bind to instantiated services
35. Operational Concerns
• Its just code
• Concourse pipelines can generate and upload new versions
• In the foundation, so the foundation manages this just like other tiles
• Can attach vms/processes/apps to other offline metrics gathering tools
36. Where to go for more info
• Our sample
https://github.com/ECSTeam/memory-based-autoscaler
https://github.com/ECSTeam/memoryautoscaler-web
• Tile Generator
https://github.com/cf-platform-eng/tile-generator
• Pivotal Ecosystem
https://network.pivotal.io/ecosystem