Skip to content

Commit

Permalink
added volume and volumeMount to deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
ffais committed Dec 1, 2023
1 parent 41f1d2e commit 9e6965b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions internal/controller/dremiorestserver_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ func (r *DremioRestServerReconciler) deploymentForDremiorestserver(
return nil, errors.New("tables missing from spec")
}

emptyDirSize := resource.MustParse("10Mi")
//leave limits and requests empty by default
limits := corev1.ResourceList{}
if dremiorestserver.Spec.ContainerLimits.Cpu != "" {
Expand Down Expand Up @@ -472,10 +473,26 @@ func (r *DremioRestServerReconciler) deploymentForDremiorestserver(
Type: corev1.SeccompProfileTypeRuntimeDefault,
},
},
Volumes: []corev1.Volume{
{
Name: "tomcat-tmp",
VolumeSource: corev1.VolumeSource{
EmptyDir: &corev1.EmptyDirVolumeSource{
SizeLimit: &emptyDirSize,
},
},
},
},
Containers: []corev1.Container{{
Image: strings.Join([]string{image, tag}, ":"),
Name: "dremiorestserver",
ImagePullPolicy: corev1.PullIfNotPresent,
VolumeMounts: []corev1.VolumeMount{
{
MountPath: "/tmp/tomcat",
Name: "tomcat-tmp",
},
},
Resources: corev1.ResourceRequirements{
Limits: limits,
Requests: requests,
Expand Down

0 comments on commit 9e6965b

Please sign in to comment.