registry does not have write permission when use glusterfs as back storage
glusterfs endpoints
apiVersion: v1
kind: Endpoints
metadata:
name: glusterfs-cluster
subsets:
- addresses:
- ip: 193.0.10.166
ports:
- port: 1
- addresses:
- ip: 193.0.10.167
ports:
- port: 1
glusterfs pv
apiVersion: v1
kind: PersistentVolume
metadata:
name: docker-registry
spec:
capacity:
storage: 20Gi
accessModes:
- ReadWriteMany
glusterfs:
endpoints: glusterfs-cluster
path: docker-registry
readOnly: false
persistentVolumeReclaimPolicy: Retain
add registry volume
oc volume dc docker-registry --add --overwrite --name=registry-storage --mount-path=/registry --claim-name=docker-registry --claim-size=20Gi --claim-mode=rwm --type=persistentVolumeClaim
registry log
time="2015-11-17T11:12:31Z" level=info msg="filesystem.PutContent(\"/docker/registry/v2/repositories/demo/nodejs-ex/_uploads/ac244ee1-e536-4eed-89ed-ebd274325a7f/startedat\")" trace.duration=25.033777ms trace.file="/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/docker/distribution/registry/storage/driver/base/base.go" trace.func="github.com/docker/distribution/registry/storage/driver/base.(*Base).PutContent" trace.id=0cf95673-9a58-445a-b966-c1faed3cd9c6 trace.line=67
16
time="2015-11-17T11:12:31Z" level=error msg="An error occured" err.code=UNKNOWN err.detail="mkdir /registry/docker: permission denied" err.message="unknown error" http.request.host="172.30.119.17:5000" http.request.id=f69a39cc-098a-4261-86a5-cfffdda764d2 http.request.method=POST http.request.remoteaddr="10.1.3.1:44707" http.request.uri="/v2/demo/nodejs-ex/blobs/uploads/" http.request.useragent="docker/1.8.2 go/go1.4.2 kernel/3.10.0-229.20.1.el7.x86_64 os/linux arch/amd64" instance.id=a82f15f3-4b5b-42e8-a624-7804d2a518d7 vars.name="demo/nodejs-ex"
17
time="2015-11-17T11:12:31Z" level=info msg="response completed" http.request.host="172.30.119.17:5000" http.request.id=f69a39cc-098a-4261-86a5-cfffdda764d2 http.request.method=POST http.request.remoteaddr="10.1.3.1:44707" http.request.uri="/v2/demo/nodejs-ex/blobs/uploads/" http.request.useragent="docker/1.8.2 go/go1.4.2 kernel/3.10.0-229.20.1.el7.x86_64 os/linux arch/amd64" http.response.contenttype="application/json; charset=utf-8" http.response.duration=254.063505ms http.response.status=500 http.response.written=111 instance.id=a82f15f3-4b5b-42e8-a624-7804d2a518d7
18
10.1.3.1 - - [17/Nov/2015:11:12:30 +0000] "POST /v2/demo/nodejs-ex/blobs/uploads/ HTTP/1.1" 500 111 "" "docker/1.8.2 go/go1.4.2 kernel/3.10.0-229.20.1.el7.x86_64 os/linux arch/amd64"
If you deployed with openshift_ansible it is probably related to https://github.com/openshift/openshift-ansible/pull/903
yes, but after set virt_sandbox_use_fusefs, it still have not write permision
had the same problem, fix was to change the posix permission inside the mounted volume (eg on glusterfs server) chmod 777 . did the trick
@danmcp We are setting both virt_sandbox_use_fusefs and virt_use_fusefs in openshift-ansible, With the resolution mentioned by @gorg3b it seems like this is more of a documentation issue now.
It does not seem acceptable to require customers to change perms on their existing (brownfield) glusterfs-fuse mount dir. I cannot tell from @detiber's comment if the chmod 777 is still required to fix the issue. If so then I think rather than chmod 777 it is better to define supplementalGroups in the pod spec to match the mount's GID, or change the project's default supp-GID to be the GID of the gluster mount dir.
hi, the chmod was actually just a quick work around / for testing purposes, since documentation on supplementalGroups was not available at the time.
I have the exact same issue, but its with iscsi. Changing permissions on the host allows the registry to work properly. After testing a few permissions 770 is the tightest permission that can be used. I changed ownership of the directory with the same results
@pstinghua Do you mean that you cannot push images to the docker registry? See the instructions for Accessing the Registry Directly. I think the Prerequisite section may be helpful.
Per to docs:
For writing or pushing images, for example when using the docker push command, the user must have the system:image-builder role. To add this role:
$ oadm policy add-role-to-user system:image-builder <user_name>
@pstinghua Was this useful?
@pstinghua please test solution so we may close this issue
@erinboyd, do you know if this can be closed?
supplementalgroups can be defined for the registry now so i'm going to assume this can be closed. we can reopen if someone still has concerns.
HI in. my case,
