minishift安装
先下载安装包
https://github.com/minishift/minishift/releases
mac上运行命令
minishift start --vm-driver=virtualbox --registry-mirror=https://docker.mirrors.ustc.edu.cn
运行中会下载一个iso镜像,如果比较慢,就手工下载下来,然后放到相关用户的.minishift相应路径下
我的是 /Users/ericnie/.minishift/cache/iso/centos/v1.12.0
加入path路径后,然后通过
ericdeMacBook-Pro:v1.12.0 ericnie$ minishift start --vm-driver virtualbox -- Starting profile 'minishift' -- Check if deprecated options are used ... OK -- Checking if https://github.com is reachable ... OK -- Checking if requested OpenShift version 'v3.10.0' is valid ... OK -- Checking if requested OpenShift version 'v3.10.0' is supported ... OK -- Checking if requested hypervisor 'virtualbox' is supported on this platform ... OK -- Checking if VirtualBox is installed ... OK -- Checking the ISO URL ... OK -- Checking if provided oc flags are supported ... OK -- Starting the OpenShift cluster using 'virtualbox' hypervisor ... -- Starting Minishift VM ......................... OK -- Checking for IP address ... OK -- Checking for nameservers ... OK -- Checking if external host is reachable from the Minishift VM ... Pinging 8.8.8.8 ... FAIL VM is unable to ping external host -- Checking HTTP connectivity from the VM ... Retrieving http://minishift.io/index.html ... OK -- Checking if persistent storage volume is mounted ... OK -- Checking available disk space ... 37% used OK -- OpenShift cluster will be configured with ... Version: v3.10.0 -- Copying oc binary from the OpenShift container image to VM ... OK -- Starting OpenShift cluster ................................ Getting a Docker client ... Checking if image openshift/origin-control-plane:v3.10 is available ... Checking type of volume mount ... Determining server IP ... Using public hostname IP 192.168.99.100 as the host 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.10 is available ... Starting OpenShift using openshift/origin-control-plane:v3.10 ... I0924 11:02:47.549769 2185 flags.go:30] Running "create-kubelet-flags" I0924 11:02:48.749646 2185 run_kubelet.go:48] Running "start-kubelet" I0924 11:02:49.070376 2185 run_self_hosted.go:172] Waiting for the kube-apiserver to be ready ... I0924 11:03:12.245945 2185 interface.go:26] Installing "kube-proxy" ... I0924 11:03:12.246519 2185 interface.go:26] Installing "kube-dns" ... I0924 11:03:12.246529 2185 interface.go:26] Installing "openshift-apiserver" ... I0924 11:03:12.246570 2185 apply_template.go:83] Installing "openshift-apiserver" I0924 11:03:12.248961 2185 apply_template.go:83] Installing "kube-proxy" I0924 11:03:12.250870 2185 apply_template.go:83] Installing "kube-dns" I0924 11:03:21.826217 2185 interface.go:41] Finished installing "kube-proxy" "kube-dns" "openshift-apiserver" I0924 11:04:05.262675 2185 run_self_hosted.go:224] openshift-apiserver available I0924 11:04:05.263334 2185 interface.go:26] Installing "openshift-controller-manager" ... I0924 11:04:05.263358 2185 apply_template.go:83] Installing "openshift-controller-manager" I0924 11:04:08.089585 2185 interface.go:41] Finished installing "openshift-controller-manager" Adding default OAuthClient redirect URIs ... Adding router ... Adding web-console ... Adding centos-imagestreams ... Adding registry ... Adding sample-templates ... Adding persistent-volumes ... I0924 11:04:08.109483 2185 interface.go:26] Installing "openshift-router" ... I0924 11:04:08.109517 2185 interface.go:26] Installing "openshift-web-console-operator" ... I0924 11:04:08.109527 2185 interface.go:26] Installing "centos-imagestreams" ... I0924 11:04:08.109535 2185 interface.go:26] Installing "openshift-image-registry" ... I0924 11:04:08.109542 2185 interface.go:26] Installing "sample-templates" ... I0924 11:04:08.109549 2185 interface.go:26] Installing "persistent-volumes" ... I0924 11:04:08.113860 2185 apply_list.go:68] Installing "centos-imagestreams" I0924 11:04:08.115257 2185 apply_template.go:83] Installing "openshift-web-console-operator" I0924 11:04:08.117497 2185 interface.go:26] Installing "sample-templates/postgresql" ... I0924 11:04:08.117517 2185 interface.go:26] Installing "sample-templates/cakephp quickstart" ... I0924 11:04:08.117529 2185 interface.go:26] Installing "sample-templates/dancer quickstart" ... I0924 11:04:08.117540 2185 interface.go:26] Installing "sample-templates/django quickstart" ... I0924 11:04:08.117554 2185 interface.go:26] Installing "sample-templates/sample pipeline" ... I0924 11:04:08.117564 2185 interface.go:26] Installing "sample-templates/mongodb" ... I0924 11:04:08.117573 2185 interface.go:26] Installing "sample-templates/mysql" ... I0924 11:04:08.117583 2185 interface.go:26] Installing "sample-templates/rails quickstart" ... I0924 11:04:08.117596 2185 interface.go:26] Installing "sample-templates/jenkins pipeline ephemeral" ... I0924 11:04:08.117606 2185 interface.go:26] Installing "sample-templates/mariadb" ... I0924 11:04:08.117616 2185 interface.go:26] Installing "sample-templates/nodejs quickstart" ... I0924 11:04:08.117730 2185 apply_list.go:68] Installing "sample-templates/nodejs quickstart" I0924 11:04:08.118007 2185 apply_list.go:68] Installing "sample-templates/postgresql" I0924 11:04:08.118198 2185 apply_list.go:68] Installing "sample-templates/cakephp quickstart" I0924 11:04:08.118422 2185 apply_list.go:68] Installing "sample-templates/dancer quickstart" I0924 11:04:08.118483 2185 apply_list.go:68] Installing "sample-templates/django quickstart" I0924 11:04:08.119167 2185 apply_list.go:68] Installing "sample-templates/sample pipeline" I0924 11:04:08.119756 2185 apply_list.go:68] Installing "sample-templates/mongodb" I0924 11:04:08.168681 2185 apply_list.go:68] Installing "sample-templates/mysql" I0924 11:04:08.169096 2185 apply_list.go:68] Installing "sample-templates/rails quickstart" I0924 11:04:08.169257 2185 apply_list.go:68] Installing "sample-templates/jenkins pipeline ephemeral" I0924 11:04:08.169400 2185 apply_list.go:68] Installing "sample-templates/mariadb" I0924 11:04:20.746839 2185 interface.go:41] Finished installing "sample-templates/postgresql" "sample-templates/cakephp quickstart" "sample-templates/dancer quickstart" "sample-templates/django quickstart" "sample-templates/sample pipeline" "sample-templates/mongodb" "sample-templates/mysql" "sample-templates/rails quickstart" "sample-templates/jenkins pipeline ephemeral" "sample-templates/mariadb" "sample-templates/nodejs quickstart" I0924 11:04:20.746863 2185 interface.go:41] Finished installing "openshift-router" "openshift-web-console-operator" "centos-imagestreams" "openshift-image-registry" "sample-templates" "persistent-volumes" Server Information ... OpenShift server started. The server is accessible via web console at: https://192.168.99.100:8443
运行oc-env命令,将路径加到path中
ericdeMacBook-Pro:v1.12.0 ericnie$ minishift oc-env export PATH="/Users/ericnie/.minishift/cache/oc/v3.10.0/darwin:$PATH" # Run this command to configure your shell: # eval $(minishift oc-env)
然后就可以愉快的玩耍了......