openshift安装
关闭防火墙
启动
oc cluster up --skip-registry-check=true --public-hostname=192.168.0.2
--常见报错
https://morningspace.github.io/tech/openshift-v3-trap-and-pitfalls/
--Error response from daemon: Get https://172.30.1.1:5000/v2
解决方式:
echo '{ "insecure-registries":["192.168.0.2:5000"] }' > /etc/docker/daemon.json
systemctl restart docker
--20201214安装(openshift-origin-server-v3.9.0-191fece-linux-64bit.tar.gz)
1、无法安装docker(或者参考w3school的docker安装:sudo apt-get install -y docker.io)
https://stackoverflow.com/questions/57402923/docker-installation-on-linux-mint-19-2-doesnt-work
2、简单启动
sudo oc cluster up --skip-registry-check=true
3、默认用户名密码是dev
4、最终启动
sudo oc cluster up
--use-existing-config=true
--skip-registry-check=true
--host-config-dir='/home/jq/openshift/local/config'
--host-data-dir='/home/jq/openshift/local/data'
--host-pv-dir='/home/jq/openshift/local/pv'
--host-volumes-dir='/home/jq/openshift/local/volumes'
5、无法部署nginx
error: build error: Failed to push image: Get https://172.30.1.1:5000/v2/: http: server gave HTTP response to HTTPS client
https://blog.csdn.net/jinjiashui/article/details/106050139
6、nginx的访问地址(applications->routes)
http://172.30.197.63:8080/
http://nginx-aa.127.0.0.1.nip.io/
--给用户赋值管理员权限(自测未创建project前,可以用system:admin无密码登录赋管理员权限;否则,system:admin无法登录)
oc adm policy add-cluster-role-to-user cluster-admin jq
=------------------------------------------------------------------------------------------------
查询有哪些模板
oc get templates -n openshift
导出模板
oc export template jws31-tomcat8-basic-s2i -n openshift -o json > jws31-tomcat8-basic-s2i.json
导入模板
oc create -f ./jws31-tomcat8-basic-s2i.json
http://v1.uncontained.io/playbooks/fundamentals/template_development_guide.html
=------------------------------------------------------------------------------------------------
报错1:Reason: Error resolving ImageStreamTag redhat-openjdk18-openshift:1.4 in namespace openshift: imagestreams.image.openshift.io "redhat-openjdk18-openshift" not found
在以下界面搜索“redhat-openjdk18-openshift”
https://catalog.redhat.com/software/containers/search
执行
oc import-image redhat-openjdk-18/openjdk18-openshift --from=registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift --confirm
变更build的yml文件内容
redhat-openjdk18-openshift:1.4 => openjdk18-openshift:latest
=--------------------------------------------------------------------------------------------
报错2:error: provided context directory does not exist: undertow-servlet
删掉这行 contextDir: undertow-servlet
--或者继续探索,未研究完
https://access.redhat.com/documentation/en-us/red_hat_jboss_middleware_for_openshift/3/html-single/red_hat_java_s2i_for_openshift/index
cp target/undertow-servlet.jar ocp/deployments/
3、执行命令案例
oc exec gcreportback-10-x49nt -- jstat -gcutil 1

浙公网安备 33010602011771号