Five Key Features of Portainer
Five Key Features of Portainer 1. Docker Environments 2. Access Control 3. CI/CD Capabilities 4. …
Operating your apps in Kubernetes is a breeze with ayedo. However, sometimes the built-in tools aren’t enough to ensure the smooth operation of your applications. In this article, we introduce a handy little life hack related to terminating pods. Don’t have a Kubernetes cluster yet?
With ayedo Fleet, you can test Kubernetes for 30 days free of operational headaches. Give it a try.

The CronJob:
apiVersion: batch/v1
kind: CronJob
metadata:
name: garbage-collector-cronjob
namespace: kube-system
spec:
schedule: '*/1 * * * *'
concurrencyPolicy: Forbid
suspend: false
jobTemplate:
metadata:
creationTimestamp: null
spec:
parallelism: 1
completions: 1
backoffLimit: 0
template:
metadata:
creationTimestamp: null
spec:
volumes:
- name: scripts
configMap:
name: garbage-collector-cm
defaultMode: 320
containers:
- name: garbage-collector
image: alpine/k8s:1.25.12
command:
- /scripts/remove-evicted-pods-all-ns.sh
resources: {}
volumeMounts:
- name: scripts
mountPath: /scripts
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
imagePullPolicy: IfNotPresent
restartPolicy: Never
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
securityContext: {}
schedulerName: default-scheduler
And the corresponding ConfigMap:
#!/bin/bash
namespace=""
node=$(kubectl get node | grep "worker" | grep "NotReady" | awk '{print $1}')
for pod in $(kubectl get pods -A -o=JSON --field-selector spec.nodeName=${node} | jq -r '.items[] |
select(.metadata.namespace | startswith("${namespace}")) | .metadata.name') ; do
namespace=$(kubectl get pods -A -o=JSON --field-selector metadata.name=${pod}| jq -r ' .items[] .metadata.namespace')
echo "Killing pod ${namespace}/${pod}"
kubectl delete pod -n ${namespace} --force ${pod}
done
Five Key Features of Portainer 1. Docker Environments 2. Access Control 3. CI/CD Capabilities 4. …
The release of Kubernetes 1.29 introduces an exciting new feature: an alpha capability that allows …
In a complex IT landscape, monitoring and understanding application performance can become a real …