Git Product home page Git Product logo

ignite.chef's People

Contributors

bbros-dev avatar dependabot[bot] avatar taqtiqa-admin avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

ignite.chef's Issues

Feature: ignite_clean & ignite_clean_cni resources

Add resources:

  1. ignite_clean: Kill all running Firecracker micro-VM's and clean all VM images.
  2. ignite_clean_cni: Remove all CNI network settings.

Use case:
These resources can be run before the install recipes when the host machine is not a pristine environment. Example, developer laptop and desktop machines.

These are based on the scripts posted by @stealthybox here on Slack.

For posterity the scripts are:

~/Repos/ignite-scratch
❯ cat ignite-clean.sh
#!/usr/bin/env bash
set -x
set -o pipefailignite="${ignite:-"sudo ./bin/ignite"}"
docker="${docker:-"docker"}"
ctr="${ctr:-"sudo ctr"}"
iptables="${iptables:-"sudo iptables"}"${ignite} vm ls -q | xargs -n1 ${ignite} vm rm -f${docker} ps | grep ignite- | awk '{print $1}' | xargs ${docker} rm -f
# stop containerd tasks
    sudo pkill -9 firecracker
    # sudo pkill -9 containerd-shim;  # harms other containers
${ctr} -n firecracker c ls -q | xargs ${ctr} -n firecracker c delete${ignite} vm ls -q | xargs -n1 ${ignite} vm rm -f
sudo dmsetup remove_all${iptables} -S -t nat \
  | grep ignite \
  | sed "s/^-A/${iptables} -t nat -D/" \
  | bash -x
sudo rm /etc/cni/net.d/10-ignite.conflist
sudo ifconfig cni0 down
sudo ip link delete cni0
sudo ifconfig ignite0 down
sudo ip link delete ignite0

and

~/Repos/ignite-scratch
❯ cat iptables-clean-cni-ignite.sh
#!/usr/bin/env bash
set -o pipefailiptables="${iptables:-"sudo iptables"}"for t in filter nat mangle raw security; do
    echo "# $t"
    $iptables -S -t "$t" \
        | grep -i -E 'cni|ignite|10\.42\.0|172\.18\.0' \
        | tac \
        | sed "s/^-N/$iptables -t $t -X/" \
        | sed "s/^-A/$iptables -t $t -D/" \
        | bash -x
done

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.