码迷,mamicode.com
首页 > 其他好文 > 详细

OpenShift 4.1 探索(持续更新)

时间:2019-08-20 16:53:37      阅读:196      评论:0      收藏:0      [点我收藏+]

标签:operator   镜像   nod   kubeadm   lob   man   bash   clust   home   

因为在OpenShift 4.1环境中不建议直接登录集群主机操作,因此很多操作可能需要在外部的Client VM上完成。当然用rhel的worker node的同事也可以和原来习惯保持一致。

这里记录一下常见的情形:

 

  • 设置集群访问
export KUBECONFIG=$HOME/cluster-${GUID}/auth/kubeconfig
echo "export KUBECONFIG=$HOME/cluster-${GUID}/auth/kubeconfig" >>$HOME/.bashrc

 

  • 上传镜像到内部镜像仓库

暴露image-registry路由,缺省不暴露route,只暴露image-registry.openshift-image-registry.svc服务

[root@clientvm 0 ~]# oc get svc -n openshift-image-registry
NAME             TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)    AGE
image-registry   ClusterIP   172.30.134.180   <none>        5000/TCP   5h2m

 

oc patch configs.imageregistry.operator.openshift.io/cluster --patch {"spec":{"defaultRoute":true}} --type=merge

Podman登录

oc login -u kubeadm

HOST=$(oc get route default-route -n openshift-image-registry --template={{ .spec.host }})
podman login -u kubeadm -p $(oc whoami -t) --tls-verify=false $HOST

然后push镜像,切记使用--tls-verify=false

[root@clientvm 125 ~]# podman push default-route-openshift-image-registry.apps.cluster-d60b.sandbox509.opentlc.com/myproject/mytomcat:slim --tls-verify=false 
Getting image source signatures
Copying blob ea23cfa0bea9 done
Copying blob 2bf534399aca done
Copying blob eb25e0278d41 done
Copying blob 46ff59048438 done
Copying blob f613cd1e50cc done
Copying blob 1c95c77433e8 done
Copying blob 6d520b2e1077 done
Copying config 7670309228 done
Writing manifest to image destination
Copying config 7670309228 done
Writing manifest to image destination
Storing signatures

 

OpenShift 4.1 探索(持续更新)

标签:operator   镜像   nod   kubeadm   lob   man   bash   clust   home   

原文地址:https://www.cnblogs.com/ericnie/p/11383676.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!