SlideShare ist ein Scribd-Unternehmen logo
1 von 28
Nomad + Flatcar: a harmonious
marriage of lightweights
Hashitalks 2022 | 2022-02-17
Hi, I'm Iago
Iago López Galeiras
Principal SWE Manager
Microsoft
Github: iaguis
Twitter: iaguis
Email: iagol@microsoft.com
What is Flatcar?
https://flatcar.org
flatcar
noun
/ˈflætkɑr/
a car on a train without a roof or sides,
used for carrying goods
What is Flatcar?
https://flatcar.org
Automated,
streamlined
updates
Easily apply all latest security
patches
Atomic updates and rollbacks
Minimal distribution
for containers
Reduced dependencies
Less base software to manage
Reduced attack surface area
What is a “Container Linux”?
Secure, immutable
file system
Read-only /usr partition
No package installation or
modification of core OS files
Removes entire category of
security threats - e.g. runc
vulnerability CVE-2019-5736*
Declarative
provisioning
First boot setup from declarative
configuration
Immutable infrastructure (no
custom per-node changes
during production)
Repeatable deployment
Operational simplicity for security and management at scale
*kinvolk.io/blog/2019/02/runc-breakout-vulnerability-mitigated-on-flatcar-linux
runc "breakout" vulnerability mitigated
kinvolk.io/blog/2019/02/runc-breakout-vulnerability-mitigated-on-flatcar-linux
Flatcar Heritage
minimal
set of
packages
update
mechanism
container
optimizatio
n
Gentoo ChromeOS
CoreOS Container Linux
Flatcar Container Linux
Flatcar Distribution
❏ Four channels:
❏ Alpha → Beta → Stable
❏ LTS
❏ Publicly available
❏ Images on AWS, Azure, Packet, GCE, …
❏ https://<channel>.release.flatcar-linux.net
❏ Update server
❏ Public: public.update.flatcar-linux.net
❏ Nebraska
How Flatcar fits Nomad nicely
❏ Both emphasize simplicity
❏ Containers
❏ Forget about your OS
❏ Always updated
❏ Latest security fixes applied automatically
❏ Repeatable deployments
How is Flatcar configured
Ignition Config
❏ JSON format
❏ Declaration of files, systemd units, networks, users,
filesystems, and partitions
❏ Referencing data from external resources
❏ Applied from initramfs (first-boot flag file for GRUB
sets kernel parameter)
❏ Contrast to cloud-init which runs after the
initramfs, and on every boot
Container Linux Config (CLC)
❏ Friendlier YAML format with extras (octal
permissions, variables for metadata)
❏ Transpiled to Ignition JSON through transpiler “ct”
cat cl.yaml | docker run --rm -i quay.io/coreos/ct:latest-dev > ignition.json
./flatcar_production_qemu.sh -i ignition.json
❏ Spec: flatcar.org/docs/latest/provisioning/config-transpiler/configuration/
Container Linux Config (CLC)
Container Linux Config Example
storage:
files:
- path: /etc/some.conf
filesystem: root
mode: 0644
contents:
inline: |
A=a
B=b
Or with remote instead of 'inline' content:
remote:
url: …
"Installing" Nomad on Flatcar
❏ No package manager
❏ No official container
❏ And running the Nomad agent on a container is not supported
❏ Immutable infrastructure
❏ Use ignition to deploy and extract binaries
"Installing" Nomad on Flatcar
...
files:
- path: /opt/bin/nomad_1.2.6_linux_amd64.zip
filesystem: root
mode: 0644
contents:
remote:
url: https://releases.hashicorp.com/nomad/1.2.6/nomad_1.2.6_linux_amd64.zip
verification:
hash:
function: sha512
sum: c134198bd79b1e0c98d12262a7450cd0eee941f70118cfd196955f064073d312e395585a034d5ce32aa4c4763cb5a20a75d6764
07347f1ee515865f8d206cab5
...
"Installing" Nomad on Flatcar
...
systemd:
units:
- name: "prepare-nomad-binary.service"
enabled: true
contents: |
[Unit]
Description=Unpack Nomad binary to /opt/bin
ConditionPathExists=!/opt/bin/nomad
[Service]
Type=oneshot
Restart=on-failure
RemainAfterExit=yes
Environment=NOMAD_VERSION=1.2.6
ExecStart=/usr/bin/unzip "/opt/bin/nomad_${NOMAD_VERSION}_linux_amd64.zip" -d /opt/bin
ExecStart=/usr/bin/rm "/opt/bin/nomad_${NOMAD_VERSION}_linux_amd64.zip"
[Install]
WantedBy=multi-user.target
...
"Installing" Nomad on Flatcar
❏ That's pretty much it
What's missing?
Missing piece: update orchestration
❏ Ideally you want to orchestrate updates
❏ So you don't end up with all your nodes updating at the same time
❏ You can accomplish this with Locksmith
Flatcar Update Process (without Kubernetes)
Partition
B
Partition
A
update_
engine
service
Update
Server
1
Check for
updates
2 Download new
image
locksmith
service
5 Boot with
partition B
Flatcar Node
❏ Based on Google Omaha protocol (from ChromeOS)
❏ Dual immutable partitions enable atomic updates and easy rollback
❏ User control over updates 📖https://docs.flatcar-linux.org/os/update-strategies/
etcd
3
Check
for
lock
4 Lock
availabl
e
Missing piece: update orchestration
❏ Ideally you want to orchestrate updates
❏ So you don't end up with all your nodes updating at the same time
❏ You can accomplish this with Locksmith
❏ Even better, you want your workloads to be moved to other
nodes while you're updating
❏ On Kubernetes this is done with FLUO (Flatcar Linux Update Operator)
Flatcar
update
operator
Flatcar Update Process (with Kubernetes)
Partition
B
Partition
A
update_
engine
service
Update
Server
1 Check for
updates
2 Download new
image
7 Boot with
partition B
Flatcar Node
flatcar
update
agent
4 Drain
node 3 Set reboot-
needed
annotation
5
Set reboot-
ok
annotation
6
Send
reboot
signal
Missing piece: update orchestration
❏ Ideally you want to orchestrate updates
❏ So you don't end up with all your nodes updating at the same time
❏ You can accomplish this with Locksmith
❏ Even better, you want your workloads to be moved to other
nodes while you're updating
❏ On Kubernetes this is accomplished with FLUO (Flatcar Linux Update Operator)
❏ It would be great to have something similar for Nomad
DEMO
https://github.com/kinvolk/nomad-on-flatcar
Appendix
❏ Flatcar docs
❏ https://www.flatcar.org/docs/latest/
❏ Using Flatcar with Terraform
❏ Flatcar Terraform examples: https://github.com/flatcar-linux/flatcar-terraform
❏ "Immutable Infrastructure with Flatcar Container Linux"
talk: https://fosdem.org/2022/schedule/event/flatcar_container_linux/
Thank you!

Weitere ähnliche Inhalte

Was ist angesagt?

What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
Simplilearn
 

Was ist angesagt? (20)

Getting Started with Kubernetes
Getting Started with Kubernetes Getting Started with Kubernetes
Getting Started with Kubernetes
 
Terraform
TerraformTerraform
Terraform
 
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
 
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
 
Terraform Basics
Terraform BasicsTerraform Basics
Terraform Basics
 
Kubernetes Deployment Strategies
Kubernetes Deployment StrategiesKubernetes Deployment Strategies
Kubernetes Deployment Strategies
 
Final terraform
Final terraformFinal terraform
Final terraform
 
Helm - Application deployment management for Kubernetes
Helm - Application deployment management for KubernetesHelm - Application deployment management for Kubernetes
Helm - Application deployment management for Kubernetes
 
Terraform
TerraformTerraform
Terraform
 
Prometheus - basics
Prometheus - basicsPrometheus - basics
Prometheus - basics
 
Terraform
TerraformTerraform
Terraform
 
infrastructure as code
infrastructure as codeinfrastructure as code
infrastructure as code
 
Azure kubernetes service (aks)
Azure kubernetes service (aks)Azure kubernetes service (aks)
Azure kubernetes service (aks)
 
OpenShift 4 installation
OpenShift 4 installationOpenShift 4 installation
OpenShift 4 installation
 
Introduction To Terraform
Introduction To TerraformIntroduction To Terraform
Introduction To Terraform
 
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
 
Terraform introduction
Terraform introductionTerraform introduction
Terraform introduction
 
Monitoring Kubernetes with Prometheus
Monitoring Kubernetes with PrometheusMonitoring Kubernetes with Prometheus
Monitoring Kubernetes with Prometheus
 
Kubernetes Monitoring & Best Practices
Kubernetes Monitoring & Best PracticesKubernetes Monitoring & Best Practices
Kubernetes Monitoring & Best Practices
 
Building CI/CD Pipelines with Jenkins and Kubernetes
Building CI/CD Pipelines with Jenkins and KubernetesBuilding CI/CD Pipelines with Jenkins and Kubernetes
Building CI/CD Pipelines with Jenkins and Kubernetes
 

Ähnlich wie Nomad + Flatcar: a harmonious marriage of lightweights

Automate drupal deployments with linux containers, docker and vagrant
Automate drupal deployments with linux containers, docker and vagrant Automate drupal deployments with linux containers, docker and vagrant
Automate drupal deployments with linux containers, docker and vagrant
Ricardo Amaro
 
Drupalcamp es 2013 drupal with lxc docker and vagrant
Drupalcamp es 2013  drupal with lxc docker and vagrant Drupalcamp es 2013  drupal with lxc docker and vagrant
Drupalcamp es 2013 drupal with lxc docker and vagrant
Ricardo Amaro
 

Ähnlich wie Nomad + Flatcar: a harmonious marriage of lightweights (20)

Automate drupal deployments with linux containers, docker and vagrant
Automate drupal deployments with linux containers, docker and vagrant Automate drupal deployments with linux containers, docker and vagrant
Automate drupal deployments with linux containers, docker and vagrant
 
Drupalcamp es 2013 drupal with lxc docker and vagrant
Drupalcamp es 2013  drupal with lxc docker and vagrant Drupalcamp es 2013  drupal with lxc docker and vagrant
Drupalcamp es 2013 drupal with lxc docker and vagrant
 
Security of Linux containers in the cloud
Security of Linux containers in the cloudSecurity of Linux containers in the cloud
Security of Linux containers in the cloud
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned
 
OpenShift_Installation_Deep_Dive_Robert_Bohne.pdf
OpenShift_Installation_Deep_Dive_Robert_Bohne.pdfOpenShift_Installation_Deep_Dive_Robert_Bohne.pdf
OpenShift_Installation_Deep_Dive_Robert_Bohne.pdf
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetes
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
CoreOS @Codetalks Hamburg
CoreOS @Codetalks HamburgCoreOS @Codetalks Hamburg
CoreOS @Codetalks Hamburg
 
Introduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group CologneIntroduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group Cologne
 
Zombies in Kubernetes
Zombies in KubernetesZombies in Kubernetes
Zombies in Kubernetes
 
Magento Docker Setup.pdf
Magento Docker Setup.pdfMagento Docker Setup.pdf
Magento Docker Setup.pdf
 
Docker linuxday 2015
Docker linuxday 2015Docker linuxday 2015
Docker linuxday 2015
 
Scaling docker with kubernetes
Scaling docker with kubernetesScaling docker with kubernetes
Scaling docker with kubernetes
 
Digital Forensics and Incident Response in The Cloud Part 3
Digital Forensics and Incident Response in The Cloud Part 3Digital Forensics and Incident Response in The Cloud Part 3
Digital Forensics and Incident Response in The Cloud Part 3
 
Autopilot : Securing Cloud Native Storage
Autopilot : Securing Cloud Native StorageAutopilot : Securing Cloud Native Storage
Autopilot : Securing Cloud Native Storage
 
Develop QNAP NAS App by Docker
Develop QNAP NAS App by DockerDevelop QNAP NAS App by Docker
Develop QNAP NAS App by Docker
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
 
VASCAN - Docker and Security
VASCAN - Docker and SecurityVASCAN - Docker and Security
VASCAN - Docker and Security
 
Dev opsec dockerimage_patch_n_lifecyclemanagement_2019
Dev opsec dockerimage_patch_n_lifecyclemanagement_2019Dev opsec dockerimage_patch_n_lifecyclemanagement_2019
Dev opsec dockerimage_patch_n_lifecyclemanagement_2019
 
Techtalks: taking docker to production
Techtalks: taking docker to productionTechtalks: taking docker to production
Techtalks: taking docker to production
 

Kürzlich hochgeladen

Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Kürzlich hochgeladen (20)

Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 

Nomad + Flatcar: a harmonious marriage of lightweights

  • 1. Nomad + Flatcar: a harmonious marriage of lightweights Hashitalks 2022 | 2022-02-17
  • 2. Hi, I'm Iago Iago López Galeiras Principal SWE Manager Microsoft Github: iaguis Twitter: iaguis Email: iagol@microsoft.com
  • 4. flatcar noun /ˈflætkɑr/ a car on a train without a roof or sides, used for carrying goods
  • 6. Automated, streamlined updates Easily apply all latest security patches Atomic updates and rollbacks Minimal distribution for containers Reduced dependencies Less base software to manage Reduced attack surface area What is a “Container Linux”? Secure, immutable file system Read-only /usr partition No package installation or modification of core OS files Removes entire category of security threats - e.g. runc vulnerability CVE-2019-5736* Declarative provisioning First boot setup from declarative configuration Immutable infrastructure (no custom per-node changes during production) Repeatable deployment Operational simplicity for security and management at scale *kinvolk.io/blog/2019/02/runc-breakout-vulnerability-mitigated-on-flatcar-linux
  • 7. runc "breakout" vulnerability mitigated kinvolk.io/blog/2019/02/runc-breakout-vulnerability-mitigated-on-flatcar-linux
  • 9. Flatcar Distribution ❏ Four channels: ❏ Alpha → Beta → Stable ❏ LTS ❏ Publicly available ❏ Images on AWS, Azure, Packet, GCE, … ❏ https://<channel>.release.flatcar-linux.net ❏ Update server ❏ Public: public.update.flatcar-linux.net ❏ Nebraska
  • 10. How Flatcar fits Nomad nicely ❏ Both emphasize simplicity ❏ Containers ❏ Forget about your OS ❏ Always updated ❏ Latest security fixes applied automatically ❏ Repeatable deployments
  • 11. How is Flatcar configured
  • 12. Ignition Config ❏ JSON format ❏ Declaration of files, systemd units, networks, users, filesystems, and partitions ❏ Referencing data from external resources ❏ Applied from initramfs (first-boot flag file for GRUB sets kernel parameter) ❏ Contrast to cloud-init which runs after the initramfs, and on every boot
  • 13. Container Linux Config (CLC) ❏ Friendlier YAML format with extras (octal permissions, variables for metadata) ❏ Transpiled to Ignition JSON through transpiler “ct” cat cl.yaml | docker run --rm -i quay.io/coreos/ct:latest-dev > ignition.json ./flatcar_production_qemu.sh -i ignition.json ❏ Spec: flatcar.org/docs/latest/provisioning/config-transpiler/configuration/
  • 15. Container Linux Config Example storage: files: - path: /etc/some.conf filesystem: root mode: 0644 contents: inline: | A=a B=b Or with remote instead of 'inline' content: remote: url: …
  • 16. "Installing" Nomad on Flatcar ❏ No package manager ❏ No official container ❏ And running the Nomad agent on a container is not supported ❏ Immutable infrastructure ❏ Use ignition to deploy and extract binaries
  • 17. "Installing" Nomad on Flatcar ... files: - path: /opt/bin/nomad_1.2.6_linux_amd64.zip filesystem: root mode: 0644 contents: remote: url: https://releases.hashicorp.com/nomad/1.2.6/nomad_1.2.6_linux_amd64.zip verification: hash: function: sha512 sum: c134198bd79b1e0c98d12262a7450cd0eee941f70118cfd196955f064073d312e395585a034d5ce32aa4c4763cb5a20a75d6764 07347f1ee515865f8d206cab5 ...
  • 18. "Installing" Nomad on Flatcar ... systemd: units: - name: "prepare-nomad-binary.service" enabled: true contents: | [Unit] Description=Unpack Nomad binary to /opt/bin ConditionPathExists=!/opt/bin/nomad [Service] Type=oneshot Restart=on-failure RemainAfterExit=yes Environment=NOMAD_VERSION=1.2.6 ExecStart=/usr/bin/unzip "/opt/bin/nomad_${NOMAD_VERSION}_linux_amd64.zip" -d /opt/bin ExecStart=/usr/bin/rm "/opt/bin/nomad_${NOMAD_VERSION}_linux_amd64.zip" [Install] WantedBy=multi-user.target ...
  • 19. "Installing" Nomad on Flatcar ❏ That's pretty much it
  • 21. Missing piece: update orchestration ❏ Ideally you want to orchestrate updates ❏ So you don't end up with all your nodes updating at the same time ❏ You can accomplish this with Locksmith
  • 22. Flatcar Update Process (without Kubernetes) Partition B Partition A update_ engine service Update Server 1 Check for updates 2 Download new image locksmith service 5 Boot with partition B Flatcar Node ❏ Based on Google Omaha protocol (from ChromeOS) ❏ Dual immutable partitions enable atomic updates and easy rollback ❏ User control over updates 📖https://docs.flatcar-linux.org/os/update-strategies/ etcd 3 Check for lock 4 Lock availabl e
  • 23. Missing piece: update orchestration ❏ Ideally you want to orchestrate updates ❏ So you don't end up with all your nodes updating at the same time ❏ You can accomplish this with Locksmith ❏ Even better, you want your workloads to be moved to other nodes while you're updating ❏ On Kubernetes this is done with FLUO (Flatcar Linux Update Operator)
  • 24. Flatcar update operator Flatcar Update Process (with Kubernetes) Partition B Partition A update_ engine service Update Server 1 Check for updates 2 Download new image 7 Boot with partition B Flatcar Node flatcar update agent 4 Drain node 3 Set reboot- needed annotation 5 Set reboot- ok annotation 6 Send reboot signal
  • 25. Missing piece: update orchestration ❏ Ideally you want to orchestrate updates ❏ So you don't end up with all your nodes updating at the same time ❏ You can accomplish this with Locksmith ❏ Even better, you want your workloads to be moved to other nodes while you're updating ❏ On Kubernetes this is accomplished with FLUO (Flatcar Linux Update Operator) ❏ It would be great to have something similar for Nomad
  • 27. Appendix ❏ Flatcar docs ❏ https://www.flatcar.org/docs/latest/ ❏ Using Flatcar with Terraform ❏ Flatcar Terraform examples: https://github.com/flatcar-linux/flatcar-terraform ❏ "Immutable Infrastructure with Flatcar Container Linux" talk: https://fosdem.org/2022/schedule/event/flatcar_container_linux/

Hinweis der Redaktion

  1. Speaker introduction page
  2. Sub-title with content
  3. New section page
  4. Sub-title with content
  5. Sub-title with content
  6. Sub-title with content
  7. Sub-title with content
  8. Sub-title with content
  9. Sub-title with content
  10. Sub-title with content
  11. Sub-title with content
  12. New section page
  13. Sub-title with content
  14. Sub-title with content
  15. Sub-title with content
  16. New section page
  17. Sub-title with content
  18. New section page