SlideShare a Scribd company logo
Declare Your Infrastructure
InfraKit, LinuxKit, and Moby
Steven Kaufer, David Freitag – IBM Cloud
Infrakit Agenda
Why Infrakit + Terraform?
Terraform Instance Plugin Overview
Topology Example
Swarm Cluster Bootstrapping
Why Infrakit + Terraform?
Terraform
- Manages declarative infrastructure (as code)
- Broad platform coverage
- Focuses on initial deployment
Infrakit
- Active monitoring
- Enforcement of declarative specifications
- Group abstraction
Infrakit Terraform Instance Plugin
• Each instance defined in unique tf.json file
• Files built from a common instance specification with unique attributes
• Update = File removal (destroy) + replacement (provision)
$ ls
instance-1507652020.tf.json
instance-1507652021.tf.json
instance-1507652022.tf.json
terraform.tfstate
{
"resource": {
"ibm_compute_vm_instance": {
"instance-1507652020": {
"cores": 2,
"hostname": "worker-1507652020",
"tags": [
"infrakit.group:workers",
"name:instance-1507652020"
...
}
tf.json
instance-1507652020.tf.json
Topology Example
Node 1 Node 2 Node 3
$ ls
instance-1.tf.json
instance-2.tf.json
instance-2.tf.json
Topology Example
Block
Storage 1
Block
Storage 2
Block
Storage 3
Node 1 Node 2 Node 3
Topology Example
Network File Storage
Block
Storage 1
Block
Storage 2
Block
Storage 3
Node 1 Node 2 Node 3
Topology Example
Network File Storage
Block
Storage 1
Block
Storage 2
Block
Storage 3
Node 1.1 Node 1 Node 2 Node 3
Topology Example
Network File Storage
Block
Storage 1
Block
Storage 2
Block
Storage 3
Node 1.1 Node 1 Node 2 Node 3
• Where is the block and
network storage defined?
• How can node x reference
the related resources?
Solution – Resource Scoping
Network File Storage
Block
Storage 1
Block
Storage 2
Block
Storage 3
Node 1.1 Node 1 Node 2 Node 3
Dedicated Scope
- Re-attach on rolling update
Global Scope
- Tied to group lifecycle
Solution – Resource Scoping
Network File Storage
Block
Storage 1
Block
Storage 2
Block
Storage 3
Node 1.1 Node 1 Node 2 Node 3
Dedicated Scope
- Re-attach on rolling update
Global Scope
- Tied to group lifecycle
Resource Scoping
- Use @scope resource property
- dedicated: Loosely coupled with VM
- global: Coupled with the scope (group)
{
"Allocation": {
"LogicalIDs": ["mgr1", "mgr2", "mgr3"]
},
"Instance": {
"Plugin": "instance-terraform",
"Properties": {
"resource": {
"ibm_compute_vm_instance": {
"host": {...}
},
"ibm_storage_file": {
"my_file_storage": {
"@scope": "managers",
...
}
}
"ibm_storage_block": {
"my_block_storage": {
"@scope": "@dedicated-managers",
...
}
},
...
$ ls
instance-xxx1.tf.json
instance-xxx2.tf.json
instance-xxx3.tf.json
managers_dedicated_mgr1.tf.json
managers_dedicated_mgr2.tf.json
managers_dedicated_mgr3.tf.json
managers_global.tf.json
@scope
Resource Scoping
Reference related resource using terraform interpolation
- Predicable “type.name.attribute” path:
- Global:
- Dedicated quorum:
- Dedicated scaler:
${ibm_storage_file.managers-my_file_storage.id}
${ibm_storage_block.workers-{{ var "/self/dedicated/attachId" }}-my_block_storage.id}
<resource-type>.<scope>-[<logicalID|index>-]<given-resource-name>.<attribute>
[----------------resource-name------------------]
${ibm_storage_block.managers-{{ var "/self/logicalId" }}-my_block_storage.id}
Resource Scoping Demo
Swarm Cluster Bootstrapping
Network File Storage
Mgr-1
Goals:
- Infrakit running on each swarm manager
- Shared terraform files on NFS
- Self-healing and self-managing with
leadership failover
Mgr-2 Mgr-3
InfraKit
Mgr-1
Bootstrap Flow:
1. Create seed VM in IBM Schematics
SeedVM
Swarm Cluster Bootstrapping
Swarm Cluster Bootstrapping
Network File Storage
Mgr-1
Bootstrap Flow:
1. Create seed VM in IBM Schematics
2. Mount NFS
SeedVM
Swarm Cluster Bootstrapping
Network File Storage
Mgr-1
Bootstrap Flow:
1. Create seed VM in IBM Schematics
2. Mount NFS
3. Import current VM and NFS into TF
and create import tf.json files
SeedVM
InfraKit
tf.json
Swarm Cluster Bootstrapping
Network File Storage
Mgr-1
Bootstrap Flow:
1. Create seed VM in IBM Schematics
2. Mount NFS
3. Import current VM and NFS into TF
and create import tf.json files
4. Scale out group
SeedVM
Mgr-2 Mgr-3
InfraKit
tf.json
Bootstrapping Resources
- Define resource(s) in plugin.config file
- Imports resources into terraform state
- Creates tf.json files
"inproc": {
"Kind": "terraform",
"Options": {
"ImportResources": [
{
"ResourceType": "ibm_compute_vm_instance",
"ResourceID": "<vm-id>"
},
{
"ResourceType": "ibm_storage_file",
"ResourceID": "<file-storage-id>"
}
]
}
}
tf.json
plugin.config
plugin.config
Group Bootstrapping Demo
Thanks!
Declare Your Infrastructure
InfraKit, LinuxKit, and Moby
Resource Scoping Demo Backup
# cat instance-1507834700.tf.json
{
"resource": {
"ibm_compute_vm_instance": {
"instance-1507834700": {
"cores": "2",
"datacenter": "dal10",
"memory": "2048",
"tags": [
"swarm-id:jwd0s2qozy4re26mbx0zcvj42",
"infrakit.attach:workers_dedicated_1 workers_global",
"name:instance-1507834700",
"infrakit-link:rmncsfzc6l3f23nn",
"infrakit-link-context:swarm::jwd0s2qozy4re26mbx0zcvj42::worker",
"infrakit-link-created:2017-10-12t18:58:20z",
"infrakit.config_sha:s3yqjs7hpijtxue5l2tbudqxq5dgkwhh",
"infrakit.group:workers"
],
"user_metadata": "echo NFS-ID: ${ibm_storage_file.workers-my_file_storage.id}
BS-ID: ${ibm_storage_block.workers-1-my_block_storage.id} ... "
Resource Scoping Demo Backup
# infrakit group/workers describe
ID LOGICAL TAGS
instance-1507652020 - infrakit.attach=workers_dedicated_1,workers_global
instance-1507652021 - infrakit.attach=workers_dedicated_2,workers_global
instance-1507652022 - infrakit.attach=workers_dedicated_3,workers_global
# terraform show
ibm_compute_vm_instance.instance-1507652020:
id = 41638329
tags.1986196614 = infrakit.attach:workers_dedicated_1 workers_global
user_metadata = echo NFS-ID: 32062003 BS-ID: 32062011
ibm_compute_vm_instance.instance-1507652021:
id = 41639325
tags.1604993140 = infrakit.attach:workers_dedicated_2 workers_global
user_metadata = echo NFS-ID: 32062003 BS-ID: 32062595
ibm_compute_vm_instance.instance-1507652022:
id = 41640617
tags.4056076773 = infrakit.attach:workers_dedicated_3 workers_global
user_metadata = echo NFS-ID: 32062003 BS-ID: 32062597
ibm_storage_block.workers-1-my_block_storage:
id = 32062011
ibm_storage_block.workers-2-my_block_storage:
id = 32062595
ibm_storage_block.workers-3-my_block_storage:
id = 32062597
ibm_storage_file.workers-my_file_storage:
id = 32062003

More Related Content

PDF
Using linuxKit to build custom rancherOS systems
PDF
CoreOS intro
PDF
CoreOS: Control Your Fleet
PDF
Docker n co
PDF
CoreOS @Codetalks Hamburg
PDF
CoreOS + Kubernetes @ All Things Open 2015
PDF
Object Storage with Gluster
PDF
CoreOS introduction - Johann Romefort
Using linuxKit to build custom rancherOS systems
CoreOS intro
CoreOS: Control Your Fleet
Docker n co
CoreOS @Codetalks Hamburg
CoreOS + Kubernetes @ All Things Open 2015
Object Storage with Gluster
CoreOS introduction - Johann Romefort

What's hot (20)

PDF
Docker Overview
PPTX
CoreOS in a Nutshell
PDF
Containers: What are they, Really?
PDF
Docker 1.11 @ Docker SF Meetup
PPTX
CoreOS Intro
PDF
What Have Syscalls Done for you Lately?
PPTX
Container & kubernetes
PDF
Launching containers with fleet
PDF
Small, Simple, and Secure: Alpine Linux under the Microscope
PPTX
Couch to OpenStack: Cinder - August 6, 2013
PDF
Docker volume-isolator-in-mesos
PDF
Painless ruby deployment on shelly cloud
PDF
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
PPT
On MongoDB backup
PDF
15 kubernetes failure points you should watch
PDF
How to operate containerized OpenStack
PPTX
Practical Glusto Example
PDF
Docker Swarm 0.2.0
PDF
Docker 1.11 Meetup: Containerd and runc, by Arnaud Porterie and Michael Crosby
DOCX
Docker consul-registrator
Docker Overview
CoreOS in a Nutshell
Containers: What are they, Really?
Docker 1.11 @ Docker SF Meetup
CoreOS Intro
What Have Syscalls Done for you Lately?
Container & kubernetes
Launching containers with fleet
Small, Simple, and Secure: Alpine Linux under the Microscope
Couch to OpenStack: Cinder - August 6, 2013
Docker volume-isolator-in-mesos
Painless ruby deployment on shelly cloud
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
On MongoDB backup
15 kubernetes failure points you should watch
How to operate containerized OpenStack
Practical Glusto Example
Docker Swarm 0.2.0
Docker 1.11 Meetup: Containerd and runc, by Arnaud Porterie and Michael Crosby
Docker consul-registrator
Ad

Similar to Declare your infrastructure: InfraKit, LinuxKit and Moby (20)

PPTX
Comprehensive Terraform Training
PPTX
terraform cours intéressant et super fort
PDF
Immutable Deployments with AWS CloudFormation and AWS Lambda
PDF
Terrastore - A document database for developers
PPTX
AEM GEMs Session Oak Lucene Indexes
PPTX
Oak Lucene Indexes
PDF
Hopping in clouds - phpuk 17
PDF
Apache: Big Data - Starting with Apache Spark, Best Practices
PDF
Terraform 0.9 + good practices
PDF
Terraform in deployment pipeline
PPTX
UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File Server
PDF
Infrastructure as Code - Terraform - Devfest 2018
PDF
PDF
A Hands-on Introduction on Terraform Best Concepts and Best Practices
PDF
Laravel intake 37 all days
PDF
Real-Time Spark: From Interactive Queries to Streaming
PDF
Declarative & workflow based infrastructure with Terraform
PPTX
BGOUG 2012 - Drag & drop and other stuff - Using your database as a file server
PDF
TIAD : Automating the modern datacenter
PDF
DevOps Enabling Your Team
Comprehensive Terraform Training
terraform cours intéressant et super fort
Immutable Deployments with AWS CloudFormation and AWS Lambda
Terrastore - A document database for developers
AEM GEMs Session Oak Lucene Indexes
Oak Lucene Indexes
Hopping in clouds - phpuk 17
Apache: Big Data - Starting with Apache Spark, Best Practices
Terraform 0.9 + good practices
Terraform in deployment pipeline
UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File Server
Infrastructure as Code - Terraform - Devfest 2018
A Hands-on Introduction on Terraform Best Concepts and Best Practices
Laravel intake 37 all days
Real-Time Spark: From Interactive Queries to Streaming
Declarative & workflow based infrastructure with Terraform
BGOUG 2012 - Drag & drop and other stuff - Using your database as a file server
TIAD : Automating the modern datacenter
DevOps Enabling Your Team
Ad

More from Moby Project (12)

PDF
Libnetwork updates
PPTX
CRI-containerd
PDF
FaaS-and-Furious
PPTX
LinuxKit
PPTX
Notary - container signing
PPTX
Moby Summit introduction
PPTX
Moby and kubernetes entitlements
PDF
Builder and BuildKit
PDF
OpenWhisk and IBM cloud functions
PDF
The State of containerd
PDF
LinuxKit and OpenOverlay
ODP
LinuxKit Swarm Nodes
Libnetwork updates
CRI-containerd
FaaS-and-Furious
LinuxKit
Notary - container signing
Moby Summit introduction
Moby and kubernetes entitlements
Builder and BuildKit
OpenWhisk and IBM cloud functions
The State of containerd
LinuxKit and OpenOverlay
LinuxKit Swarm Nodes

Recently uploaded (20)

PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Machine learning based COVID-19 study performance prediction
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPT
Teaching material agriculture food technology
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Encapsulation theory and applications.pdf
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
August Patch Tuesday
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
MIND Revenue Release Quarter 2 2025 Press Release
Machine learning based COVID-19 study performance prediction
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Programs and apps: productivity, graphics, security and other tools
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Group 1 Presentation -Planning and Decision Making .pptx
Teaching material agriculture food technology
Per capita expenditure prediction using model stacking based on satellite ima...
Unlocking AI with Model Context Protocol (MCP)
A comparative analysis of optical character recognition models for extracting...
SOPHOS-XG Firewall Administrator PPT.pptx
Assigned Numbers - 2025 - Bluetooth® Document
Encapsulation theory and applications.pdf
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Advanced methodologies resolving dimensionality complications for autism neur...
August Patch Tuesday
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

Declare your infrastructure: InfraKit, LinuxKit and Moby

  • 1. Declare Your Infrastructure InfraKit, LinuxKit, and Moby Steven Kaufer, David Freitag – IBM Cloud
  • 2. Infrakit Agenda Why Infrakit + Terraform? Terraform Instance Plugin Overview Topology Example Swarm Cluster Bootstrapping
  • 3. Why Infrakit + Terraform? Terraform - Manages declarative infrastructure (as code) - Broad platform coverage - Focuses on initial deployment Infrakit - Active monitoring - Enforcement of declarative specifications - Group abstraction
  • 4. Infrakit Terraform Instance Plugin • Each instance defined in unique tf.json file • Files built from a common instance specification with unique attributes • Update = File removal (destroy) + replacement (provision) $ ls instance-1507652020.tf.json instance-1507652021.tf.json instance-1507652022.tf.json terraform.tfstate { "resource": { "ibm_compute_vm_instance": { "instance-1507652020": { "cores": 2, "hostname": "worker-1507652020", "tags": [ "infrakit.group:workers", "name:instance-1507652020" ... } tf.json instance-1507652020.tf.json
  • 5. Topology Example Node 1 Node 2 Node 3 $ ls instance-1.tf.json instance-2.tf.json instance-2.tf.json
  • 6. Topology Example Block Storage 1 Block Storage 2 Block Storage 3 Node 1 Node 2 Node 3
  • 7. Topology Example Network File Storage Block Storage 1 Block Storage 2 Block Storage 3 Node 1 Node 2 Node 3
  • 8. Topology Example Network File Storage Block Storage 1 Block Storage 2 Block Storage 3 Node 1.1 Node 1 Node 2 Node 3
  • 9. Topology Example Network File Storage Block Storage 1 Block Storage 2 Block Storage 3 Node 1.1 Node 1 Node 2 Node 3 • Where is the block and network storage defined? • How can node x reference the related resources?
  • 10. Solution – Resource Scoping Network File Storage Block Storage 1 Block Storage 2 Block Storage 3 Node 1.1 Node 1 Node 2 Node 3 Dedicated Scope - Re-attach on rolling update Global Scope - Tied to group lifecycle
  • 11. Solution – Resource Scoping Network File Storage Block Storage 1 Block Storage 2 Block Storage 3 Node 1.1 Node 1 Node 2 Node 3 Dedicated Scope - Re-attach on rolling update Global Scope - Tied to group lifecycle
  • 12. Resource Scoping - Use @scope resource property - dedicated: Loosely coupled with VM - global: Coupled with the scope (group) { "Allocation": { "LogicalIDs": ["mgr1", "mgr2", "mgr3"] }, "Instance": { "Plugin": "instance-terraform", "Properties": { "resource": { "ibm_compute_vm_instance": { "host": {...} }, "ibm_storage_file": { "my_file_storage": { "@scope": "managers", ... } } "ibm_storage_block": { "my_block_storage": { "@scope": "@dedicated-managers", ... } }, ... $ ls instance-xxx1.tf.json instance-xxx2.tf.json instance-xxx3.tf.json managers_dedicated_mgr1.tf.json managers_dedicated_mgr2.tf.json managers_dedicated_mgr3.tf.json managers_global.tf.json @scope
  • 13. Resource Scoping Reference related resource using terraform interpolation - Predicable “type.name.attribute” path: - Global: - Dedicated quorum: - Dedicated scaler: ${ibm_storage_file.managers-my_file_storage.id} ${ibm_storage_block.workers-{{ var "/self/dedicated/attachId" }}-my_block_storage.id} <resource-type>.<scope>-[<logicalID|index>-]<given-resource-name>.<attribute> [----------------resource-name------------------] ${ibm_storage_block.managers-{{ var "/self/logicalId" }}-my_block_storage.id}
  • 15. Swarm Cluster Bootstrapping Network File Storage Mgr-1 Goals: - Infrakit running on each swarm manager - Shared terraform files on NFS - Self-healing and self-managing with leadership failover Mgr-2 Mgr-3 InfraKit
  • 16. Mgr-1 Bootstrap Flow: 1. Create seed VM in IBM Schematics SeedVM Swarm Cluster Bootstrapping
  • 17. Swarm Cluster Bootstrapping Network File Storage Mgr-1 Bootstrap Flow: 1. Create seed VM in IBM Schematics 2. Mount NFS SeedVM
  • 18. Swarm Cluster Bootstrapping Network File Storage Mgr-1 Bootstrap Flow: 1. Create seed VM in IBM Schematics 2. Mount NFS 3. Import current VM and NFS into TF and create import tf.json files SeedVM InfraKit tf.json
  • 19. Swarm Cluster Bootstrapping Network File Storage Mgr-1 Bootstrap Flow: 1. Create seed VM in IBM Schematics 2. Mount NFS 3. Import current VM and NFS into TF and create import tf.json files 4. Scale out group SeedVM Mgr-2 Mgr-3 InfraKit tf.json
  • 20. Bootstrapping Resources - Define resource(s) in plugin.config file - Imports resources into terraform state - Creates tf.json files "inproc": { "Kind": "terraform", "Options": { "ImportResources": [ { "ResourceType": "ibm_compute_vm_instance", "ResourceID": "<vm-id>" }, { "ResourceType": "ibm_storage_file", "ResourceID": "<file-storage-id>" } ] } } tf.json plugin.config plugin.config
  • 23. Resource Scoping Demo Backup # cat instance-1507834700.tf.json { "resource": { "ibm_compute_vm_instance": { "instance-1507834700": { "cores": "2", "datacenter": "dal10", "memory": "2048", "tags": [ "swarm-id:jwd0s2qozy4re26mbx0zcvj42", "infrakit.attach:workers_dedicated_1 workers_global", "name:instance-1507834700", "infrakit-link:rmncsfzc6l3f23nn", "infrakit-link-context:swarm::jwd0s2qozy4re26mbx0zcvj42::worker", "infrakit-link-created:2017-10-12t18:58:20z", "infrakit.config_sha:s3yqjs7hpijtxue5l2tbudqxq5dgkwhh", "infrakit.group:workers" ], "user_metadata": "echo NFS-ID: ${ibm_storage_file.workers-my_file_storage.id} BS-ID: ${ibm_storage_block.workers-1-my_block_storage.id} ... "
  • 24. Resource Scoping Demo Backup # infrakit group/workers describe ID LOGICAL TAGS instance-1507652020 - infrakit.attach=workers_dedicated_1,workers_global instance-1507652021 - infrakit.attach=workers_dedicated_2,workers_global instance-1507652022 - infrakit.attach=workers_dedicated_3,workers_global # terraform show ibm_compute_vm_instance.instance-1507652020: id = 41638329 tags.1986196614 = infrakit.attach:workers_dedicated_1 workers_global user_metadata = echo NFS-ID: 32062003 BS-ID: 32062011 ibm_compute_vm_instance.instance-1507652021: id = 41639325 tags.1604993140 = infrakit.attach:workers_dedicated_2 workers_global user_metadata = echo NFS-ID: 32062003 BS-ID: 32062595 ibm_compute_vm_instance.instance-1507652022: id = 41640617 tags.4056076773 = infrakit.attach:workers_dedicated_3 workers_global user_metadata = echo NFS-ID: 32062003 BS-ID: 32062597 ibm_storage_block.workers-1-my_block_storage: id = 32062011 ibm_storage_block.workers-2-my_block_storage: id = 32062595 ibm_storage_block.workers-3-my_block_storage: id = 32062597 ibm_storage_file.workers-my_file_storage: id = 32062003