From 21ad34f38e4887f1d9d05a375437f1fdfbcdafe6 Mon Sep 17 00:00:00 2001 From: Arnaud M Date: Sat, 4 Mar 2023 22:41:16 +0100 Subject: [PATCH] up Signed-off-by: Arnaud M --- docker/training/lessons/1-docker101.md | 2 +- userdata/README.md | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/docker/training/lessons/1-docker101.md b/docker/training/lessons/1-docker101.md index 99c3d49..fa400c4 100644 --- a/docker/training/lessons/1-docker101.md +++ b/docker/training/lessons/1-docker101.md @@ -35,7 +35,7 @@ docker run debian Wait, nothing happened! Is that a bug? Well, no. Behind the scenes, a lot of stuff happened. -When you call `run`, the Docker client finds the image (busybox in this case), loads up the container and then runs a command in that container. +When you call `run`, the Docker client finds the image (`debian` in this case), loads up the container and then runs a command in that container. When we run `docker run debian`, we didn't provide any command, so the container booted up, ran an empty command and then exited. Well, yeah - kind of a bummer. Let's try something more exciting. diff --git a/userdata/README.md b/userdata/README.md index f19b6b7..ecd8b1a 100644 --- a/userdata/README.md +++ b/userdata/README.md @@ -4,6 +4,18 @@ openstack server create --user-data isen-postinstall.sh --min 20 --max 20 --flav # Then copy/paste openrc files into the servers so that students can do # source /root/openrc -# Clean the project: -openstack keypair list -f value -c Name | xargs openstack keypair delete - +# Clean the project, from k8s-1 +for o in $(ls -1 openrc_is*) ; do + source $o + openstack keypair list -f value -c Name | xargs openstack keypair delete + openstack security group rule list -c ID -f value | xargs openstack security group rule delete + openstack security group rule create --egress default + openstack floating ip list -c ID -f value | xargs openstack floating ip delete + for router in $(openstack router list -c ID -f value); do + for subnet in $(openstack router show -c interfaces_info $router -f json | jq -r ".interfaces_info[].subnet_id" | uniq) ; do + openstack router remove subnet $router $subnet + done + openstack router delete $router + done + openstack network list --internal -f value -c ID | xargs openstack network delete +done