Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Git-based operations (GitOps) for Operators managed by Operator Lifecycle Manager (OLM)

August 20, 2024
Ian Tewksbury
Related topics:
Automation and managementDevOpsDevSecOpsGitOpsHelmKubernetesOperators
Related products:
Red Hat OpenShift

Share:

The Operator Framework was paradigm shifting for managing infrastructure and providing services to users on Kubernetes by introducing a methodology for capturing a human operator's knowledge as a Kubernetes-native application, an Operator. The Operator Lifecycle Manager (OLM) brought systematic installation, removal, and update management for Operators. In parallel, the rise and recognition of the power and need for Git-based operations (GitOps) has brought much needed consistent, repeatable, and scalable management of not only Kubernetes and its surrounding ecosystem, but the management of the entire platform as a software product with full software development lifecycle (SLDC) for all the reasons end user applications have been refining their SDLC for all these years.

Challenge

OLM only offers two modes for operator installation and upgrade management: Manual and Automatic. In Automatic mode, the OLM will automatically update to the latest version of the given Operator as it becomes available in a subscribed channel. In Manual mode, the user must manually update the target minimal Operator version, including manually approving the installation and manually incrementing through required, phased updates. This prevents a user from moving between versions directly (ex: 1.1 to 1.5) because the user needs to move incrementally up to the target version (1.2, 1.3, and 1.4), resulting in a laborious process.

In the case of Automatic mode, you can easily capture in Git the required OLM Kubernetes custom resources in order to set the target Operator for automatic updates in a given channel. Oftentimes, an Operator maintains a latest channel as well as a channel for each major X version in semantic version (semver) format with no breaking changes in minor Y versions.

In the case of Manual mode, while you can set the startingCSV in the Subscription, you then have to manually approve the InstallPlan once it becomes available. While the Subscription can be captured in git, since the InstallPlan is automatically generated by the OLM, additional intervention is required given that the InstallPlan is not tracked. One potential option is to capture the generated InstallPlan in Git, set the approved value to true and have the resource be reconciled. However, these additional steps of manual intervention goes against the spirit of Git-based operations.

This ultimately leaves us with two options:

  • Use Git-based operations and set Operators to use the automatic update approval strategy and hope that an update doesn’t come through that doesn’t put you in a situation of untested automatic braking production updates.
    • We all recently experienced the (when, not if) eventually of this globally in late July 2024, when security software vulnerability definitions loaded at the kernel level in Microsoft Windows by a third-party tool were automatically updated with a corrupted vulnerabilities definition file, which caused infinite boot loop errors bringing down production systems and disrupting global air travel, banking, and government services among others
  • Break the flow of Git-based operations and manually control Operator versions, but benefit in avoiding unexpected production changes.

Or….

Using the operators-installer Helm chart

Luckily, in our open source software based world, if you do not like any of your options, you can create a new one.

Enter option 3, the community built and maintained operators-installer Helm chart used in production by a community of individuals who also encountered these challenges in their production operations.

This Helm chart solves the challenge of GitOps for OLM managed Operators. It accomplishes this by providing a Helm chart you can invoke directly, use as a dependent Helm chart, or as a Helm chart called by kustomize (my preferred method) which allows you to set the approval mode to Manual and specify an operator version, and then the Helm chart will take care of automatically approving the appropriate InstallPlan(s) for you, which the Helm chart would conveniently assume is what you wanted if you were incrementing the Operator version.

Additionally, the chart also handles incrementally upgrading operator versions which avoids the time consuming process of manually determining and then stepping through each required intermediate version.

And lastly, if there are any Operators that you want to place in automatic approval mode, that can be accomplished as well, which allows for a consistent way to manage operators regardless of approval method.

The result with option 3 is that you can truly achieve declarative Git-based operations with fixed Operator versions with intuitive controlled Operator updates!

Examples

The following are several examples demonstrating how the Helm chart can be used. Additional methods can also be found within the chart documentation and tests.

Helm called by kustomize

Install the external-secrets-operator using operators-installer via kustomize:

---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
helmCharts:
- name: operators-installer
  repo: https://redhat-cop.github.io/helm-charts
  version: 3.0.1
  valuesInLine:
    operatorGroups:
    - name: external-secrets-operator
      createNamespace: true
      targetOwnNamespace: false
    operators:
    - channel: stable
      installPlanApproval: Manual
      name: external-secrets-operator
      source: community-operators
      sourceNamespace: olm
      csv: external-secrets-operator.v0.8.1
      namespace: external-secrets-operator

As a Helm subchart

Instal the external-secrets-operator using operators-installer via Helm.

Chart.yaml:

---
apiVersion: v2
name: example-my-org-ops
description: example declarative install of operator
type: application
version: 1.0.0
dependencies:
- name: operators-installer
  version: "3.0.1"
  repository: "https://redhat-cop.github.io/helm-charts"

operator-installtions-values.yaml:

---
operators-installer:
  operatorGroups:
  - name: external-secrets-operator-2
    createNamespace: true
    targetOwnNamespace: false
  operators:
  - channel: stable
    installPlanApproval: Manual
    name: external-secrets-operator
    source: community-operators
    sourceNamespace: olm
    csv: external-secrets-operator.v0.8.1
    namespace: external-secrets-operator-2
    installPlanVerifierActiveDeadlineSeconds: 1200

Direct from Helm

CLI:

helm upgrade -i --repo=https://redhat-cop.github.io/helm-charts operators-installer -f operator-installtions-values.yaml

Caveats

  • The operators-installer Helm chart is community maintained and not supported by Red Hat.
  • While the operators-installer Helm chart can automatically increment through Operator versions, support is not currently available to verify whether an Operator upgrade causes issues other than verifying the installation of the new Operator version was successful. The end user should test and verify any operator upgrades in lower environments to ensure no issues occur, such as API changes.
  • As the Operator Framework does not support the ability to perform rollbacks, the operators-installer Helm chart does not either.

Getting help

If you are excited about this solution to solve your current problems, reach out to the community for free (as in pizza) help by opening a Git issue.

Future

There are currently two features in Tech Preview status in Red Hat products that are intended to address the root challenge of declarative Git-based operations for upgrading operators managed by OLM.

OLM v1.0 is designed to solve many of these problems and as of Red Hat OpenShift 4.16 is in Tech Preview. This is done by deprecating the pre 1.0 OLM custom resource definitions and introducing ClusterExtension which, among other things, replaces the old Automatic and Manual modes and startingCSV in the Subscription with a version parameter which supports declaring ranges.

Additionally, Red Hat Advanced Cluster Manager has a new OperatorPolicy custom resource in Tech Preview that takes a similar approach to the operators-installer Helm chart which could be a great supported alternative if you are a user of Advanced Cluster Management, once it leaves Teach Preview status.

In the meantime, we have the operators-installer.

Related Posts

  • Deploying Kubernetes Operators with Operator Lifecycle Manager bundles

  • Operator integration testing for Operator Lifecycle Manager

  • Introduction to the Kubernetes Operator Framework

  • Why should developers care about GitOps?

  • GitOps: Stop, collaborate and deploy

Recent Posts

  • Meet the Red Hat Node.js team at PowerUP 2025

  • How to use pipelines for AI/ML automation at the edge

  • What's new in network observability 1.8

  • LLM Compressor: Optimize LLMs for low-latency deployments

  • How to set up NVIDIA NIM on Red Hat OpenShift AI

What’s up next?

GitOps has become a standard in deploying applications to Kubernetes, and many companies are adopting the methodology for their DevOps and cloud-native strategy. Download the GitOps Cookbook for useful recipes and examples for successful hands-on applications development and deployment with GitOps.

Get the e-book
Red Hat Developers logo LinkedIn YouTube Twitter Facebook

Products

  • Red Hat Enterprise Linux
  • Red Hat OpenShift
  • Red Hat Ansible Automation Platform

Build

  • Developer Sandbox
  • Developer Tools
  • Interactive Tutorials
  • API Catalog

Quicklinks

  • Learning Resources
  • E-books
  • Cheat Sheets
  • Blog
  • Events
  • Newsletter

Communicate

  • About us
  • Contact sales
  • Find a partner
  • Report a website issue
  • Site Status Dashboard
  • Report a security problem

RED HAT DEVELOPER

Build here. Go anywhere.

We serve the builders. The problem solvers who create careers with code.

Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

Sign me up

Red Hat legal and privacy links

  • About Red Hat
  • Jobs
  • Events
  • Locations
  • Contact Red Hat
  • Red Hat Blog
  • Inclusion at Red Hat
  • Cool Stuff Store
  • Red Hat Summit

Red Hat legal and privacy links

  • Privacy statement
  • Terms of use
  • All policies and guidelines
  • Digital accessibility

Report a website issue

OSZAR »