Giter VIP home page Giter VIP logo

figurate / bedrock Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 1.0 16.4 MB

A solid foundation for great Cloud architectures

Home Page: https://www.micronode.org/bedrock-user-guide

License: MIT License

Shell 6.54% Ruby 0.35% Puppet 2.10% HCL 71.09% HTML 0.27% Dockerfile 3.53% Makefile 3.24% Python 12.80% JavaScript 0.08%
aws blueprints cloud cloudformation digitalocean docker infrastructure-configuration terraform

bedrock's Introduction

Figurate

The general idea of Figurate is to create an extensible and open platform for building a knowledge base. Typically organisations use multiple tools to manage documents, specifications, configurations, etc., which leads to a confusing and disconnected approach to environment management.

Some key concepts/elements:

  • OSGi - plugin/extension support for adding data sources and outputs
  • Camel - routing of data into, out of, and around the platform
  • JCR - use a hierarchical repository to store data, documents and other environment artifacts

Some interesting things to explore:

  • How relevant is swarm behaviour? Do many simple plugins lead to emergent behaviour/characteristics?

bedrock's People

Contributors

benfortuna avatar

Watchers

 avatar  avatar  avatar

Forkers

kiransterling

bedrock's Issues

Periodic table

Define a table of blueprints to associate common functionality in tabular form.

Vertical alignment to classify the blueprint category, e.g.

  • object storage
  • containerisation
  • networking
  • orchestration
  • serverless
  • persistence

Horizontal alignment to classify the platform category, e.g.

  • Application (e.g. NGINX vhost)
  • Operating system (e.g. swap file)
  • SaaS (S3, dynamodb, newrelic, etc.)
  • PaaS (Cloudfoundry, heroku, etc.)
  • IaaS (AWS, Azure, GCP, Openstack, Digitalocean, etc.)
  • CaaS (Rancher stack, etc.)

Getting started: role

role

In addition to the credentials required to access a cloud environment we can optionally specify additional roles to assume when provisioning blueprints.

The benefit of such fine-grained roles is that it provides additional security to ensure a blueprint can make changes outside the scope of the blueprint specification.

provisioning

Bedrock roles are just another form of blueprint,

Terraform: whistlepost

Include blueprints:

  • whistlepost-server - deploy ec2 instance with cloud-config user data
  • whistlepost-bucket - S3 bucket for media storage
  • whistlepost-table - dynamodb table for site content

Vagrant environment

Many of the challenges involved with provisioning Cloud infrastructure relate to the SOE build of organisations and limited Internet access.

Providing a Vagrant configuration that accounts for restricted Internet access can help to automate around these difficulties.

https://www.vagrantup.com/docs/vagrantfile/

Universal cli

Cli commands:

Role:

  • add
  • remove
  • assume

Blueprint:

  • init
  • apply
  • destroy

Manifest:

  • init
  • apply
  • destroy

Constellation state

Whilst terraform state can provide a record of individual blueprints, there is nothing that maintains a history of manifest execution and the constellations within.

  • Dynamodb/s3 - record result of blueprint action, args, vars, execution result (success/error/indeterminate) and execution time alongside the constellation id.

  • Lambda - provide an API to construct a summary of constellation state, using dynamodb table to list blueprints

  • Lambda - API to destroy/unlock/force-copy individual blueprints

Blue-green deploy

Add support for blue-green deployments by adding a dns mode configuration to service deployment.

When mode is set to "green" the fqdn would be prefixed with "green-" to allow multiple instances of the service to be deployed concurrently.

Once testing is complete the accelerator can be run again in "blue" mode which would update the fqdn to remove the green prefix.

Blueprint: nginx spot fleet

Use spot instances for nginx, with multi-value route53 to manage routing.

  • use lambda to update routing when spot instances added/removed

ECS

Creation of clusters, services.

  • Ec2 asg, alb, Target groups
  • Task definition
  • Ssm parameter store

Elasticsearch

Blueprint for provisioned search engine.

Lambdas for data ingestion

Alternative to low code platforms

Low code platforms provide a modern "drag and drop" approach to application building, however the same problems and concerns exist today as for similar approaches in the past.

One problem is how to maintain the application over time, that typically has underlying code that is difficult to maintain or not accessible at all.

Bedrock blueprints provide a foundation for building apps using best-practice architectures and design, that are secure, resilient and efficient. Predefined "constellations" provide example applications that are rapidly deployable to target Cloud environments.

Manifest

A manifest provides a way to define one or more collections of blueprints (a constellation) and associated configurations that make up a complete architecture.

Often a single blueprint is not sufficient to define a Cloud architecture as they are more likely to be distributed across multiple services. For example, you might have an ECS cluster for web/API applications, RDS or DynamDB for persistence, and S3 for archiving.

Within each of these tiers are additional ancillary services such as route53 for well-known endpoints and/or service discovery, cloudwatch events/triggers, etc. The collection of blueprints that encapsulates and independent function is called a constellation. Multiple constellations may be defined in a single manifest such that an entire architecture may be provisioned.

A manifest also provides a higher-order language that can be used to unambiguously describe novel Cloud architectures that are composed of well-defined blueprints.

Reports

Generate reports from constellation state information.

  • Architecture diagram - use the deployed blueprints to generate diagram of cloud services in use (use key with numbers to label diagram)
  • Cost projection - use deployed blueprints to calculate cost of provisioned resources

File upload

Support uploading files to S3. Use cognito to determine identity and generate pre-signed url to upload file into user space of uploads bucket.

  • Cognito user/identity pools
  • S3 uploads bucket
  • Lambda to generate pre-signed URLs

Getting started

Provision a bedrock environment:

  • Prerequisites: docker, cloud API access
  • build/run developer env
  • generate eyaml keys
  • edit hiera using eyaml edit..
  • run packer to generate image with puppet installed
  • run terraform to provision environment

Automation

Create builds for:

  • digital ocean puppet image
  • AWS puppet Ami
  • dream compute puppet image

Alternative tools

Similar tools:

  • Terragrunt - wraps terraform scripts in custom format to reduce code duplication
  • Astro - group terraform modules with dependencies and apply bulk operations

Examples

Provide some examples configuration sets (constellations) to help getting started.

  • AWS bastion (bastion-aws, bastion-roles)
  • Vpc
  • Nginx reverse proxy with S3 website

Automation

Provision/update bedrock components automatically.

Sync component configuration to S3 bucket. Object update (add/remove) triggers codebuild for component type.

Forward proxy

Squid + vpc routing.

  • Lambda for maintaining url whitelist (domain/reason text)
  • Spotfleet (one instance per AZ)

Terraform: state

  1. Support for different backends (S3, HTTP, etc.)
  • e.g. s3 bucket: $(aws sts get-caller-identity | jq -r '.Account')-terraform-state
  1. Support branching
  • store state in separate path to allow for backup/restore
  • by default copy state across branches to keep in sync and avoid conflicts: terraform init -force-copy -backend-config backend.tfvars

Dashboard

A web application to manage blueprint and constellation provisioning.

  • Upload/remove manifest (S3 bucket)
  • List/deploy manifests (constellation state from dynamodb)
  • List constellations (blueprints/vars from dynamodb)
  • Manifest preview (from terraform plan - codebuild)
  • Destroy blueprint/constellation (codebuild)
  • Cross-account provision

Getting started: blueprint

blueprint

prerequisites

Before provisioning a new blueprint instance you should decide which provisioning model to use.

local

Local provisioning is supported by three backend types: local, S3 and remote.

A local backend has no prerequisites, but is also not recommended due to potential for data loss.

An S3 backend requires an AWS account configured via environment variables or local configuration file.

A remote backend for local execution requires terraform cloud file or environment-based configuration.

In addition local execution requires credentials for target environments, which may be the same credentials used for the backend.

In fact if you require provisioning to multiple different accounts it is advisable to use a remote execution model due to limitations of local execution with multiple credentials/accounts.

remote

Remote execution is supported by terraform cloud via standardised execution environments. Only the remote backend type is supported by this model.

A remote backend for remote execution only requires terraform cloud credentials configured via file or environment variables.

Note that there are limitations on remote execution of blueprints that contain local-exec provisioning, which also needs to be taken into consideration when deciding on the execution model.

provisioning

backend

Configure the blueprint backend using the backend command:

$ blueprint <id> backend <local|S3|remote> [options]

An S3 backend requires a bucket name for state.

A remote backend requires a terraform cloud organisation and a prefix for cloud workspaces.

workspace

You can use workspaces to manage multiple instances of the same blueprint. This is essential when using a remote backend as the local workspace is used to define the cloud workspaces.

$ blueprint <id> workspace new <name>

init

After configuration of the backend and workspace, initialisation of the blueprint instance will download required plugins and modules for execution.

$ blueprint <id> init

plan

A blueprint plan is used to identify required input variables and preview the changes made by provisioning. If you know the required input variables you may specify on the command line.

$ blueprint <id> plan [input vars]

apply

A blueprint instance is provisioned using the apply command. As with the plan command input variables may be specified to override defaults.

$ blueprint <id> apply [input vars]

multiple instances

By default a single blueprint instance is created with the"default" tag. You can create multiple instances of a blueprint by using the"tag" option supported by all blueprint commands.

$ blueprint --tag <tag> <id> <command>

Glossary

Blueprint - a collection of scripts used to provision resources that provide a function or service. It should be self-contained in that no other blueprints are required for the resources to be provisioned

Constellation - one or more blueprints that combine to provide a complete solution. Blueprints may be combined in different ways depending on the requirements of the constellation

Manifest - one or more constellations that provide a complete solution architecture. Often a manifest may contain just one constellation, but does allow for architectural layering through multiple constellations.

Letsencrypt

Support for configuring letsencrypt on various host configurations

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.