SlideShare a Scribd company logo
UNDERSTANDING THE
DATA LOOKUP PATTERN
Craig Dunn & Jan Ivar Beddari
Config Management Camp, February 2018
CRAIG DUNN
➤ Freelance Consultant &
Trainer
➤ Long time Puppet community
member
➤ Problem Solver
www.craigdunn.org
@crayfishx
JAN IVAR BEDDARI
➤ Problem Solver
➤ Long time Jerakia advocate
➤ Works at Safespring
➤ Makes people happy....
@beddari
CONFIGURATION MANAGEMENT
➤ Automation
➤ Repeatability
➤ Many tool options available for configuring components
➤ Reducing the burden of managing infrastructure
➤ Configuration management gives a consistent reliable method
to configure a component of infrastructure
➤ Infrastructure configuration involves a lot of custom data...
➤ It's critical to maintaining our systems
INFRASTRUCTURE DATA
usernamesdomain_name
firewall_rules
apache_port
gateway_ip dns_servers
ntp_servers
groups packages
timezonelimitsversion
THE DATA PROBLEM
➤ Where do we store it?
➤ How do we query it?
➤ How do we avoid duplicating it?
➤ Whats the best way to express the data?
THE DATA PROBLEM
➤ Embedded data in code
➤ Data management as infrastructure gets more diverse
THE DATA PROBLEM
➤ Embedded data in code
➤ Code sharing becomes impossible
➤ Complexity increases
➤ High barrier to a simple task
"The timezone should be set to UTC"
THE DATA PROBLEM
➤ Managing data
➤ Infrastructure is spread out across environments, regions
and business streams
➤ Data will differ depending on a multitude of factors
➤ The edge cases will get you
THE DATA PROBLEM
usernamesdomain_name
firewall_rules
apache_port
gateway_ip dns_servers
ntp_servers
groups packages
timezonelimitsversion
THE DATA PROBLEM
DEV
QA
PROD
DC1 DC2 DC3
Special
Snowflake
THE DATA PROBLEM
➤ Embedded code unmaintainable
➤ Complexity
PUPPET: THE EARLY YEARS
if $env == ‘dev’ {
$server = ‘dev.ntp.local’
} else {
if $hostname == ‘gateway’ {
$server = ‘pool.ntp.org’
} else {
$server = ‘prod.ntp.local’
}
}
➤ Hiera is the data lookup sub system for Puppet
➤ Data can be looked up from multiple sources
➤ Data separation
➤ Hierarchical lookups
PUPPET: THE HIERA WAY
➤ Remove complexity from the code
➤ Code becomes re-usable and easily shared
➤ Minimal expertise required to manage data values
DATA SEPARATION
ntp::server: pool.ntp.org
HIERARCHICAL LOOKUPS
HIERARCHICAL LOOKUPS
➤ Sell globally in USD
➤ Bill in EUR for European countries
➤ GBP for the UK, CHF for Switzerland
HIERARCHICAL LOOKUPS: SCOPE
➤ Scope: Information used to determine what data to lookup
➤ The scope in this example is the country & the continent
➤ We look up the data using the scope data
HIERARCHICAL LOOKUPS
"What is the value for currency in
the context of this scope..."
HIERARCHICAL LOOKUPS
➤ Hierarchical lookups are suited to infrastructure
➤ We often express infrastructure from most granular to most
encompassing factors
HIERARCHICAL LOOKUPS
➤ Hierarchical lookups are suited to infrastructure
➤ We often express infrastructure from most granular to most
encompassing factors
HIERARCHICAL LOOKUPS
➤ Hierarchical lookups are suited to infrastructure
➤ We often express infrastructure from most granular to most
encompassing factors
HIERARCHICAL LOOKUPS
➤ Hierarchical lookups are suited to infrastructure
➤ We often express infrastructure from most granular to most
encompassing factors
HIERARCHICAL LOOKUPS
➤ Hierarchical lookups are suited to infrastructure
➤ We often express infrastructure from most granular to most
encompassing factors
➤ Hierarchical lookups express infrastructure data well
➤ There is a lack of generic tooling in this space
➤ The data was getting harder
➤ Then there was Baloise...
WHAT I LEARNT
INTRODUCING JERAKIA
➤ Released in 2015
➤ Hierarchical data lookup tool
➤ http://jerakia.io
INTRODUCING JERAKIA
INTRODUCING JERAKIA: GOALS
➤ De-coupled from any particular tool
➤ Pluggable and extendable
➤ Flexible configuration
INTRODUCING JERAKIA: FEATURES
➤ Standalone with a REST API
➤ Look up data from a variety of data sources
➤ Define your own hierarchical structure
➤ Flexibility around lookup behaviour
JERAKIA LOOKUPS
➤ A lookup request contains
➤ The lookup key
➤ A namespace
➤ The scope of the lookup
JERAKIA LOOKUPS
➤ A lookup is run against a Jerakia policy
➤ Written in Ruby
➤ A policy is a container for one or more lookups
➤ Lookups query a data source
➤ Results are returned to the requestor
JERAKIA DATASOURCES
➤ A pluggable source of data
➤ Each lookup invokes one data source
➤ Jerakia ships with data sources:
➤ File
➤ HTTP
➤ Consul
➤ Custom data sources are easy to write
➤ https://github.com/crayfishx/jerakia-datasource-template
➤ Search through a filesystem hierarchy
➤ Data values are stored in YAML or JSON
➤ Typically maintained in and deployed from a VCS
➤ <dir>/<namespace>.yaml
FILE DATASOURCE
hostname/foo.enviatics.com/apache.yaml
environment/production/apache.yaml
location/london/apache.yaml
common/apache.yaml
JERAKIA: POLICIES
policy :main do
lookup :default do
datasource :file, {
:docroot => "/var/lib/jerakia/data",
:format => :yaml,
:searchpath => [
"host/#{scope[:hostname]}",
"env/#{scope[:env]}",
"common",
]
}
end
end
JERAKIA: POLICIES
policy :main do
lookup :default do
datasource :file, {
:docroot => "/var/jerakia/data",
:format => :yaml,
:searchpath => [
"host/#{scope[:hostname]}",
"env/#{scope[:env]}",
"common",
]
}
end
end
policy :main do
lookup :default do
datasource :file, {
:docroot => "/var/lib/jerakia/data",
:format => :yaml,
:searchpath => [
"host/#{scope[:hostname]}",
"env/#{scope[:env]}",
"common",
]
}
end
end
JERAKIA: POLICIES
policy :main do
lookup :default do
datasource :file, {
:docroot => "/var/jerakia/data",
:format => :yaml,
:searchpath => [
"host/#{scope[:hostname]}",
"env/#{scope[:env]}",
"common",
]
}
end
end
policy :main do
lookup :default do
datasource :file, {
:docroot => "/var/lib/jerakia/data",
:format => :yaml,
:searchpath => [
"host/#{scope[:hostname]}",
"env/#{scope[:env]}",
"common",
]
}
end
end
JERAKIA: POLICIES
policy :main do
lookup :default do
datasource :file, {
:docroot => "/var/jerakia/data",
:format => :yaml,
:searchpath => [
"host/#{scope[:hostname]}",
"env/#{scope[:env]}",
"common",
]
}
end
end
policy :main do
lookup :default do
datasource :file, {
:docroot => "/var/lib/jerakia/data",
:format => :yaml,
:searchpath => [
"host/#{scope[:hostname]}",
"env/#{scope[:env]}",
"common",
]
}
end
end
JERAKIA: POLICIES
policy :main do
lookup :default do
datasource :file, {
:docroot => "/var/jerakia/data",
:format => :yaml,
:searchpath => [
"host/#{scope[:hostname]}",
"env/#{scope[:env]}",
"common",
]
}
end
end
policy :main do
lookup :default do
datasource :file, {
:docroot => "/var/lib/jerakia/data",
:format => :yaml,
:searchpath => [
"host/#{scope[:hostname]}",
"env/#{scope[:env]}",
"common",
]
}
end
end
/var/lib/jerakia/data/host/baz.foo.com/apache.yaml
JERAKIA: POLICIES
policy :main do
lookup :default do
datasource :file, {
:docroot => "/var/jerakia/data",
:format => :yaml,
:searchpath => [
"host/#{scope[:hostname]}",
"env/#{scope[:env]}",
"common",
]
}
end
end
policy :main do
lookup :default do
datasource :file, {
:docroot => "/var/lib/jerakia/data",
:format => :yaml,
:searchpath => [
"host/#{scope[:hostname]}",
"env/#{scope[:env]}",
"common",
]
}
end
end
/var/lib/jerakia/data/env/dev/apache.yaml
JERAKIA: POLICIES
policy :main do
lookup :default do
datasource :file, {
:docroot => "/var/jerakia/data",
:format => :yaml,
:searchpath => [
"host/#{scope[:hostname]}",
"env/#{scope[:env]}",
"common",
]
}
end
end
policy :main do
lookup :default do
datasource :file, {
:docroot => "/var/lib/jerakia/data",
:format => :yaml,
:searchpath => [
"host/#{scope[:hostname]}",
"env/#{scope[:env]}",
"common",
]
}
end
end
/var/lib/jerakia/data/common/apache.yaml
JERAKIA: POLICIES
Scope
Handler
Request
Lookup
Plugins
Data Source
Output Filter
Response Data
Request consists of a
lookup key, a namespace
and some metadata
Information to be
used in determining
how data is looked up
Lookup
plugins can read
and modify the scope
and
A pluggable data
source is
used to lookup data
Data returned
from the datasource is
passed to a pluggable
output filter
ADVANCED FEATURES: CONFINE / EXCLUDE / STOP
policy :default do
lookup :ireland do
datasource :file, {
:format => :yaml,
:docroot => "/var/external/data/ie",
:searchpath => [
"project/#{scope[:project]}",
"common",
]
}
confine scope[:location], "ie"
confine request.namespace[0], "apache"
stop
end
lookup :main, do
datasource :file, {
:format => :yaml,
:docroot => "/var/lib/jerakia",
:searchpath => [
"hostname/#{scope[:fqdn]}",
"environment/#{scope[:environment]}",
"common"
],
}
end
end
➤ Isolate lookups
ADVANCED FEATURES: HANDLING SECRETS
➤ Jerakia supports decrypting values from any data source
➤ Uses a pluggable encryption provider
➤ Vault provider native
➤ Uses Vaults' transit feature as "cryptography as a service"
➤ Custom encryption providers possible
https://www.craigdunn.org/2017/04/managing-puppet-secrets-with-jerakia-and-vault/
➤ By default Jerakia will return the first value found while
traversing the hierarchy
➤ We can request for the entire hierarchy be searched and all
instances of a value returned in one array or hashmap
ADVANCED FEATURES: MERGE BEHAVIOUR
users:
- lucy
- bob
- mike
users:
- root
- craig
- jan
- max
- jessica
{
users: [
"lucy",
"bob",
"mike",
"root",
"craig",
"max",
"jessica"
]
}
CommonEnv (dev)
ADVANCED FEATURES: READ MORE
http://jerakia.io
➤ Plugins
➤ Schemas
➤ Datasources
➤ Output Filters
➤ API documentation
THE THIRD DATA PROBLEM
Everyone Else
When people starting saying "DevOps"...
THE THIRD DATA PROBLEM
Everyone
Else
...2018
THE THIRD DATA PROBLEM
➤ We use lots of tools to manage our infrastructure
➤ Provisioning
➤ Orchestration
➤ Configuration Management
➤ Monitoring
➤ Different tools have different data patterns
➤ The actual data is the same
JERAKIA: AIM
➤ A centralized source for all data lookups
➤ Powerful hierarchical lookups
➤ Current front integrations;
➤ Puppet (Hiera 5 backend)
➤ https://forge.puppet.com/crayfishx/jerakia
➤ Ansible (Lookup plugin)
➤ https://github.com/crayfishx/ansible-jerakia
➤ Potential for many more!
Understanding the Data Lookup Pattern
AND FINALLY...
➤ Features
➤ Ideas
➤ Fixes
➤ ... any other feedback
https://github.com/crayfishx/jerakia
http://jerakia.io
Craig Dunn
@crayfishx
Jan Ivar Beddari
@beddari
Thank you!

More Related Content

PPTX
Accessing external hadoop data sources using pivotal e xtension framework (px...
PDF
Use Cases for Elastic Search Percolator
PPTX
Building an unstructured data management solution with elastic search and ama...
PDF
What enterprises can learn from Real Time Bidding
PDF
Data modeling for Elasticsearch
PDF
Scaling Recommendations, Semantic Search, & Data Analytics with solr
PDF
Elasticsearch Introduction to Data model, Search & Aggregations
PDF
Elasticsearch in 15 minutes
Accessing external hadoop data sources using pivotal e xtension framework (px...
Use Cases for Elastic Search Percolator
Building an unstructured data management solution with elastic search and ama...
What enterprises can learn from Real Time Bidding
Data modeling for Elasticsearch
Scaling Recommendations, Semantic Search, & Data Analytics with solr
Elasticsearch Introduction to Data model, Search & Aggregations
Elasticsearch in 15 minutes

What's hot (20)

PPTX
LDP4j: A framework for the development of interoperable read-write Linked Da...
PDF
Distributed percolator in elasticsearch
PPT
Catacomb Apachecon Fast Feather 2008
PPTX
Introduction to Lucene & Solr and Usecases
PPTX
HBaseCon 2015: Analyzing HBase Data with Apache Hive
PPTX
Elastic search Walkthrough
PDF
Applied Semantic Search with Microsoft SQL Server
PDF
Elasticsearch Introduction at BigData meetup
PDF
IR with lucene
PDF
Swiss Big Data User Group - Introduction to Apache Drill
PDF
Thinking restfully
PPTX
HBase: Just the Basics
PPTX
REST meets Semantic Web
PPTX
MongoDB and Hadoop: Driving Business Insights
PDF
elasticsearch
PDF
Apache HBase - Just the Basics
PPTX
Building a Scalable Web Crawler with Hadoop
PDF
Web Services Hadoop Summit 2012
PDF
Intro to Elasticsearch
PDF
The Open Source and Cloud Part of Oracle Big Data Cloud Service for Beginners
LDP4j: A framework for the development of interoperable read-write Linked Da...
Distributed percolator in elasticsearch
Catacomb Apachecon Fast Feather 2008
Introduction to Lucene & Solr and Usecases
HBaseCon 2015: Analyzing HBase Data with Apache Hive
Elastic search Walkthrough
Applied Semantic Search with Microsoft SQL Server
Elasticsearch Introduction at BigData meetup
IR with lucene
Swiss Big Data User Group - Introduction to Apache Drill
Thinking restfully
HBase: Just the Basics
REST meets Semantic Web
MongoDB and Hadoop: Driving Business Insights
elasticsearch
Apache HBase - Just the Basics
Building a Scalable Web Crawler with Hadoop
Web Services Hadoop Summit 2012
Intro to Elasticsearch
The Open Source and Cloud Part of Oracle Big Data Cloud Service for Beginners
Ad

Similar to Understanding the Data Lookup Pattern (20)

PDF
Solving real world data problems with Jerakia
PDF
Delegated Configuration with Multiple Hiera Databases - PuppetConf 2014
PDF
Merging and Migrating: Data Portability from the Trenches
PPTX
SplunkLive! Beginner Session
PDF
WarsawITDays_ ApacheNiFi202
PDF
Open Data Inside - Why Internal Data Portals are Key to Successful Data Gover...
PPTX
Data Architectures for Robust Decision Making
PPTX
Splunk live beginner training nyc
PPTX
SplunkLive! Getting Started with Splunk Enterprise
PDF
Not Your Father’s Data Warehouse: Breaking Tradition with Innovation
PDF
Meta scale kognitio hadoop webinar
PDF
Terraform in action
PDF
Learning the basics of Apache NiFi for iot OSS Europe 2020
PDF
Pros_and_Cons_of_DW_Apps pdf.pdf
PDF
Gates Toorcon X New School Information Gathering
PPT
Predictable Big Data Performance in Real-time
PPTX
Berlin Buzz Words - Apache Drill by Ted Dunning & Michael Hausenblas
PPTX
SplunkLive! - Getting started with Splunk
PDF
Postgres.foreign.data.wrappers.2015
 
PDF
Apache Drill: An Active, Ad-hoc Query System for large-scale Data Sets
Solving real world data problems with Jerakia
Delegated Configuration with Multiple Hiera Databases - PuppetConf 2014
Merging and Migrating: Data Portability from the Trenches
SplunkLive! Beginner Session
WarsawITDays_ ApacheNiFi202
Open Data Inside - Why Internal Data Portals are Key to Successful Data Gover...
Data Architectures for Robust Decision Making
Splunk live beginner training nyc
SplunkLive! Getting Started with Splunk Enterprise
Not Your Father’s Data Warehouse: Breaking Tradition with Innovation
Meta scale kognitio hadoop webinar
Terraform in action
Learning the basics of Apache NiFi for iot OSS Europe 2020
Pros_and_Cons_of_DW_Apps pdf.pdf
Gates Toorcon X New School Information Gathering
Predictable Big Data Performance in Real-time
Berlin Buzz Words - Apache Drill by Ted Dunning & Michael Hausenblas
SplunkLive! - Getting started with Splunk
Postgres.foreign.data.wrappers.2015
 
Apache Drill: An Active, Ad-hoc Query System for large-scale Data Sets
Ad

Recently uploaded (20)

PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Electronic commerce courselecture one. Pdf
PPTX
Machine Learning_overview_presentation.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Cloud computing and distributed systems.
PDF
Encapsulation theory and applications.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Approach and Philosophy of On baking technology
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Unlocking AI with Model Context Protocol (MCP)
Per capita expenditure prediction using model stacking based on satellite ima...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
sap open course for s4hana steps from ECC to s4
Electronic commerce courselecture one. Pdf
Machine Learning_overview_presentation.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Cloud computing and distributed systems.
Encapsulation theory and applications.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
NewMind AI Weekly Chronicles - August'25-Week II
Approach and Philosophy of On baking technology
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Empathic Computing: Creating Shared Understanding
Programs and apps: productivity, graphics, security and other tools
Encapsulation_ Review paper, used for researhc scholars
Diabetes mellitus diagnosis method based random forest with bat algorithm
Unlocking AI with Model Context Protocol (MCP)

Understanding the Data Lookup Pattern

  • 1. UNDERSTANDING THE DATA LOOKUP PATTERN Craig Dunn & Jan Ivar Beddari Config Management Camp, February 2018
  • 2. CRAIG DUNN ➤ Freelance Consultant & Trainer ➤ Long time Puppet community member ➤ Problem Solver www.craigdunn.org @crayfishx
  • 3. JAN IVAR BEDDARI ➤ Problem Solver ➤ Long time Jerakia advocate ➤ Works at Safespring ➤ Makes people happy.... @beddari
  • 4. CONFIGURATION MANAGEMENT ➤ Automation ➤ Repeatability ➤ Many tool options available for configuring components ➤ Reducing the burden of managing infrastructure
  • 5. ➤ Configuration management gives a consistent reliable method to configure a component of infrastructure ➤ Infrastructure configuration involves a lot of custom data... ➤ It's critical to maintaining our systems INFRASTRUCTURE DATA usernamesdomain_name firewall_rules apache_port gateway_ip dns_servers ntp_servers groups packages timezonelimitsversion
  • 6. THE DATA PROBLEM ➤ Where do we store it? ➤ How do we query it? ➤ How do we avoid duplicating it? ➤ Whats the best way to express the data?
  • 7. THE DATA PROBLEM ➤ Embedded data in code ➤ Data management as infrastructure gets more diverse
  • 8. THE DATA PROBLEM ➤ Embedded data in code ➤ Code sharing becomes impossible ➤ Complexity increases ➤ High barrier to a simple task "The timezone should be set to UTC"
  • 9. THE DATA PROBLEM ➤ Managing data ➤ Infrastructure is spread out across environments, regions and business streams ➤ Data will differ depending on a multitude of factors ➤ The edge cases will get you
  • 10. THE DATA PROBLEM usernamesdomain_name firewall_rules apache_port gateway_ip dns_servers ntp_servers groups packages timezonelimitsversion
  • 11. THE DATA PROBLEM DEV QA PROD DC1 DC2 DC3 Special Snowflake
  • 13. ➤ Embedded code unmaintainable ➤ Complexity PUPPET: THE EARLY YEARS if $env == ‘dev’ { $server = ‘dev.ntp.local’ } else { if $hostname == ‘gateway’ { $server = ‘pool.ntp.org’ } else { $server = ‘prod.ntp.local’ } }
  • 14. ➤ Hiera is the data lookup sub system for Puppet ➤ Data can be looked up from multiple sources ➤ Data separation ➤ Hierarchical lookups PUPPET: THE HIERA WAY
  • 15. ➤ Remove complexity from the code ➤ Code becomes re-usable and easily shared ➤ Minimal expertise required to manage data values DATA SEPARATION ntp::server: pool.ntp.org
  • 17. HIERARCHICAL LOOKUPS ➤ Sell globally in USD ➤ Bill in EUR for European countries ➤ GBP for the UK, CHF for Switzerland
  • 18. HIERARCHICAL LOOKUPS: SCOPE ➤ Scope: Information used to determine what data to lookup ➤ The scope in this example is the country & the continent ➤ We look up the data using the scope data
  • 19. HIERARCHICAL LOOKUPS "What is the value for currency in the context of this scope..."
  • 20. HIERARCHICAL LOOKUPS ➤ Hierarchical lookups are suited to infrastructure ➤ We often express infrastructure from most granular to most encompassing factors
  • 21. HIERARCHICAL LOOKUPS ➤ Hierarchical lookups are suited to infrastructure ➤ We often express infrastructure from most granular to most encompassing factors
  • 22. HIERARCHICAL LOOKUPS ➤ Hierarchical lookups are suited to infrastructure ➤ We often express infrastructure from most granular to most encompassing factors
  • 23. HIERARCHICAL LOOKUPS ➤ Hierarchical lookups are suited to infrastructure ➤ We often express infrastructure from most granular to most encompassing factors
  • 24. HIERARCHICAL LOOKUPS ➤ Hierarchical lookups are suited to infrastructure ➤ We often express infrastructure from most granular to most encompassing factors
  • 25. ➤ Hierarchical lookups express infrastructure data well ➤ There is a lack of generic tooling in this space ➤ The data was getting harder ➤ Then there was Baloise... WHAT I LEARNT
  • 26. INTRODUCING JERAKIA ➤ Released in 2015 ➤ Hierarchical data lookup tool ➤ http://jerakia.io
  • 28. INTRODUCING JERAKIA: GOALS ➤ De-coupled from any particular tool ➤ Pluggable and extendable ➤ Flexible configuration
  • 29. INTRODUCING JERAKIA: FEATURES ➤ Standalone with a REST API ➤ Look up data from a variety of data sources ➤ Define your own hierarchical structure ➤ Flexibility around lookup behaviour
  • 30. JERAKIA LOOKUPS ➤ A lookup request contains ➤ The lookup key ➤ A namespace ➤ The scope of the lookup
  • 31. JERAKIA LOOKUPS ➤ A lookup is run against a Jerakia policy ➤ Written in Ruby ➤ A policy is a container for one or more lookups ➤ Lookups query a data source ➤ Results are returned to the requestor
  • 32. JERAKIA DATASOURCES ➤ A pluggable source of data ➤ Each lookup invokes one data source ➤ Jerakia ships with data sources: ➤ File ➤ HTTP ➤ Consul ➤ Custom data sources are easy to write ➤ https://github.com/crayfishx/jerakia-datasource-template
  • 33. ➤ Search through a filesystem hierarchy ➤ Data values are stored in YAML or JSON ➤ Typically maintained in and deployed from a VCS ➤ <dir>/<namespace>.yaml FILE DATASOURCE hostname/foo.enviatics.com/apache.yaml environment/production/apache.yaml location/london/apache.yaml common/apache.yaml
  • 34. JERAKIA: POLICIES policy :main do lookup :default do datasource :file, { :docroot => "/var/lib/jerakia/data", :format => :yaml, :searchpath => [ "host/#{scope[:hostname]}", "env/#{scope[:env]}", "common", ] } end end
  • 35. JERAKIA: POLICIES policy :main do lookup :default do datasource :file, { :docroot => "/var/jerakia/data", :format => :yaml, :searchpath => [ "host/#{scope[:hostname]}", "env/#{scope[:env]}", "common", ] } end end policy :main do lookup :default do datasource :file, { :docroot => "/var/lib/jerakia/data", :format => :yaml, :searchpath => [ "host/#{scope[:hostname]}", "env/#{scope[:env]}", "common", ] } end end
  • 36. JERAKIA: POLICIES policy :main do lookup :default do datasource :file, { :docroot => "/var/jerakia/data", :format => :yaml, :searchpath => [ "host/#{scope[:hostname]}", "env/#{scope[:env]}", "common", ] } end end policy :main do lookup :default do datasource :file, { :docroot => "/var/lib/jerakia/data", :format => :yaml, :searchpath => [ "host/#{scope[:hostname]}", "env/#{scope[:env]}", "common", ] } end end
  • 37. JERAKIA: POLICIES policy :main do lookup :default do datasource :file, { :docroot => "/var/jerakia/data", :format => :yaml, :searchpath => [ "host/#{scope[:hostname]}", "env/#{scope[:env]}", "common", ] } end end policy :main do lookup :default do datasource :file, { :docroot => "/var/lib/jerakia/data", :format => :yaml, :searchpath => [ "host/#{scope[:hostname]}", "env/#{scope[:env]}", "common", ] } end end
  • 38. JERAKIA: POLICIES policy :main do lookup :default do datasource :file, { :docroot => "/var/jerakia/data", :format => :yaml, :searchpath => [ "host/#{scope[:hostname]}", "env/#{scope[:env]}", "common", ] } end end policy :main do lookup :default do datasource :file, { :docroot => "/var/lib/jerakia/data", :format => :yaml, :searchpath => [ "host/#{scope[:hostname]}", "env/#{scope[:env]}", "common", ] } end end /var/lib/jerakia/data/host/baz.foo.com/apache.yaml
  • 39. JERAKIA: POLICIES policy :main do lookup :default do datasource :file, { :docroot => "/var/jerakia/data", :format => :yaml, :searchpath => [ "host/#{scope[:hostname]}", "env/#{scope[:env]}", "common", ] } end end policy :main do lookup :default do datasource :file, { :docroot => "/var/lib/jerakia/data", :format => :yaml, :searchpath => [ "host/#{scope[:hostname]}", "env/#{scope[:env]}", "common", ] } end end /var/lib/jerakia/data/env/dev/apache.yaml
  • 40. JERAKIA: POLICIES policy :main do lookup :default do datasource :file, { :docroot => "/var/jerakia/data", :format => :yaml, :searchpath => [ "host/#{scope[:hostname]}", "env/#{scope[:env]}", "common", ] } end end policy :main do lookup :default do datasource :file, { :docroot => "/var/lib/jerakia/data", :format => :yaml, :searchpath => [ "host/#{scope[:hostname]}", "env/#{scope[:env]}", "common", ] } end end /var/lib/jerakia/data/common/apache.yaml
  • 41. JERAKIA: POLICIES Scope Handler Request Lookup Plugins Data Source Output Filter Response Data Request consists of a lookup key, a namespace and some metadata Information to be used in determining how data is looked up Lookup plugins can read and modify the scope and A pluggable data source is used to lookup data Data returned from the datasource is passed to a pluggable output filter
  • 42. ADVANCED FEATURES: CONFINE / EXCLUDE / STOP policy :default do lookup :ireland do datasource :file, { :format => :yaml, :docroot => "/var/external/data/ie", :searchpath => [ "project/#{scope[:project]}", "common", ] } confine scope[:location], "ie" confine request.namespace[0], "apache" stop end lookup :main, do datasource :file, { :format => :yaml, :docroot => "/var/lib/jerakia", :searchpath => [ "hostname/#{scope[:fqdn]}", "environment/#{scope[:environment]}", "common" ], } end end ➤ Isolate lookups
  • 43. ADVANCED FEATURES: HANDLING SECRETS ➤ Jerakia supports decrypting values from any data source ➤ Uses a pluggable encryption provider ➤ Vault provider native ➤ Uses Vaults' transit feature as "cryptography as a service" ➤ Custom encryption providers possible https://www.craigdunn.org/2017/04/managing-puppet-secrets-with-jerakia-and-vault/
  • 44. ➤ By default Jerakia will return the first value found while traversing the hierarchy ➤ We can request for the entire hierarchy be searched and all instances of a value returned in one array or hashmap ADVANCED FEATURES: MERGE BEHAVIOUR users: - lucy - bob - mike users: - root - craig - jan - max - jessica { users: [ "lucy", "bob", "mike", "root", "craig", "max", "jessica" ] } CommonEnv (dev)
  • 45. ADVANCED FEATURES: READ MORE http://jerakia.io ➤ Plugins ➤ Schemas ➤ Datasources ➤ Output Filters ➤ API documentation
  • 46. THE THIRD DATA PROBLEM Everyone Else When people starting saying "DevOps"...
  • 47. THE THIRD DATA PROBLEM Everyone Else ...2018
  • 48. THE THIRD DATA PROBLEM ➤ We use lots of tools to manage our infrastructure ➤ Provisioning ➤ Orchestration ➤ Configuration Management ➤ Monitoring ➤ Different tools have different data patterns ➤ The actual data is the same
  • 49. JERAKIA: AIM ➤ A centralized source for all data lookups ➤ Powerful hierarchical lookups ➤ Current front integrations; ➤ Puppet (Hiera 5 backend) ➤ https://forge.puppet.com/crayfishx/jerakia ➤ Ansible (Lookup plugin) ➤ https://github.com/crayfishx/ansible-jerakia ➤ Potential for many more!
  • 51. AND FINALLY... ➤ Features ➤ Ideas ➤ Fixes ➤ ... any other feedback https://github.com/crayfishx/jerakia