CRC – OpenShift 4 cluster in your pocket

… but only if you have large pockets, that is! 🙂

I suppose that, by now, you’ve already heard of minishift – tool which helps you run a single-node OpenShift 3.x cluster inside a virtual machine (on your preferred hypervisor), which is extremely convenient if you need to do some local development, testing, etc. Of course, you can always deploy what you need on top of Azure or any other cloud provider, but having OpenShift cluster locally can have its benefits.

And what if you need, let’s say, an OpenShift 4.x cluster “to go”?

Don’t worry, there is a solution for you as well! It’s called CodeReady Containers (CRC) (version 1.9 at the time of writing), and is basically a single node OpenShift 4.x cluster, inside a virtual machine (sounds a lot like minishift, doesn’t it?).

So, how can you get your hands on CRC and make it work?

There are a couple of steps involved:

  • download the OpenShift tools (as I’m using Windows, so I’ll use this one):

  • unzip all to a location you like (mine is C:\PocketOpenShift):

  • (optional) add this location to PATH for easier usage (as already mentined, I’m using Windows & PowerShell):

  • run “crc setup” which will prepare the environment:

  • run “crc start” (with one or more options, if needed – as you can see, I’ll be using custom number of vCPUs, amount of RAM and a custom nameserver):

  • at any time, you can check the status of your cluster by using “crc status” command:

  • once it is up, you can use “oc login” or console (bring it up with “crc console“) to connect to it, either as an (kube)admin or a developer, and continue working as you would normally with any other OpenShift cluster:

  • one other thing I like to do is to enable monitoring and other disabled stuff (note though – your VM should have 12+ GB RAM) – you can do it with two commands – first one lists all that is disabled, and the second one, with the index at the end, enables it (also note that in the official documentation there is an issue with “” and (they are switched), if you’re working in PowerShell):

  • monitoring should now be working as well:

And that’s it – you’re ready to work on your own “pocket OpenShift cluster”! 🙂

Of course, don’t forget that there is also the official documentation, including the Getting Started guide and Release Notes and Known Issues document. So… take a look!

Cheers!

Hyper-V reporting script

There’s something nice for all you Hyper-V admins out there – don’t know if you’ve seen it already, but Serhat Akinci (my MVP colleague) made a great script for reporting the health of your Hyper-V hosts, called Get-HyperVReport.

You can use it on local or remote Hyper-V hosts and clusters, schedule and e-mail the reports (something to read while enjoying the morning coffee… or tea Smile), and they look like this:

image

Highlights (from TechNet page):

  • More than 2600+ lines of PowerShell, HTML and CSS code examples
  • Creates a plain but detailed and user-friendly HTML report which is compatible with all modern browsers
  • Provides more detailed information via tooltips in the HTML report. (cells with asteriks and highlighted)
  • Checks and installs required runtime environment prerequisites like Hyper-V and Clustering PowerShell
  • Collects information by using standard Hyper-V and Clustering PowerShell cmdlets and custom WMI queries
  • Shows alerts in the report for certain situations (utilizations, VM checkpoints, replication status, etc.)
  • Can be used directly from command-line or as a scheduled Windows task
  • Supports report delivery via e-mail with advanced options. (authentication, TLS/SSL, multiple recipients)
  • Includes a mode that reports only alerts in the Hyper-V environment. (aka HighlightsOnly mode)
  • Advanced error handling and logging. (Console messages and log file)

Download of this script, and more information about it, is available at TechNet Gallery. And remember – don’t let your Hyper-V hosts run all by themselves! Smile

Cheers!