Invalid value: "hostPath": hostPath volumes are not allowed to be used

Setup of gitlab on openshift is failing.

Setup oc using the guide presented here: https://www.youtube.com/watch?v=aQ3Nta2WR94.

The error I receive when running the setup script from the idea-to-production blog.

--> Scaling gitlab-1 to 1
-->  FailedCreate: gitlab-1 Error creating: pods "gitlab-1-" is forbidden: unable to validate against any security context constraint: 
[spec.containers[0].securityContext.volumes[0]: Invalid value: "hostPath": hostPath volumes are not allowed to be used 
spec.containers[0].securityContext.volumes[1]: Invalid value: "hostPath": hostPath volumes are not allowed to be used]
error: couldn't scale gitlab-1 to 1: timed out waiting for "gitlab-1" to be synced

System, docker, and oc:

[root@CentOS-72-64-minimal ~]# oc version
oc v1.4.0-alpha.1+f189ede
kubernetes v1.4.0+776c994
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://148.251.44.8:8443
openshift v1.4.0-alpha.1+f189ede
kubernetes v1.4.0+776c994
[root@CentOS-72-64-minimal ~]# docker --version
Docker version 1.12.3, build 6b644ec
[root@CentOS-72-64-minimal ~]# 

I attempted modifying the setup script by setting each securityContexts privileged flag:

            "securityContext": {
              "privileged": true,
              "runAsUser": 0
            }

Still doesn't work. Any guidance would be appreciated.

Edited Jun 30, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading