Skip to content

Commit

Permalink
cleanup-bm: run cleanup-images
Browse files Browse the repository at this point in the history
Removing the data directories for the snapshotters isn't quite enough,
we also need to tell containerd to clean up its state.
  • Loading branch information
Freax13 committed Oct 24, 2024
1 parent 9e3102b commit bfb1650
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/cleanup-bm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@ for runtimeClass in "${unusedRuntimeClasses[@]}"; do
dasel delete --file "${CONFIG}" --indent 0 --read toml --write toml "plugins.io\.containerd\.grpc\.v1\.cri.containerd.runtimes.${runtimeClass}" 2>/dev/null
dasel delete --file "${CONFIG}" --indent 0 --read toml --write toml "proxy_plugins.${SNAPSHOTTER}-${runtimeClass}" 2>/dev/null
done

# Fix the state for removed snapshotters.
cleanup-images
3 changes: 3 additions & 0 deletions packages/containers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ let
cleanup-bm = dockerTools.buildImage {
name = "cleanup-bm";
tag = "v0.0.1";
copyToRoot = with pkgs; [
cacert
];
config = {
Cmd = [ "${lib.getExe pkgs.scripts.cleanup-bm}" ];
};
Expand Down
3 changes: 2 additions & 1 deletion packages/scripts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{ pkgs, writeShellApplication }:

{
rec {
create-coco-aks = writeShellApplication {
name = "create-coco-aks";
runtimeInputs = with pkgs; [ azure-cli ];
Expand Down Expand Up @@ -497,6 +497,7 @@
busybox
kubectl
dasel
cleanup-images
];
text = builtins.readFile ./cleanup-bm.sh;
};
Expand Down
6 changes: 6 additions & 0 deletions tools/bm-maintenance/deployment_tdx_snp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ spec:
mountPath: /var/lib/nydus-snapshotter
- name: containerd-config
mountPath: /var/lib/rancher/k3s/agent/etc/containerd
- name: containerd-run
mountPath: /run/k3s/containerd/
volumes:
- name: opt-edgeless
hostPath:
Expand All @@ -75,4 +77,8 @@ spec:
hostPath:
path: /var/lib/rancher/k3s/agent/etc/containerd
type: Directory
- name: containerd-run
hostPath:
path: /run/k3s/containerd/
type: Directory
restartPolicy: OnFailure

0 comments on commit bfb1650

Please sign in to comment.