Published on
 // 5 min read

The Red Hat Swag Wheel at Gartner


This week I've been at the Gartner IT Symposium/Xpo, held 12-14 September on the Gold Coast, Australia. It's been a fantastic week filled with great food, great discussions, and an autonomous dog!

Gartner dog

Swag, or "plunder", often refers to the fun gifts you can pick up at events like this. We had a bunch of swag we wanted to give away, but due to work, health and safety regulations, weren't permitted a physical "wheel of fortune"-style wheel to give away swag. Fortunately we had an OpenShift cluster available - so we built one!

Creating the swag wheel app

I've been creating a lot of applications in React recently, and fortunately there's an existing package available react-wheel-of-prizes. The react-wheel-of-prizes allows the colours and segments to be customised, and we could simply embed these changes inside a Patternfly app.

  const segments = [
    'Wireless mouse',
    'Water bottle',
    'Power bank',
    'Bouncy ball',
    'Note pad'
  const segColors = [

  const swagContent = (
        onFinished={(winner) => onFinished(winner)}

  return (
      <GridItem span={4}></GridItem>
      <GridItem span={8}>{swagContent}</GridItem>

You can see the final results below, and the code hosted on GitHub here

Swag Wheel

Creating a container

Once we had the Patternfly/React application created, we could simply package this inside a container. I've used a Red Hat Universal Base Image (UBI) for this app. The UBI is a freely accessible and redistributable container base image, derived from Red Hat Enterprise Linux.

COPY dist/ /var/www/html/

RUN yum update --disableplugin=subscription-manager -y && rm -rf /var/cache/yum
RUN yum install --disableplugin=subscription-manager httpd -y && rm -rf /var/cache/yum

COPY conf/httpd.conf /etc/httpd/conf/httpd.conf

RUN chgrp -R 0 /var/log/httpd /var/run/httpd /etc/httpd /var/www/html \
  && chmod -R g=u /var/log/httpd /var/run/httpd /etc/httpd /var/www/html 

USER 1001
ENTRYPOINT ["/usr/sbin/httpd"]

Once created, we could then simply push the image to, and then deploy to OpenShift.

Deploying to OpenShift

I didn't have much time at the conference to build and manage the app, I just needed to get it up and running. oc new-app provided me everything I needed to run the app - it created a Kubernetes service and deployment, and set up an OpenShift image stream. This command also creates the annotations needed to trigger new builds when images are updated.

Updating the swag wheel

We performed seven upgrades of the app over the three days, which you can see reflected in the Quay image tag history:

Swag Wheel History

The process we used to upgrade the app is:

  • Build the app (npm run-script build)
  • Package the container (podman build -t .)
  • Push the container (podman push
  • Tag the OpenShift image stream (oc tag swag-wheel:v1.7)
  • Import the new image (oc import-image swag-wheel:v1.7)
  • Update the OpenShift deployment image triggers

This allowed me to develop locally on my laptop at the event, and then push changes to OpenShift knowing that the app would work, and everyone could win that swag!