diff --git a/chart/README.md b/chart/README.md index f7522956..ddb0c8e3 100644 --- a/chart/README.md +++ b/chart/README.md @@ -31,6 +31,7 @@ The following table lists the configurable parameters of the job-executor-servic | `jobConfig.labels` | Additional labels that are added to all kubernetes jobs | `{}` | | `jobConfig.networkPolicy.enabled` | Enable a network policy for jobs such that they can not access blocked networks defined in blockCIDRS | `false` | | `jobConfig.networkPolicy.blockCIDRs` | A list of networks that should not be accessible from jobs | `false` | +| `jobConfig.emptyDirSizeLimit` | Size Limit of emptyDirs created for jobs | `"20Mi"` | | `remoteControlPlane.autoDetect.enabled` | Enables auto detection of a Keptn installation | `false` | | `remoteControlPlane.autoDetect.namespace` | Namespace which should be used by the auto-detection | `""` | | `remoteControlPlane.api.protocol` | Used protocol (http, https | `"https"` | diff --git a/chart/templates/configmap.yaml b/chart/templates/configmap.yaml index ec79ed9f..315a02cd 100644 --- a/chart/templates/configmap.yaml +++ b/chart/templates/configmap.yaml @@ -4,6 +4,7 @@ metadata: name: job-service-config data: job_namespace: "{{ .Release.Namespace }}" + job_emptydir_sizelimit: "{{ .Values.jobConfig.emptyDirSizeLimit | default "20Mi" }}" init_container_image: "{{ .Values.jobexecutorserviceinitcontainer.image.repository }}:{{ .Values.jobexecutorserviceinitcontainer.image.tag | default .Chart.AppVersion }}" default_resource_limits_cpu: "1" default_resource_limits_memory: "512Mi" diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 1149f617..4cc06bce 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -58,6 +58,11 @@ spec: configMapKeyRef: name: job-service-config key: job_namespace + - name: JOB_EMPTYDIR_SIZELIMIT + valueFrom: + configMapKeyRef: + name: job-service-config + key: job_emptydir_sizelimit - name: INIT_CONTAINER_IMAGE valueFrom: configMapKeyRef: diff --git a/chart/values.yaml b/chart/values.yaml index 053fbc0a..8009e127 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -84,6 +84,7 @@ jobConfig: # "172.16.0.0/12", # "192.168.0.0/16" ] + emptyDirSizeLimit: "20Mi" # Size Limit for emptyDirs for each job (/keptn - containing resources) imagePullSecrets: [ ] # Secrets to use for container registry credentials diff --git a/cmd/job-executor-service/main.go b/cmd/job-executor-service/main.go index 5f1f64f2..9c688df4 100644 --- a/cmd/job-executor-service/main.go +++ b/cmd/job-executor-service/main.go @@ -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"` // 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, TaskDeadlineSeconds: TaskDeadlineSecondsPtr, JesDeploymentName: env.FullDeploymentName, }, diff --git a/docs/FEATURES.md b/docs/FEATURES.md index 6db15263..e5cb39d7 100644 --- a/docs/FEATURES.md +++ b/docs/FEATURES.md @@ -332,6 +332,11 @@ args: - /keptn/locust/basic.py ``` +#### Increase Volume Size for files + +By default, `/keptn` reserves `"20Mi"` (20 Mebibyte) as part of an `emptyDir`. This value can be modified at your own +risk by setting the Helm Value `jobConfig.emptyDirSizeLimit`, e.g., `--set jobConfig.emptyDirSizeLimit=50Mi`. + ### Silent mode Actions can be run in silent mode, meaning no `.started/.finished` events will be sent by the job-executor-service. This diff --git a/pkg/k8sutils/job.go b/pkg/k8sutils/job.go index cf00d0d8..a2fb7ef4 100644 --- a/pkg/k8sutils/job.go +++ b/pkg/k8sutils/job.go @@ -75,6 +75,7 @@ type JobSettings struct { AllowPrivilegedJobs bool TaskDeadlineSeconds *int64 JobLabels map[string]string + JobEmtpyDirVolumeSizeLimit string JesDeploymentName string } @@ -116,8 +117,7 @@ func (k8s *K8sImpl) CreateK8sJob( // TODO configure from outside: jobVolumeMountPath := "/keptn" - // TODO configure from outside: - quantity := resource.MustParse("20Mi") + quantity := resource.MustParse(jobSettings.JobEmtpyDirVolumeSizeLimit) jobResourceRequirements := jobSettings.DefaultResourceRequirements if task.Resources != nil {