Skip to content

Commit

Permalink
fix: add pod security context to avoid permission denied (#1857)
Browse files Browse the repository at this point in the history
  • Loading branch information
grafvonb committed Jul 25, 2023
1 parent a2834c2 commit de25016
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/k8s/persistent_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,17 @@ func runWithVolumeMounted(ctx context.Context, podImage string, podCommand []str

const volumeMntPoint = "/tmp/volume_mnt"
const pVol = "p-vol"
fsGroup := int64(1000)
job := &batchV1.Job{
ObjectMeta: metav1.ObjectMeta{
Name: jobName,
},
Spec: batchV1.JobSpec{

Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
SecurityContext: &corev1.PodSecurityContext{
FSGroup: &fsGroup,
},
Containers: []corev1.Container{
{
Name: "container",
Expand Down

0 comments on commit de25016

Please sign in to comment.