Open todaygood opened 6 years ago
找到该pod运行在哪个node上
[root@ose0 ~]# oc get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE
docker-registry-2-5zpz2 1/1 Running 0 3h 10.130.2.21 ose7.cloud.genomics.cn
ssh到该node, 发现nfs 已经mount上了。
[root@ose7 ~]# mount |grep nfs
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
192.168.122.104:/data5 on /var/lib/origin/openshift.local.volumes/pods/4ef87fb1-92a8-11e8-a64a-525400a1189c/volumes/kubernetes.io~nfs/nfs-data5 type nfs4 (rw,relatime,vers=4.1,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.122.103,local_lock=none,addr=192.168.122.104)
发现nfs目录写入失败 [root@ose7 ~]# echo "abc" > /var/lib/origin/openshift.local.volumes/pods/4ef87fb1-92a8-11e8-a64a-525400a1189c/volumes/kubernetes.io~nfs/nfs-data5/abc-bash: /var/lib/origin/openshift.local.volumes/pods/4ef87fb1-92a8-11e8-a64a-525400a1189c/volumes/kubernetes.io~nfs/nfs-data5/abc: Permission denied
[root@ose5 /]# chmod 777 data* -R
验证docker push成功,
[root@ose0 ~]# docker push 172.30.165.209:5000/openshift/busybox
The push refers to a repository [172.30.165.209:5000/openshift/busybox]
8e9a7d50b12c: Pushed
latest: digest: sha256:1bd6df27274fef1dd36eb529d0f4c8033f61c675d6b04213dd913f902f7cafb5 size: 527
可以看到registry目录是这样的:
Issue
Steps
[root@ose0 ~]# oc get pods NAME READY STATUS RESTARTS AGE docker-registry-2-5zpz2 1/1 Running 0 2h registry-console-1-b6sht 1/1 Running 0 2d router-1-lnnxj 1/1 Running 0 4d router-1-z2mmc 1/1 Running 0 4d
发现是空的。
创建用户,赋予权限 htpasswd /etc/origin/master/htpasswd margin oc adm policy add-role-to-user system:registry margin oc adm policy add-role-to-user admin magin -n openshift oc adm policy add-role-to-user system:image-builder margin
登录registry ,push image 找到docker registry service地址
是172.30.165.209:5000