Skip to main content

Launch Your First OpenShift Operator


Intro Video

Photo of Treva Williams

Treva Williams

Training Architect







Hands-on Labs


Course Details

OpenShift is a Kubernetes distribution certified by CNCF in 2017, for the Enterprise, but it provides so much more than container orchestration. In this course we will walk through the process of spinning up a small dev environment using MiniShift, then create our own Kubernetes Operator using the newly released OpenShift Operator framework.



About the Course

Intro to Linux Academy


Lesson Description:

Greetings & welcome to my new course on deploying your first Operator using OpenShift! Follow along with the course using this Interactive Diagram.

About the Instructors


Lesson Description:

am an RHCSA 7 Certified Linux and OpenStack sysadmin and content author for Linux Academy. Before starting with Linux Academy, I was a virtualization administrator for 5 years managing Rackspace public cloud infrastructure. I am an OpenStack active technical contributor to the Pike release and am active in several OpenStack, RDO, and Ceph communities and groups. When not OpenStacking or Cephing, I enjoy doggos, candy, cartoons, and playing "So You Think You're a Marine Biologist" on Google.

What's Covered and What's Not Covered


Lesson Description:

In this course, we're going to have a quick introduction to the operator framework on OpenShift, using MiniShift, the single-node proof-of-concept platform for openshift. this course is targeted towards those already experienced with openshift administration. if openshift is new to you, check out my other courses on openshift, then come back!

Kubernetes, but Enterprise

What is OpenShift?


Lesson Description:

OpenShift Container Platform is a platform as a service (PaaS) offering from Red Hat that brings together Docker and Kubernetes, and provides an API to manage these services. Openshift has a microservices-based architecture of smaller, decoupled units that work together, running on top of a kubernetes cluster.

OpenShift, Origin, OKD, Oh My!


Lesson Description:

What's the difference between OpenShift, Origin, & OKD, & what does OKD stand for? I'll answer those questions in this quick video reviewing the differences between Upstream & Enterprise OpenShift.


About MiniShift


Lesson Description:

What is MiniShift & what are the benefits to using it over openshift-ansible? MiniShift is a fast, lightweight, all-in-one OpenShift cluster running OKD - the upstream version of OpenShift - based on code forked from minikube - another tiny-but-powerful dev environment for learning vanilla Kubernetes. It runs OpenShift Origin/OKD in a single VM that is provisioned using the libmachine driver borrowed from Docker, & contains everything you need to familiarize yourself with OpenShift, or to develop new applications for production on the go.

Install MiniShift on Linux


Lesson Description:

MiniShift can be run on RPM-based or .deb systems so long as the Docker Machine KVM driver, named docker-machine-driver-kvm is installed. RPM Linux (RHEL, CentOS, Fedora, etc) Install libvirt & qemu-kvm

$ sudo dnf install libvirt qemu-kvm
If running as a non-root user, add $user to the libvirt (or libvirtd on Ubuntu versions older than 18.10) group
$ sudo usermod -aG libvirt <username>
Update your current session to apply changes:
$ newgrp libvirt
As root, install the Docker KVM driver under /usr/local/bin
# curl -L 
-o /usr/local/bin/docker-machine-driver-kvm
Verify that docker-machine-driver-kvm is executable:
# chmod +x /usr/local/bin/docker-machine-driver-kvm
.Deb Linux (Ubuntu, Debian, etc.)install libvirt & qemu-kvm (note: package may be named libvirt-bin on Ubuntu versions older than 18.10)
$ sudo apt install qemu-kvm libvirt-daemon libvirt-daemon-system
If running as a non-root user, add $user to the libvirt (or libvirtd on Ubuntu versions older than 18.10) group
$ sudo usermod -a -G libvirt <username>
Update your current session to apply changes:
$ newgrp libvirt(d)
As root, install the Docker KVM driver under /usr/local/bin/Ubuntu 16.04 & higher:
# curl -L 
-o /usr/local/bin/docker-machine-driver-kvm
Ubuntu 14.04:
# curl -L 
-o /usr/local/bin/docker-machine-driver-kvm
Make sure that docker-machine-driver-kvm is executable
# chmod +x /usr/local/bin/docker-machine-driver-kvm
On both:Enable & start the libvirtd service
$ sudo systemctl enable --now libvirtd

Installing MiniShift on MacOSX


Lesson Description:

Use Homebrew to install the docker-machine-driver-xhyve hypervisor

$ brew install docker-machine-driver-xhyve
Enable root access for docker-machine-driver-xhyve & add it to wheel
$ sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
Set the SUID for the binary
$ sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve

Install MiniShift on Windows


Lesson Description:

Minishift can run on Windows 7/8/10 machines using either Hyper-v or VirtualBox as a hypervisor. In this video, I will guide you through installing MiniShift using Virtualbox on Windows 8.

Using MiniShift


Lesson Description:

Now that MiniShift is installed, we can start our first cluster with the command: minishift start. In this video I'll show you how to start a simple cluster, how to customize RAM & CPUs, & how to clean up your system once you've completed development.

OpenShift Operator Framework

What are Operators?


Lesson Description:

The Operator Framework, currently in Technology preview with OpenShift v3.11, is an open source project that provides developer and runtime Kubernetes tools, enabling you to accelerate the development of an Operator. The Operator Framework includes:Operator SDK a toolkit that enables developers to build operators based on their own expertise, without requiring knowledge of K8s API complexities.Operator Lifecycle Manager Oversees installation, updates, & management of the lifecycle of all of the operators (& their associated services) running across a K8s cluster.Operator Metering Enables usage reporting for operators that provide specialized services

The Operator Lifecycle Manager


Lesson Description:

The Operator Lifecycle Manager project is a component of the Operator Framework, an open source toolkit to manage Kubernetes native applications, called Operators, in an effective, automated, and scalable way. The OLM extends Kubernetes to provide a declarative way to install, manage, and upgrade operators and their dependencies in a cluster, & also enforces some constraints on the components it manages in order to ensure a good user experience. OLM enables users to:Define applications as a single Kubernetes resource that encapsulates requirements and metadata. Install applications automatically with dependency resolution or manually with nothing but kubectl. Upgrade applications automatically with different approval policies.It consists of the following objects:CustomResourceDefinitions: Subscription, InstallPlan, CatalogSource, ClusterServiceVersionNamespace: openshift-operator-lifecycle-managerService Account: olm-operator-serviceaccountClusterRole: system:controller:operator-lifecycle-managerClusterRoleBinding: olm-operator-binding-openshift-operator-lifecycle-managerCatalogSource: rh-operatorsConfigMap: rh-operatorsDeployments: olm-operator, catalog-operator, package-server

Install the Operator Lifecycle Manager on Minishift


Lesson Description:

Installing the OpenShift Operator lifecycle manager on MiniShift After launching a Minishift cluster, use the following instructions to deploy the Operator Lifecycle Manager & its components. Clone the official OLM repository:

$ git clone
install required objects:
$ oc create -f operator-lifecycle-manager/deploy/okd/manifests/0.7.2/
Verify that OLM CustomResourceDefinitions are available
oc get crds
Verify that the operators are currently running under the openshift-operator-lifecycle-manager namespace:
oc -n openshift-operator-lifecycle-manager get deploy
Verify that the CatalogSource & CatalogSource ConfigMap exist:
oc -n openshift-operator-lifecycle-manager get catalogsource
oc -n openshift-operator-lifecycle-manager get configmap

Launch an etcd Operator


Lesson Description:

Launch an etcd Operator Operators take the pressure off of systems administrators by ensuring that pods remain at a consistent count, replacing any deleted, destroyed, or damaged pods automatically. Launch an etcd operator using the template below, or by using the templates under the [`content-deploy-an-operator/etcd-operator]( Github. create etcd subscription named etcd-alpha-subscription.yaml:

kind: Subscription
  name: etcd
  namespace: myproject 
  channel: alpha
  name: etcd
  source: rh-operators
  installPlanApproval: Manual
Approving the InstallPlan Modify the InstallPlan and set approved to true.
$ oc edit InstallPlan
Once the InstallPlan is set to true, you will see the newly provisioned ClusterServiceVersion, ClusterResourceDefinition, Role and RoleBindings, Service Accounts, and etcd-operator Deployment.
oc get clusterserviceversion
oc get crd
oc get sa
oc get roles
oc get rolebindings
oc get deployments
Creating the Custom Resource Create the etcd-cluster.yaml Cluster manifest.
kind: EtcdCluster
  name: example-etcd-cluster
  size: 3
Create the etcd-cluster.
oc create -f etcd-cluster.yaml
Confirm the cluster has been created:
$ oc get etcdcluster
$ oc get pods

Hands-on Labs are real live environments that put you in a real scenario to practice what you have learned without any other extra charge or account to manage.


Hands-on Labs are real live environments that put you in a real scenario to practice what you have learned without any other extra charge or account to manage.


Use Your Resources

OpenShift Commons


Lesson Description:

Now that you're familiar with Operators on OpenShift, join the OpenShift Commons community to interact with other 'Shifters!

Join the Community


Lesson Description:

Don't forget, as a Linux Academy member you have access to a robust community of fellow students & instructors available to you, as well as a #Slack channel especially for you.

Take this course and learn a new skill today.

Transform your learning with our all access plan.

Start 7-Day Free Trial