## Image Cleaner DaemonSet Documentation ### Key Features/Components- Runs as a DaemonSet to ensure one instance per node- Utilizes Kubernetes downward API for node-specific configurations- Periodically scans and cleans up unused Docker images- Configurable thresholds for image age and disk usage ### Step-by-step instructions or configuration details1. Create a Kubernetes ConfigMap with the necessary configurations:```yamlapiVersion: v1kind: ConfigMapmetadata: name: image-cleaner-configdata: imageAgeThreshold: "30" # Age of images in days before cleanup diskUsageThreshold: "80" # Disk usage percentage before cleanup
apiVersion: apps/v1kind: DaemonSetmetadata: name: image-cleanerspec: selector: matchLabels: app: image-cleaner template: metadata: labels: app: image-cleaner spec: containers: - name: image-cleaner image: image-cleaner:latest volumeMounts: - name: config mountPath: /config volumes: - name: config configMap: name: image-cleaner-config defaultMode: 420
kubectl logs -n <namespace> <image-cleaner-pod-name>