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
14 changes: 9 additions & 5 deletions pkg/util/k8sutil/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,10 @@ func arangodInitContainer(name, id, engine, alpineImage string, requireUUID bool
"-c",
command,
},
Name: name,
Image: alpineImage,
VolumeMounts: arangodVolumeMounts(),
Name: name,
Image: alpineImage,
VolumeMounts: arangodVolumeMounts(),
SecurityContext: SecurityContextWithoutCapabilities(),
}
return c
}
Expand Down Expand Up @@ -412,6 +413,7 @@ func arangodbexporterContainer(image string, imagePullPolicy v1.PullPolicy, args
Protocol: v1.ProtocolTCP,
},
},
SecurityContext: SecurityContextWithoutCapabilities(),
}
for k, v := range env {
c.Env = append(c.Env, v.CreateEnvVar(k))
Expand Down Expand Up @@ -494,6 +496,7 @@ func initLifecycleContainer(image string) (v1.Container, error) {
Image: image,
ImagePullPolicy: v1.PullIfNotPresent,
VolumeMounts: lifecycleVolumeMounts(),
SecurityContext: SecurityContextWithoutCapabilities(),
}
return c, nil
}
Expand Down Expand Up @@ -574,7 +577,8 @@ func CreateArangodPod(kubecli kubernetes.Interface, developmentMode bool, deploy
}

// Add arangod container
c := arangodContainer(image, imagePullPolicy, args, env, livenessProbe, readinessProbe, lifecycle, lifecycleEnvVars, resources, vct != nil)
c :=
arangodContainer(image, imagePullPolicy, args, env, livenessProbe, readinessProbe, lifecycle, lifecycleEnvVars, resources, vct != nil)
if tlsKeyfileSecretName != "" {
c.VolumeMounts = append(c.VolumeMounts, tlsKeyfileVolumeMounts()...)
}
Expand Down Expand Up @@ -831,7 +835,7 @@ func createPod(kubecli kubernetes.Interface, pod *v1.Pod, ns string, owner metav
func SecurityContextWithoutCapabilities() *v1.SecurityContext {
return &v1.SecurityContext{
Capabilities: &v1.Capabilities{
Drop: []v1.Capability{"all"},
Drop: []v1.Capability{"ALL"},
},
}
}
1 change: 1 addition & 0 deletions reboot.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ func runVolumeInspector(ctx context.Context, kube kubernetes.Interface, ns, name
},
},
},
SecurityContext: k8sutil.SecurityContextWithoutCapabilities(),
},
},
Volumes: []corev1.Volume{
Expand Down