-
Notifications
You must be signed in to change notification settings - Fork 12
feat: Allow changing emptyDir sizeLimit #311
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -38,6 +38,8 @@ type envConfig struct { | |||||
ConfigurationServiceURL string `envconfig:"CONFIGURATION_SERVICE" default:""` | ||||||
// The k8s namespace the job will run in | ||||||
JobNamespace string `envconfig:"JOB_NAMESPACE" required:"true"` | ||||||
// Kubernetes Empty Dir Size Limit for every job (default: "20Mi") | ||||||
JobEmtpyDirVolumeSizeLimit string `envconfig:"JOB_EMPTYDIR_SIZELIMIT" default:"20Mi"` | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another default value layer (so we have 3: values.yaml, default helm function in the configmap template and finally here in EnvConfig), it would get confusing as which value would be used. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
// The token of the keptn API | ||||||
KeptnAPIToken string `envconfig:"KEPTN_API_TOKEN"` | ||||||
// The init container image to use | ||||||
|
@@ -130,6 +132,7 @@ func processKeptnCloudEvent(ctx context.Context, event cloudevents.Event, allowL | |||||
DefaultPodSecurityContext: DefaultPodSecurityContext, | ||||||
AllowPrivilegedJobs: env.AllowPrivilegedJobs, | ||||||
JobLabels: JobLabels, | ||||||
JobEmtpyDirVolumeSizeLimit: env.JobEmtpyDirVolumeSizeLimit, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
TaskDeadlineSeconds: TaskDeadlineSecondsPtr, | ||||||
JesDeploymentName: env.FullDeploymentName, | ||||||
}, | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -75,6 +75,7 @@ type JobSettings struct { | |||||
AllowPrivilegedJobs bool | ||||||
TaskDeadlineSeconds *int64 | ||||||
JobLabels map[string]string | ||||||
JobEmtpyDirVolumeSizeLimit string | ||||||
JesDeploymentName string | ||||||
} | ||||||
|
||||||
|
@@ -116,8 +117,10 @@ func (k8s *K8sImpl) CreateK8sJob( | |||||
// TODO configure from outside: | ||||||
jobVolumeMountPath := "/keptn" | ||||||
|
||||||
// TODO configure from outside: | ||||||
quantity := resource.MustParse("20Mi") | ||||||
if jobSettings.JobEmtpyDirVolumeSizeLimit != "" { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. with all the default values we have I am not sure that we can ever have an empty
Suggested change
|
||||||
quantity = resource.MustParse(jobSettings.JobEmtpyDirVolumeSizeLimit) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
|
||||||
jobResourceRequirements := jobSettings.DefaultResourceRequirements | ||||||
if task.Resources != nil { | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this means that it won't be possible not to specify a size and leave the management to the k8s host. I would suggest to leave the default in the values.yaml and remove it from here to allow users to specify
""
as value already when installing.Current solution would force users to manually modify the configmap to have no limit for emptyDir volumes...