elastisys / compliantkubernetes-kubespray

Apache License 2.0
28 stars 7 forks source link

Docker prune playbook no longer works #306

Closed anders-elastisys closed 1 year ago

anders-elastisys commented 1 year ago

Describe the bug The prune-docker script and playbook does not work in newer CK8s clusters as docker has been replaced with containerd.

To Reproduce Steps to reproduce the behavior:

  1. Have a CK8s cluster that has containerd as its container runtime (no docker)
  2. Run the prune-docker playbook:
    ./bin/ck8s-kubespray prune-docker wc
  3. See that prune task fails: Output:
    TASK [Docker prune unused images, containers, networks etc.] 
    ***********************************************************************************
    fatal: [wc-master-1]: FAILED! => {"changed": false, "cmd": "docker volume prune --filter --all=1 '&&' docker system prune", "msg": " 
    [Errno 2] No such file or directory: b'docker'", "rc": 2, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

Expected behavior Should be able to run a playbook that prunes container images etc, e.g. with containerd we can instead run crictl rmi --prune.

Screenshots If applicable, add screenshots to help explain your problem.

Version (add all relevant versions):

Additional context Add any other context about the problem here.