标签: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
标签:operator 镜像 nod kubeadm lob man bash clust home
原文地址:https://www.cnblogs.com/ericnie/p/11383676.html