At present, OpenShift has launched the 4.2 version, and I am ready to learn about OpenShift. I have referred to OpenShift Open Source Container Cloud, but the installation process is really a series of twists and turns, which is hereby recorded.

1. Prepare the environment of VMware virtual machine RHEL7.4

Each time you start the virtual machine, you have to start the network manually. Do you know how to set it to automatically connect to the network when you start the virtual machine

2. Set the mirror source

baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/7/os/$basearch/
yum clean all
yum makecache
yum update

When I set the mirror source, I used Tsinghua’s mirror source, but there is a variable $releasever in it that may not be found, so manually change it to 7 and then yum can be connected three times

3. Download the openshift

cd /opt/
wget https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-server-v3.11.0-0cbc58b-linux-64bit.tar.gz

OpenShift Server source package to /opt directory, on GitHub the current stable version is 3.1.1,

4. Unzip and install

Tar ZVF openshift-origin-server-v3.11.0-0cbc58b-linux-64bit.tar.gz ln -s Openshift origin - server - v3.11.0-0 cbc58b - Linux - 64 - bit. The tar. Gz/opt/openshift

Set up a soft connection and use the /opt/opeshif directory next time, then add it to the environment variable and change /etc/profile to use the openshift command

PATH=$PATH:/opt/openshift

5. Start the openshift

There are a lot of problems here

The first boot failed

Unable to start with OpenShift Start will cause an error. This command is deprecated and will need to be started with OC Cluster Up

Command "start" is deprecated, This command will be replaced by the hypershift and hyperkube binaries for starting individual components.
Start components of OpenShift 

This command launches components of OpenShift.

The second boot failed

Failed to start Kube-Apiserver using OC Cluster Up

I1119 23:43:45.311335 18475 run_self_host. go:181] Waiting for the Kube-Apiserver to be ready... E1119 23:48:45. 514801 18475 run_self_hosted. Go: 571] API server error: Get https://127.0.0.1:8443/healthz? Timeout =32s: dial TCP 127.0.0.1:8443: connect: connection refused () Error: timed out waiting for the condition

I did a bit of digging and found that the firewall needs to be turned off

firewall-cmd --state
systemctl stop firewalld.service
systemctl disable firewalld.service

The third boot failed

/etc/sysconfig/docker = /etc/sysconfig/docker = /etc/sysconfig/docker = /etc/sysconfig/docker = /etc/sysconfig/docker = /etc/sysconfig/docker = /etc/sysconfig/docker = /etc/sysconfig/docker = /etc/sysconfig/docker = /etc/sysconfig/docker = /etc/sysconfig/docker Increase insercure-registry and register-mirrors, and restart Docker once you have set it

- insecure - registry 172.30.0.0/16 - registry-mirror=https://docker.mirrors.ustc.edu.cn

The fourth boot failed

Restart or fail

E1120 00:25:35. 411914 27357 run_self_hosted. Go: 571] API server error: Get https://127.0.0.1:8443/healthz? Timeout =32s: dial TCP 127.0.0.1:8443: connect: connection refused () Error: timed out waiting for the condition

OC Cluster Up — skip-registrie-check =true This may be because I started with OC Cluster Up — skip-registrie-check =true

The fifth boot failed

Let’s start it up again

Failed to install "openshift-image-registry": could not run "openshift-image-registry": rc=1

I didn’t find out the reason this time. Could it be the network problem

The sixth boot failed

Let’s start it up again

Panic: Get https://127.0.0.1:8443/apis/apiregistration.k8s.io/v1beta1/apiservices? Watch =true: dial TCP 127.0.0.1:8443: connect: connection refused goroutine 1363 [running]: github.com/openshift/origin/pkg/oc/clusterup.watchAPIServices(0x30bb640, 0xc4200d2660) /go/src/github.com/openshift/origin/_output/local/go/src/github.com/openshift/origin/pkg/oc/clusterup/run_self_hosted.go :591 +0x5f6

/etc/resolve.conf: /etc/resolve. Conf: /etc/resolve

The seventh boot failed

Try it again (crash)

Getting a Docker client ...
Checking if image openshift/origin-control-plane:v3.11 is available ...
Checking type of volume mount ...
Determining server IP ...
Checking if OpenShift is already running ...
Checking for supported Docker version (=>1.22) ...
Checking if insecured registry is configured properly in Docker ...
Checking if required ports are available ...
Checking if OpenShift client is configured properly ...
Checking if image openshift/origin-control-plane:v3.11 is available ...
Starting OpenShift using openshift/origin-control-plane:v3.11 ...
I1120 01:37:23.100980   33308 flags.go:30] Running "create-kubelet-flags"
I1120 01:37:24.150876   33308 run_kubelet.go:49] Running "start-kubelet"
I1120 01:37:24.676012   33308 run_self_hosted.go:181] Waiting for the kube-apiserver to be ready ...
I1120 01:41:01.461604   33308 interface.go:26] Installing "kube-proxy" ...
I1120 01:41:01.461825   33308 interface.go:26] Installing "kube-dns" ...
I1120 01:41:01.461831   33308 interface.go:26] Installing "openshift-service-cert-signer-operator" ...
I1120 01:41:01.461836   33308 interface.go:26] Installing "openshift-apiserver" ...
I1120 01:41:01.560613   33308 apply_template.go:81] Installing "kube-proxy"
I1120 01:41:01.586312   33308 apply_template.go:81] Installing "kube-dns"
I1120 01:41:01.586523   33308 apply_template.go:81] Installing "openshift-service-cert-signer-operator"
I1120 01:41:01.589610   33308 apply_template.go:81] Installing "openshift-apiserver"
I1120 01:41:16.765741   33308 interface.go:41] Finished installing "kube-proxy" "kube-dns" "openshift-service-cert-signer-operator" "openshift-apiserver"
I1120 01:42:43.411046   33308 run_self_hosted.go:242] openshift-apiserver available
I1120 01:42:43.973996   33308 interface.go:26] Installing "openshift-controller-manager" ...
I1120 01:42:43.974045   33308 apply_template.go:81] Installing "openshift-controller-manager"
I1120 01:42:55.961497   33308 interface.go:41] Finished installing "openshift-controller-manager"
Adding default OAuthClient redirect URIs ...
Adding centos-imagestreams ...
Adding registry ...
Adding router ...
Adding web-console ...
Adding sample-templates ...
Adding persistent-volumes ...
I1120 01:42:56.386134   33308 interface.go:26] Installing "centos-imagestreams" ...
I1120 01:42:56.386144   33308 interface.go:26] Installing "openshift-image-registry" ...
I1120 01:42:56.386150   33308 interface.go:26] Installing "openshift-router" ...
I1120 01:42:56.386156   33308 interface.go:26] Installing "openshift-web-console-operator" ...
I1120 01:42:56.386162   33308 interface.go:26] Installing "sample-templates" ...
I1120 01:42:56.386167   33308 interface.go:26] Installing "persistent-volumes" ...
I1120 01:42:56.386688   33308 apply_list.go:67] Installing "centos-imagestreams"
I1120 01:42:56.387614   33308 apply_template.go:81] Installing "openshift-web-console-operator"
I1120 01:42:56.387829   33308 interface.go:26] Installing "sample-templates/django quickstart" ...
I1120 01:42:56.387837   33308 interface.go:26] Installing "sample-templates/nodejs quickstart" ...
I1120 01:42:56.387842   33308 interface.go:26] Installing "sample-templates/jenkins pipeline ephemeral" ...
I1120 01:42:56.387847   33308 interface.go:26] Installing "sample-templates/sample pipeline" ...
I1120 01:42:56.387852   33308 interface.go:26] Installing "sample-templates/mongodb" ...
I1120 01:42:56.387856   33308 interface.go:26] Installing "sample-templates/mariadb" ...
I1120 01:42:56.387863   33308 interface.go:26] Installing "sample-templates/postgresql" ...
I1120 01:42:56.387867   33308 interface.go:26] Installing "sample-templates/dancer quickstart" ...
I1120 01:42:56.387873   33308 interface.go:26] Installing "sample-templates/mysql" ...
I1120 01:42:56.387877   33308 interface.go:26] Installing "sample-templates/cakephp quickstart" ...
I1120 01:42:56.387882   33308 interface.go:26] Installing "sample-templates/rails quickstart" ...
I1120 01:42:56.387914   33308 apply_list.go:67] Installing "sample-templates/rails quickstart"
I1120 01:42:56.388076   33308 apply_list.go:67] Installing "sample-templates/django quickstart"
I1120 01:42:56.388168   33308 apply_list.go:67] Installing "sample-templates/nodejs quickstart"
I1120 01:42:56.388248   33308 apply_list.go:67] Installing "sample-templates/jenkins pipeline ephemeral"
I1120 01:42:56.388341   33308 apply_list.go:67] Installing "sample-templates/sample pipeline"
I1120 01:42:56.388438   33308 apply_list.go:67] Installing "sample-templates/mongodb"
I1120 01:42:56.388609   33308 apply_list.go:67] Installing "sample-templates/mariadb"
I1120 01:42:56.388723   33308 apply_list.go:67] Installing "sample-templates/postgresql"
I1120 01:42:56.388799   33308 apply_list.go:67] Installing "sample-templates/dancer quickstart"
I1120 01:42:56.388909   33308 apply_list.go:67] Installing "sample-templates/mysql"
I1120 01:42:56.388981   33308 apply_list.go:67] Installing "sample-templates/cakephp quickstart"
I1120 01:43:58.037546   33308 interface.go:41] Finished installing "sample-templates/django quickstart" "sample-templates/nodejs quickstart" "sample-templates/jenkins pipeline ephemeral" "sample-templates/sample pipeline" "sample-templates/mongodb" "sample-templates/mariadb" "sample-templates/postgresql" "sample-templates/dancer quickstart" "sample-templates/mysql" "sample-templates/cakephp quickstart" "sample-templates/rails quickstart"
I1120 01:44:01.240798   33308 interface.go:41] Finished installing "centos-imagestreams" "openshift-image-registry" "openshift-router" "openshift-web-console-operator" "sample-templates" "persistent-volumes"
Login to server ...
Error: Internal error occurred: unexpected response: 400

This time, there should be no problem, finally encountered 400 error, presumably internal parameter error, open the browserhttps://127.0.0.1:8443 finally has an interface



Try logging in with the default account dev/dev. It should be installed


https://docs.okd.io/latest/mi…

https://yq.aliyun.com/article…

https://blog.csdn.net/wiborgi…