Successfully reported this slideshow.
Your SlideShare is downloading. ×

Why you should revisit mgmt

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Loading in …3
×

Check these out next

1 of 46 Ad
Advertisement

More Related Content

More from Julien Pivotto (20)

Recently uploaded (20)

Advertisement

Why you should revisit mgmt

  1. 1. CfgMgmtCamp Ghent Julien Pivotto @roidelapluie Why you should revisit mgmt February 04 2020
  2. 2. CfgMgmtCamp Ghent Julien Pivotto @roidelapluie alt title: mgmt without reworks February 04 2020
  3. 3. simpli ed de nition Bring the system to a certain state. Change the state of a system. Con guration Management @roidelapluie
  4. 4. • You know the desired state. • You know what you want to do. How to achieve it @roidelapluie
  5. 5. • You know the desired state: Puppet / Terraform. • You know what you want to do: Chef / Ansible / Pulumi. Tooling @roidelapluie
  6. 6. Changing the desired state is still hard in some cases. Takes time and refactoring. but ... @roidelapluie
  7. 7. Some changes are not desired. Or not anticipated. And you don't know the desire state. changes @roidelapluie
  8. 8. ? Tooling @roidelapluie
  9. 9. mgmt @roidelapluie
  10. 10. but what is mgmt? @roidelapluie
  11. 11. generalities... • Open Source (GPLv3) • Initial commit in 2015 • Con g Management Tool • Golang mgmt @roidelapluie
  12. 12. • Events • Graphes • Vertex • Language • DSL • Resources You name it, you have it. Buzzwords @roidelapluie
  13. 13. Event-Based @roidelapluie
  14. 14. Changes in the infrastructure or in the applications • Adding a new server • Removing a le Events @roidelapluie
  15. 15. Changes outside of the infrastructure • External connectivity is not working • Package updates are available • More tra c on the platform Events @roidelapluie
  16. 16. • Add a new server: register in DNS, Quorum, Frontend • Time: Enable / Disable services • Updates: roll the updates, ensure your con g is still there What would you do @roidelapluie
  17. 17. import "prometheus" import "datetime" $now = datetime.now() $v = prometheus.instant_query_value( "sum(rate(http_requests[5m]))", $now ) if $v > 300 { cron "batch_job" { ensure => "absent", } } Reaction on events @roidelapluie
  18. 18. Desired state @roidelapluie
  19. 19. • mgmt runs as a daemon • The desire state is "compiled" • Takes the current state as input • Recalculated on events What do you know in advance? @roidelapluie
  20. 20. Computing a desire state based on facts and events vs Writing a new desire state on each change vs Running commands to x the state and nishing in an unknown state Evolution @roidelapluie
  21. 21. Batteries included @roidelapluie
  22. 22. PCS @roidelapluie © 2011 Puppet Labs
  23. 23. • package • le • service pkg "cowsay" { state => "installed", } Resources @roidelapluie
  24. 24. • net interface • mountpoint • timer mount "/mnt/foo" { state => "exists", device => "/dev/sdb1", type => "ext4", } Resources @roidelapluie
  25. 25. • exec • users • group Resources @roidelapluie
  26. 26. • augeas • consul:kv Resources @roidelapluie
  27. 27. • container • vm • ec2 aws:ec2 "ec2example" { state => running, region => "ca-central-1", type => "t2.micro", imageid => "ami-5ac17f3e", } Resources @roidelapluie
  28. 28. • time • le • cpucount • uptime External events @roidelapluie
  29. 29. In addition to that, each resource has its own events. And will ensure its own state. Resources events @roidelapluie
  30. 30. Improving our work @roidelapluie
  31. 31. Traditional dependency management: • Explicitly de ned dependencies: takes time before applying the state • Ordered tasks: takes time while applying the state Machines should help humans @roidelapluie
  32. 32. • A package contains les • A cron job uses a command Machine knows.. @roidelapluie
  33. 33. $ rpm -ql bash /etc/skel/.bash_logout /etc/skel/.bash_profile /etc/skel/.bashrc /usr/bin/alias /usr/bin/bash /usr/bin/bashbug /usr/bin/bashbug-64 /usr/bin/bg /usr/bin/cd /usr/bin/command @roidelapluie
  34. 34. If a cron job requires a command that will be installed by a package, install the package rst. Why should I tell the machine? Auto-Edges @roidelapluie
  35. 35. If I need to install 10 packages, install them in one go. Why should I tell the machine? dnf install python3 httpd mysqld Auto-Grouping @roidelapluie
  36. 36. The language @roidelapluie
  37. 37. How would you implement events in an existing language? Hard to reuse a programming language as we can't support all its features. and don't want to. mgmt is close to a "functional" language. mgmt language @roidelapluie
  38. 38. cron "purpleidea-oneshot" { session => true, trigger => "OnCalendar", time => "*:*:0", } svc "purpleidea-oneshot" { state => "stopped", } mgmtlang example @roidelapluie
  39. 39. import "fmt" import "example" print "answer" { msg => fmt.printf( "the answer to life, the universe, and everyt example.answer()), } mgmtlang example @roidelapluie
  40. 40. Monitoring @roidelapluie
  41. 41. • What is the state of my infra? • How much do I need to adapt its state? • What are the changes? Prometheus enabled @roidelapluie
  42. 42. Why this talk? @roidelapluie
  43. 43. • You have probably seen only parts of it • You only remember the reworks • Presented early ; much has changed now. You probably don't know mgmt @roidelapluie
  44. 44. • Quick and e cient • Does a lot of work for us • Maintains a desired state over (real) time mgmt solves problems elegantly @roidelapluie
  45. 45. https://github.com/purpleidea/mgmt Discover it! @roidelapluie
  46. 46. Julien Pivotto @roidelapluie roidelapluie@inuits.eu Essensteenweg 31 2930 Brasschaat Belgium Contact: info@inuits.eu +32-3-8082105

×