This guide assumes you have a Reaper-enabled cluster (see Installation).
The simplest way to run a command on the host is with a ReaperPod:
apiVersion: reaper.io/v1alpha1
kind: ReaperPod
metadata:
name: my-task
spec:
command: ["/bin/sh", "-c", "echo Hello from $(hostname) && uname -a"]kubectl apply -f my-task.yaml
kubectl logs my-task
kubectl get reaperpodsapiVersion: reaper.io/v1alpha1
kind: ReaperPod
metadata:
name: config-reader
spec:
command: ["/bin/sh", "-c", "cat /config/settings.yaml"]
volumes:
- name: config
mountPath: /config
configMap: "my-config"
readOnly: trueapiVersion: reaper.io/v1alpha1
kind: ReaperPod
metadata:
name: compute-task
spec:
command: ["/bin/sh", "-c", "echo Running on $(hostname)"]
nodeSelector:
workload-type: computeSee ReaperPod CRD Reference for the full spec.
For use cases that need the full Kubernetes Pod API — interactive sessions, DaemonSets, Deployments, exec, etc. — you can use standard Pods with runtimeClassName: reaper-v2.
Note: The
imagefield is required by Kubernetes but ignored by Reaper. Use a small image likebusybox.
apiVersion: v1
kind: Pod
metadata:
name: my-task
spec:
runtimeClassName: reaper-v2
restartPolicy: Never
containers:
- name: task
image: busybox
command: ["/bin/sh", "-c"]
args: ["echo Hello from host && uname -a"]kubectl apply -f my-task.yaml
kubectl logs my-task # See output
kubectl get pod my-task # Status: Completedkubectl run -it debug --rm --image=busybox --restart=Never \
--overrides='{"spec":{"runtimeClassName":"reaper-v2"}}' \
-- /bin/bashkubectl exec -it my-pod -- /bin/shConfigMaps, Secrets, hostPath, emptyDir, and projected volumes all work:
apiVersion: v1
kind: Pod
metadata:
name: my-task
spec:
runtimeClassName: reaper-v2
restartPolicy: Never
volumes:
- name: config
configMap:
name: my-config
containers:
- name: task
image: busybox
command: ["/bin/sh", "-c", "cat /config/settings.yaml"]
volumeMounts:
- name: config
mountPath: /config
readOnly: trueSee Pod Compatibility for the full list of supported and ignored fields.
Reaper provides Custom Resource Definitions for higher-level workflows:
- ReaperPod — Simplified pod spec without container boilerplate
- ReaperOverlay — PVC-like overlay lifecycle management
- ReaperDaemonJob — Run jobs to completion on every matching node, with dependency ordering and shared overlays
See the CRD Reference for full documentation and the examples for runnable demos.