欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  网络运营

快速安装openshift的步骤详解

程序员文章站 2022-04-25 17:19:28
最快速体验openshift目前最新版本3.9的方法。 事前准备 [root@host ~]# git clone http://github.com/lium...

最快速体验openshift目前最新版本3.9的方法。

事前准备

[root@host ~]# git clone http://github.com/liumiaocn/easypack.git
cloning into 'easypack'...
remote: counting objects: 1050, done.
remote: compressing objects: 100% (59/59), done.
remote: total 1050 (delta 29), reused 6 (delta 3), pack-reused 985
receiving objects: 100% (1050/1050), 157.41 kib | 0 bytes/s, done.
resolving deltas: 100% (464/464), done.
[root@host ~]# cd easypack/openshift/
[root@host openshift]# ls
install-openshift.sh
[root@host openshift]#

安装

安装命令:sh install-openshift.sh

[root@host openshift]# sh install-openshift.sh 
sun may 6 09:16:16 edt 2018
## step 1: os version confirm: 
linux host.localdomain 3.10.0-514.el7.x86_64 #1 smp tue nov 22 16:42:41 utc 2016 x86_64 x86_64 x86_64 gnu/linux
centos linux release 7.3.1611 (core) 
## install docker 
loaded plugins: fastestmirror
loading mirror speeds from cached hostfile
 * base: mirror.it.ubc.ca
 * extras: mirror.it.ubc.ca
 * updates: mirror.csclub.uwaterloo.ca
...安装docker
sun may 6 09:16:16 edt 2018
## step 2: set net.ipv4.ip_forward
net.ipv4.ip_forward=1
net.ipv4.ip_forward=1
sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1
sun may 6 09:16:17 edt 2018
## step 3: set registry & restart docker
{
  "insecure-registries": [
   "172.30.0.0/16"
  ]
}
## systemctl daemon-reload
## systemctl restart docker
## confirm docker version
client:
 version:     1.13.1
 api version:   1.26
 package version: <unknown>
 go version:   go1.8.3
 git commit:   774336d/1.13.1
 built:      wed mar 7 17:06:16 2018
 os/arch:     linux/amd64
server:
 version:     1.13.1
 api version:   1.26 (minimum version 1.12)
 package version: <unknown>
 go version:   go1.8.3
 git commit:   774336d/1.13.1
 built:      wed mar 7 17:06:16 2018
 os/arch:     linux/amd64
 experimental:  false
sun may 6 09:16:20 edt 2018
## step 4: set for firewall
...设定防火墙端口
sun may 6 09:16:21 edt 2018
## step 5: get and setting oc: 
loaded plugins: fastestmirror
loading mirror speeds from cached hostfile
 * base: mirror.it.ubc.ca
 * extras: mirror.it.ubc.ca
 * updates: mirror.csclub.uwaterloo.ca
package wget-1.14-15.el7_4.1.x86_64 already installed and latest version
nothing to do
--2018-05-06 09:16:22-- 
...下载oc客户端工具
2018-05-06 09:16:40 (2.45 mb/s) - ‚äòopenshift-origin-client-tools-v3.9.0-191fece-linux-64bit.tar.gz‚äô saved [44156681/44156681]
...省略
/usr/local/bin/oc
oc v3.9.0+191fece
kubernetes v1.9.1+a0ce1bc657
features: basic-auth gssapi kerberos spnego
sun may 6 09:16:42 edt 2018
## step 6: start up oc cluster
pulling image openshift/origin:v3.9.0
pulled 1/4 layers, 31% complete
pulled 2/4 layers, 63% complete
pulled 3/4 layers, 75% complete
pulled 3/4 layers, 80% complete
pulled 3/4 layers, 86% complete
pulled 3/4 layers, 91% complete
pulled 3/4 layers, 95% complete
pulled 3/4 layers, 99% complete
pulled 4/4 layers, 100% complete
extracting
image pull complete
using nsenter mounter for openshift volumes
using 127.0.0.1 as the server ip
starting openshift using openshift/origin:v3.9.0 ...
openshift server started.
the server is accessible via web console at:
  https://127.0.0.1:8443
you are logged in as:
  user:   developer
  password: <any value>
to login as administrator:
  oc login -u system:admin
sun may 6 09:20:37 edt 2018
repository                tag         image id      created       size
docker.io/openshift/origin-web-console  v3.9.0       6d397283b924    6 days ago     489 mb
docker.io/openshift/origin-deployer   v3.9.0       2dcb16bd17a4    6 days ago     1.25 gb
docker.io/openshift/origin        v3.9.0       e28708220c0b    6 days ago     1.25 gb
docker.io/openshift/origin-pod      v3.9.0       b549aa96e0a7    6 days ago     220 mb
docker.io/capitalone/hygieia-api     latest       8e7b476005b9    15 months ago    684 mb
sun may 6 09:20:38 edt 2018
## step 7: oc login -u developer
logged into "https://127.0.0.1:8443" as "developer" using existing credentials.
you have one project on this server: "myproject"
using project "myproject".
## finished.
[root@host openshift]#

结果确认

相关的镜像

[root@host openshift]# docker images |grep openshift
docker.io/openshift/origin-web-console    v3.9.0       6d397283b924    6 days ago     489 mb
docker.io/openshift/origin-docker-registry  v3.9.0       45f47bc77de8    6 days ago     458 mb
docker.io/openshift/origin-haproxy-router  v3.9.0       42e8fd168a7a    6 days ago     1.28 gb
docker.io/openshift/origin-deployer     v3.9.0       2dcb16bd17a4    6 days ago     1.25 gb
docker.io/openshift/origin          v3.9.0       e28708220c0b    6 days ago     1.25 gb
docker.io/openshift/origin-pod        v3.9.0       b549aa96e0a7    6 days ago     220 mb
[root@host openshift]#

验证管理员权限

[root@host openshift]# oc login -u system:admin
logged into "https://127.0.0.1:8443" as "system:admin" using existing credentials.
you have access to the following projects and can switch between them with 'oc project <projectname>':
  default
  kube-public
  kube-system
 * myproject
  openshift
  openshift-infra
  openshift-node
  openshift-web-console
using project "myproject".
[root@host openshift]#

本地连接方式

ssh -p 10023 -l 80:127.0.0.1:80 127.0.0.1
ssh -p 10023 -l 8443:127.0.0.1:8443 127.0.0.1
https://127.0.0.1:8443

总结

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对的支持。如果你想了解更多相关内容请查看下面相关链接