Register (if not) and download the Red Hat Container Development Kit 3 from https://developers.redhat.com/products/cdk/overview.
[tuyen@g73jh Downloads]$ mv cdk-3.10.0-1-minishift-linux-amd64 /usr/local/bin/minishift mv: cannot create regular file '/usr/local/bin/minishift': Permission denied [tuyen@g73jh Downloads]$ sudo mv cdk-3.10.0-1-minishift-linux-amd64 /usr/local/bin/minishift [sudo] password for tuyen: [tuyen@g73jh Downloads]$ ls /usr/local/bin/minishift /usr/local/bin/minishift [tuyen@g73jh Downloads]$ ls -la /usr/local/bin/minishift -rw-rw-r--. 1 tuyen tuyen 501687744 Oct 25 13:26 /usr/local/bin/minishift [tuyen@g73jh Downloads]$ chmod +x /usr/local/bin/minishift [tuyen@g73jh Downloads]$ ls -la /usr/local/bin/minishift -rwxrwxr-x. 1 tuyen tuyen 501687744 Oct 25 13:26 /usr/local/bin/minishift [tuyen@g73jh Downloads]$ cd [tuyen@g73jh ~]$ minishift setup-cdk Setting up CDK 3 on host using '/home/tuyen/.minishift' as Minishift's home directory Copying minishift-rhel7.iso to '/home/tuyen/.minishift/cache/iso/minishift-rhel7.iso' Copying oc to '/home/tuyen/.minishift/cache/oc/v3.11.141/linux/oc' Creating configuration file '/home/tuyen/.minishift/config/config.json' Creating marker file '/home/tuyen/.minishift/cdk' Default add-ons anyuid, admin-user, xpaas, registry-route, che, htpasswd-identity-provider, eap-cd installed Default add-ons anyuid, admin-user, xpaas enabled CDK 3 setup complete. [tuyen@g73jh ~]$
[tuyen@g73jh ~]$ minishift config set vm-driver virtualbox No Minishift instance exists. New 'vm-driver' setting will be applied on next 'minishift start' [tuyen@g73jh ~]$
[tuyen@g73jh ~]$ echo "export MINISHIFT_USERNAME=redhat's-developer-username-here" >> $HOME/.bashrc [tuyen@g73jh ~]$ echo "export MINISHIFT_PASSWORD=redhat's-developer-username-here" >> $HOME/.bashrc [tuyen@g73jh ~]$ source $HOME/.bashrc [tuyen@g73jh ~]$
[tuyen@g73jh ~]$ minishift start -- Starting profile 'minishift' -- Check if deprecated options are used ... OK -- Checking if https://mirror.openshift.com is reachable ... OK -- Checking if requested OpenShift version 'v3.11.141' is valid ... OK -- Checking if requested OpenShift version 'v3.11.141' 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 ... -- Minishift VM will be configured with ... Memory: 4 GB vCPUs : 2 Disk size: 20 GB -- Starting Minishift VM ................................... OK -- Registering machine using subscription-manager Login to registry.redhat.io in progress ......... FAIL Registration in progress ................ OK [38s] -- Checking for IP address ... OK -- Checking for nameservers ... OK -- Checking if external host is reachable from the Minishift VM ... Pinging 8.8.8.8 ... OK -- 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 ... 1% used OK -- Writing current configuration for static assignment of IP address ... OK Importing 'registry.access.redhat.com/openshift3/ose-control-plane:v3.11.141' CACHE MISS Importing 'registry.access.redhat.com/openshift3/ose-docker-registry:v3.11.141' CACHE MISS Importing 'registry.access.redhat.com/openshift3/ose-haproxy-router:v3.11.141' CACHE MISS -- OpenShift cluster will be configured with ... Version: v3.11.141 -- Pulling the OpenShift Container Image ........................... OK -- Copying oc binary from the OpenShift container image to VM ... OK -- Starting OpenShift cluster .............................................................................................. Getting a Docker client ... Checking if image registry.access.redhat.com/openshift3/ose-control-plane:v3.11.141 is available ... Pulling image registry.access.redhat.com/openshift3/ose-cli:v3.11.141 E1025 07:16:17.250672 2894 helper.go:173] Reading docker config from /home/docker/.docker/config.json failed: open /home/docker/.docker/config.json: no such file or directory, will attempt to pull image registry.access.redhat.com/openshift3/ose-cli:v3.11.141 anonymously Image pull complete Pulling image registry.access.redhat.com/openshift3/ose-node:v3.11.141 E1025 07:16:23.130746 2894 helper.go:173] Reading docker config from /home/docker/.docker/config.json failed: open /home/docker/.docker/config.json: no such file or directory, will attempt to pull image registry.access.redhat.com/openshift3/ose-node:v3.11.141 anonymously Pulled 6/7 layers, 87% complete Pulled 6/7 layers, 95% complete Pulled 7/7 layers, 100% complete Extracting Image pull complete Checking type of volume mount ... Determining server IP ... Using public hostname IP 192.168.99.101 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 registry.access.redhat.com/openshift3/ose-control-plane:v3.11.141 is available ... Starting OpenShift using registry.access.redhat.com/openshift3/ose-control-plane:v3.11.141 ... I1025 07:17:39.279789 2894 config.go:40] Running "create-master-config" I1025 07:17:46.656321 2894 config.go:46] Running "create-node-config" I1025 07:17:48.838389 2894 flags.go:30] Running "create-kubelet-flags" I1025 07:17:49.655241 2894 run_kubelet.go:49] Running "start-kubelet" I1025 07:17:50.048099 2894 run_self_hosted.go:181] Waiting for the kube-apiserver to be ready ... I1025 07:20:09.105027 2894 interface.go:26] Installing "kube-proxy" ... I1025 07:20:09.105072 2894 interface.go:26] Installing "kube-dns" ... I1025 07:20:09.105092 2894 interface.go:26] Installing "openshift-service-cert-signer-operator" ... I1025 07:20:09.105110 2894 interface.go:26] Installing "openshift-apiserver" ... I1025 07:20:09.105158 2894 apply_template.go:81] Installing "openshift-apiserver" I1025 07:20:09.106259 2894 apply_template.go:81] Installing "kube-proxy" I1025 07:20:09.107957 2894 apply_template.go:81] Installing "kube-dns" I1025 07:20:09.108355 2894 apply_template.go:81] Installing "openshift-service-cert-signer-operator" I1025 07:20:24.361574 2894 interface.go:41] Finished installing "kube-proxy" "kube-dns" "openshift-service-cert-signer-operator" "openshift-apiserver" I1025 07:24:27.450806 2894 run_self_hosted.go:242] openshift-apiserver available I1025 07:24:27.451919 2894 interface.go:26] Installing "openshift-controller-manager" ... I1025 07:24:27.451958 2894 apply_template.go:81] Installing "openshift-controller-manager" I1025 07:24:35.364267 2894 interface.go:41] Finished installing "openshift-controller-manager" Adding default OAuthClient redirect URIs ... Adding router ... Adding web-console ... Adding registry ... Adding rhel-imagestreams ... Adding sample-templates ... Adding persistent-volumes ... I1025 07:24:35.577834 2894 interface.go:26] Installing "openshift-router" ... I1025 07:24:35.577859 2894 interface.go:26] Installing "openshift-web-console-operator" ... I1025 07:24:35.577889 2894 interface.go:26] Installing "openshift-image-registry" ... I1025 07:24:35.577909 2894 interface.go:26] Installing "rhel-imagestreams" ... I1025 07:24:35.577926 2894 interface.go:26] Installing "sample-templates" ... I1025 07:24:35.577944 2894 interface.go:26] Installing "persistent-volumes" ... W1025 07:24:35.579599 2894 create_secret.go:78] Error reading $HOME/.docker/config.json: open /home/docker/.docker/config.json: no such file or directory, imagestream import credentials will not be setup I1025 07:24:35.579712 2894 apply_list.go:67] Installing "rhel-imagestreams" I1025 07:24:35.579977 2894 interface.go:26] Installing "sample-templates/mongodb" ... I1025 07:24:35.580001 2894 interface.go:26] Installing "sample-templates/mysql" ... I1025 07:24:35.580020 2894 interface.go:26] Installing "sample-templates/django quickstart" ... I1025 07:24:35.580039 2894 interface.go:26] Installing "sample-templates/rails quickstart" ... I1025 07:24:35.580059 2894 interface.go:26] Installing "sample-templates/sample pipeline" ... I1025 07:24:35.580076 2894 interface.go:26] Installing "sample-templates/mariadb" ... I1025 07:24:35.580094 2894 interface.go:26] Installing "sample-templates/postgresql" ... I1025 07:24:35.580112 2894 interface.go:26] Installing "sample-templates/cakephp quickstart" ... I1025 07:24:35.580130 2894 interface.go:26] Installing "sample-templates/dancer quickstart" ... I1025 07:24:35.580148 2894 interface.go:26] Installing "sample-templates/nodejs quickstart" ... I1025 07:24:35.580166 2894 interface.go:26] Installing "sample-templates/jenkins pipeline ephemeral" ... I1025 07:24:35.580263 2894 apply_list.go:67] Installing "sample-templates/jenkins pipeline ephemeral" I1025 07:24:35.580618 2894 apply_list.go:67] Installing "sample-templates/mongodb" I1025 07:24:35.581014 2894 apply_list.go:67] Installing "sample-templates/mysql" I1025 07:24:35.581030 2894 apply_template.go:81] Installing "openshift-web-console-operator" I1025 07:24:35.581278 2894 apply_list.go:67] Installing "sample-templates/django quickstart" I1025 07:24:35.581510 2894 apply_list.go:67] Installing "sample-templates/nodejs quickstart" I1025 07:24:35.581875 2894 apply_list.go:67] Installing "sample-templates/mariadb" I1025 07:24:35.581892 2894 apply_list.go:67] Installing "sample-templates/postgresql" I1025 07:24:35.582160 2894 apply_list.go:67] Installing "sample-templates/rails quickstart" I1025 07:24:35.582175 2894 apply_list.go:67] Installing "sample-templates/cakephp quickstart" I1025 07:24:35.582432 2894 apply_list.go:67] Installing "sample-templates/sample pipeline" I1025 07:24:35.582500 2894 apply_list.go:67] Installing "sample-templates/dancer quickstart" I1025 07:25:13.968160 2894 interface.go:41] Finished installing "sample-templates/mongodb" "sample-templates/mysql" "sample-templates/django quickstart" "sample-templates/rails quickstart" "sample-templates/sample pipeline" "sample-templates/mariadb" "sample-templates/postgresql" "sample-templates/cakephp quickstart" "sample-templates/dancer quickstart" "sample-templates/nodejs quickstart" "sample-templates/jenkins pipeline ephemeral" I1025 07:26:07.634080 2894 interface.go:41] Finished installing "openshift-router" "openshift-web-console-operator" "openshift-image-registry" "rhel-imagestreams" "sample-templates" "persistent-volumes" Login to server ... Creating initial project "myproject" ... Server Information ... OpenShift server started. The server is accessible via web console at: https://192.168.99.101:8443/console You are logged in as: User: developer Password:To login as administrator: oc login -u system:admin -- Applying addon 'admin-user':.. -- Applying addon 'anyuid':. Add-on 'anyuid' changed the default security context constraints to allow pods to run as any user. Per default OpenShift runs containers using an arbitrarily assigned user ID. Refer to https://docs.okd.io/latest/architecture/additional_concepts/authorization.html#security-context-constraints and https://docs.okd.io/latest/creating_images/guidelines.html#openshift-origin-specific-guidelines for more information. -- Applying addon 'xpaas':.. XPaaS imagestream and templates for OpenShift installed See https://github.com/openshift/openshift-ansible/tree/release-3.11/roles/openshift_examples/files/examples -- Exporting of OpenShift images is occuring in background process with pid 21070. [tuyen@g73jh ~]$
Check VirtualBox GUI to see new created VM named minishift. We can also run 'vboxmanage list runningvms' to check that minishiftvm.
[tuyen@g73jh ~]$ minishift oc-env export PATH="/home/tuyen/.minishift/cache/oc/v3.11.141/linux:$PATH" # Run this command to configure your shell: # eval $(minishift oc-env) [tuyen@g73jh ~]$ eval $(minishift oc-env) [tuyen@g73jh ~]$ oc version oc v3.11.141 kubernetes v1.11.0+d4cacc0 features: Basic-Auth GSSAPI Kerberos SPNEGO Server https://192.168.99.101:8443 kubernetes v1.11.0+d4cacc0 [tuyen@g73jh ~]$
[tuyen@g73jh ~]$ oc login -u system:admin Logged into "https://192.168.99.101:8443" as "system:admin" using existing credentials. You have access to the following projects and can switch between them with 'oc project': default kube-dns kube-proxy kube-public kube-system * myproject openshift openshift-apiserver openshift-controller-manager openshift-core-operators openshift-infra openshift-node openshift-service-cert-signer openshift-web-console Using project "myproject". [tuyen@g73jh ~]$
Access Web Console, and login with username 'developer' and password 'anything you like' (say 'ocp').