Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changes/unreleased/Feature-20260709-000001.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Feature
body: Add configurable ephemeral-storage requests and limits for job pods via `job-pod-requests-ephemeral-storage` (default 64 MB) and `job-pod-limits-ephemeral-storage` (default 26624 MB) flags
time: 2026-07-09T00:00:01.000000Z
3 changes: 2 additions & 1 deletion bin/opslevel-runner-runner
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ exec watchexec --watch "$SCRIPT_DIR/../src" --exts go,mod,sum --restart \
--runner-pod-namespace=default \
--job-pod-helper-image=localhost/opslevel-runner:dev \
--job-pod-requests-cpu="${OPSLEVEL_JOB_POD_REQUESTS_CPU:-50}" \
--job-pod-requests-memory="${OPSLEVEL_JOB_POD_REQUESTS_MEMORY:-32}"
--job-pod-requests-memory="${OPSLEVEL_JOB_POD_REQUESTS_MEMORY:-32}" \
--job-pod-requests-ephemeral-storage="${OPSLEVEL_JOB_POD_REQUESTS_EPHEMERAL_STORAGE:-32}"
2 changes: 2 additions & 0 deletions src/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ func init() {
rootCmd.PersistentFlags().String("job-pod-namespace", "default", "The kubernetes namespace to create job pods in.")
rootCmd.PersistentFlags().Int64("job-pod-requests-cpu", 1000, "The job pod resource requests cpu millicores.")
rootCmd.PersistentFlags().Int64("job-pod-requests-memory", 1024, "The job pod resource requests in MB.")
rootCmd.PersistentFlags().Int64("job-pod-requests-ephemeral-storage", 64, "The job pod resource requests ephemeral-storage in MB.")
rootCmd.PersistentFlags().Int64("job-pod-limits-cpu", 1000, "The job pod resource limits cpu millicores.")
rootCmd.PersistentFlags().Int64("job-pod-limits-memory", 1024, "The job pod resource limits in MB.")
rootCmd.PersistentFlags().Int64("job-pod-limits-ephemeral-storage", 26624, "The job pod resource limits ephemeral-storage in MB.")
rootCmd.PersistentFlags().String("job-pod-shell", "/bin/sh", "The job pod shell to use for commands run inside the pod.")
rootCmd.PersistentFlags().String("job-pod-workdir", "/jobs", "The job pod working directory.")
rootCmd.PersistentFlags().Int("job-pod-log-max-interval", 30, "The max amount of time between when pod logs are shipped to OpsLevel. Works in tandem with 'job-pod-log-max-size'")
Expand Down
10 changes: 6 additions & 4 deletions src/pkg/k8s_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ func ReadPodConfig(path string) (*K8SPodConfig, error) {
WorkingDir: viper.GetString("job-pod-workdir"),
Resources: corev1.ResourceRequirements{
Requests: corev1.ResourceList{
corev1.ResourceCPU: *resource.NewMilliQuantity(viper.GetInt64("job-pod-requests-cpu"), resource.DecimalSI),
corev1.ResourceMemory: *resource.NewQuantity(viper.GetInt64("job-pod-requests-memory")*1024*1024, resource.BinarySI),
corev1.ResourceCPU: *resource.NewMilliQuantity(viper.GetInt64("job-pod-requests-cpu"), resource.DecimalSI),
corev1.ResourceMemory: *resource.NewQuantity(viper.GetInt64("job-pod-requests-memory")*1024*1024, resource.BinarySI),
corev1.ResourceEphemeralStorage: *resource.NewQuantity(viper.GetInt64("job-pod-requests-ephemeral-storage")*1024*1024, resource.BinarySI),
},
Limits: corev1.ResourceList{
corev1.ResourceCPU: *resource.NewMilliQuantity(viper.GetInt64("job-pod-limits-cpu"), resource.DecimalSI),
corev1.ResourceMemory: *resource.NewQuantity(viper.GetInt64("job-pod-limits-memory")*1024*1024, resource.BinarySI),
corev1.ResourceCPU: *resource.NewMilliQuantity(viper.GetInt64("job-pod-limits-cpu"), resource.DecimalSI),
corev1.ResourceMemory: *resource.NewQuantity(viper.GetInt64("job-pod-limits-memory")*1024*1024, resource.BinarySI),
corev1.ResourceEphemeralStorage: *resource.NewQuantity(viper.GetInt64("job-pod-limits-ephemeral-storage")*1024*1024, resource.BinarySI),
},
},
TerminationGracePeriodSeconds: 5,
Expand Down
Loading