Automating Linux container maintenance

I was a big fan of the LxdMosaic for several reasons. Mostly because of the graphical interface, but several other nice features was available to me. To list a few:

  • Statistics.
  • Graphs of resource consumptions.
  • Automation of commands on every single individual, a range of, or all of, instances.

After canonicals decision to sorely abandon LXD completely and instead introduce incus as the abstraction layer over virtualization on the Ubuntu and Debian distros, the LxdMosaic is now none functional. The first and biggest pain point in this turn of event, is the ability to automate patching of all the instances. The solution was not that hard to make, so I shares my basic solution here. Bear in mind that this is crude and I strongly advises everyone to tailor this to their own specific needs...!

#!/bin/bash

declare -a myArr

myremotes=( $(sudo incus remote list -c n -f csv | grep -v "images") )
for a in "${myremotes[@]}"
do
if [ $a != '(current)' ]
then
myarray=( $(incus list $a: -c n -f csv) )
for i in "${myarray[@]}"
do      
echo "" 
echo "Updating: $i of $a"
echo "-----------------"
eval incus exec $a:$i -- /root/update.sh
echo "*****************"
done
fi
done
        

The above expects to find a local script - update.sh - on each instance. This provides a lot of flexibility as you can tailor update and upgrade procedures specifically for each individual instance if needs be.

To break it down:

  1. Find all remote clients (the local client, hence the localhost incus deamon, is listed as a remote client so we shamefully take advantage of this so we can also maintain any local instances)
  2. On each remote client, then for each instance, run the updater script.


Hope someone can make a litte bit use of this.


要查看或添加评论,请登录

Kevin Kruse的更多文章

  • From Complexity to Clarity - Principle-Based Governance and the Role of Local AI

    From Complexity to Clarity - Principle-Based Governance and the Role of Local AI

    In a world of increasing complexity, where AI and automation drive continuous change, organizations face a critical…

    13 条评论
  • The missing compliance logic in all IGA products

    The missing compliance logic in all IGA products

    So I claims that basically all IGA products has a missing feature or governance use case, but that requires me to…

    6 条评论
  • Event driven user updates in Saviynt

    Event driven user updates in Saviynt

    I promised you this one. So I will delve directly into it.

    3 条评论
  • Analytics driven Identity Governance Administration

    Analytics driven Identity Governance Administration

    As promised, hereby a practical example of how we have engaged the subject of implementing Identity Governance…

    1 条评论
  • Data driven Approach to IGA

    Data driven Approach to IGA

    Introduction: Navigating the Landscape of Identity Governance Administration (IGA) In the intricate tapestry of modern…

  • Perfect IGA architecture - continued

    Perfect IGA architecture - continued

    Continuing on my previous short story: In very low practical terms, I will here follow an import of Identity data from…

  • Forget DynDNS

    Forget DynDNS

    After starting to use desec - which has an API for managing you DNS settings - I have found that to be much more…

  • OpenZFS is the king

    OpenZFS is the king

    Many chapters has been written, still open and closed in regards to Oracle. Many Open Source projects has been taken…

    1 条评论
  • My take on the perfect IGA product

    My take on the perfect IGA product

    Disclaimer: Use any op the pictures or text in this post freely as long as you credits the author. Previously I have…

  • Identity Governance Administration. Done right.

    Identity Governance Administration. Done right.

    I am a keynote speaker on conferences and events in regards to Identity Management. What I presents is my take on…

    1 条评论

社区洞察