If your keen to develop your knowledge around Containers a great place to start is by downloading OpenShift onto your laptop from the RedHat CodeReady Containers site.
Once you have downloaded the file ~2.3GB file and untared the file you are ready to go.
$ crc help CodeReady Containers is a tool that manages a local OpenShift 4.x cluster optimized for testing and development purposes Usage: crc [flags] crc [command] Available Commands: config Modify crc configuration console Open the OpenShift Web Console in the default browser delete Delete the OpenShift cluster help Help about any command ip Get IP address of the running OpenShift cluster oc-env Add the 'oc' binary to PATH setup Set up prerequisites for the OpenShift cluster start Start the OpenShift cluster status Display status of the OpenShift cluster stop Stop the OpenShift cluster version Print version information Flags: -f, --force Forcefully perform an action -h, --help help for crc --log-level string log level (e.g. "debug | info | warn | error") (default "info") Use "crc [command] --help" for more information about a command.
Our first step is crc setup
$ cd crc-macos-1.3.0-amd64 $ ./crc setup INFO Checking if running as non-root INFO Caching oc binary INFO Setting up virtualization with HyperKit INFO Will use root access: change ownership of /Users/rekins/.crc/bin/hyperkit Password: INFO Will use root access: set suid for /Users/rekins/.crc/bin/hyperkit INFO Installing crc-machine-hyperkit INFO Will use root access: change ownership of /Users/rekins/.crc/bin/crc-driver-hyperkit INFO Will use root access: set suid for /Users/rekins/.crc/bin/crc-driver-hyperkit INFO Setting file permissions for /etc/resolver/testing INFO Setting file permissions for /etc/hosts INFO Unpacking bundle from the CRC binary Setup is complete, you can now run 'crc start' to start the OpenShift cluster
Once the setup is complete we can use crc start to start the OpenShift cluster on our laptop.
$ crc start INFO Checking if running as non-root INFO Checking if oc binary is cached INFO Checking if HyperKit is installed INFO Checking if crc-driver-hyperkit is installed INFO Checking file permissions for /etc/resolver/testing INFO Checking file permissions for /etc/hosts ? Copy it from https://cloud.redhat.com/openshift/install/crc/installer-provisioned
Follow the link and download or copy Image Pull Secret
Paste the Pull Secret into the terminal session.
INFO Extracting bundle: crc_hyperkit_4.2.10.crcbundle ... INFO Creating CodeReady Containers VM for OpenShift 4.2.10.. INFO Verifying validity of the cluster certificates ... INFO Network restart not needed INFO Check internal and public DNS query ... INFO Copying kubeconfig file to instance dir ... INFO Cluster TLS certificates have expired, renewing them... INFO Adding user's pull secret ... INFO Updating cluster ID ... INFO Starting OpenShift cluster ... [waiting 3m] INFO INFO To access the cluster, first set up your environment by following 'crc oc-env' instructions INFO Then you can access it by running 'oc login -u developer -p developer https://api.crc.testing:6443' INFO To login as an admin, run 'oc login -u kubeadmin -p #####-#####-#####-##### https://api.crc.testing:6443' INFO INFO You can now run 'crc console' and use these credentials to access the OpenShift web console Started the OpenShift cluster WARN The cluster might report a degraded or error state. This is expected since several operators have been disabled to lower the resource usage. For more information, please consult the documentation
$ crc oc-env export PATH="/Users/rekins/.crc/bin:$PATH" # Run this command to configure your shell: # eval $(crc oc-env)
If all has gone as expected you should now have an up and running OpenShift Cluster, we can access the OpenShift Web Console with crc console providing the credentials above.
$ crc console Opening the OpenShift Web Console in the default browser...
In my next Blog post I will look at deploying an application into my OpenShift cluster.Follow @RonEkins