operators-installer

by joaquinito2051

Helm chartv3.5.2

Installs a given list of operators either using Automatic or Manual InstallPlans. If Manual then version of operator can be controlled declarativly.

About this chart

operators-installer

Installs a given list of operators either using Automatic or Manual InstallPlans. If Manual then version of operator can be controlled declaratively.

  • Purpose
  • Configuration
  • Warnings
    • Can not install / upgrade different operators in same namespace independently
    • ArgoCD / Red Hat OpenShift GitOps Sync Status and Health Checks
  • Caveats
    • Rollbacks

Purpose

There is no native way to declaratively control the version of installed operators. If you set to Automatic, then operators will auto upgrade, breaking declarative, if set to Manual then human has to go manually approve. This helm chart allows for setting to Manual but having the helm chart automatically approve the correct InstallPlan for the specific version, so as not to accidentally approve a newer InstallPlan.

Configuration

For all of the Subscription parameters see

ParameterDefault ValueRequired?Description
operators[]NoList of operators to install.
operators[].channelYesSubscription channel.
operators[].installPlanApprovalYesSubscription installPlanApproval.
operators[].nameYesSubscription name.
operators[].sourceYesSubscription source.
operators[].sourceNamespaceYesSubscription sourceNamespace.
operators[].configNoSubscription config.
operators[].csvYesThe CSV to install.
operators[].installPlanApproverRetries10NoNumber of InstallPlan approver retries. When installPlanApproverWaitLoopInsideJob is false, this controls the Kubernetes Job backoffLimit. When true, this controls the number of InstallPlan lookup attempts made inside the Job.
operators[].installPlanApproverActiveDeadlineSecondsNoneNoTotal amount of time that can be spent waiting for InstallPlan to be approved. If having issues with InstallPlans never finishing to install and thus approval job getting infinity stuck, set this to some reasonable number. But, keep in mind if automaticIntermediateManualUpgrades is true then it can take a while to increment through a bunch of intermediate installs on the way to the specified csv if an old csv is already installed.
operators[].installPlanApproverWaitLoopInsideJobfalseNoWhen true, the InstallPlan approver waits and retries for the InstallPlan inside the Job Pod instead of relying on Kubernetes Job retries. The number of attempts is controlled by installPlanApproverRetries and the overall Job runtime is limited by installPlanApproverActiveDeadlineSeconds.
operators[].installPlanVerifierRetries10NoNumber of InstallPlan verifier retries. When installPlanVerifierWaitLoopInsideJob is false, this controls the Kubernetes Job backoffLimit. When true, this controls the number of InstallPlan lookup attempts made inside the Job.
operators[].installPlanVerifierActiveDeadlineSecondsNoneNoTotal amount of time that can be spent waiting for InstallPlan to finish installing. This may need to increase of an operator takes a long time to install. If having issues with InstallPlans never finishing to install and thus verify job getting infinity stuck, set this to some reasonable number. But, keep in mind if automaticIntermediateManualUpgrades is true then it can take a while to increment through a bunch of intermediate installs on the way to the specified csv if an old csv is already installed.
operators[].installPlanVerifierWaitLoopInsideJobfalseNoWhen true, the InstallPlan verifier waits and retries for the InstallPlan inside the Job Pod instead of relying on Kubernetes Job retries. The number of attempts is controlled by installPlanVerifierRetries and the overall Job runtime is limited by installPlanVerifierActiveDeadlineSeconds.
operators[].namespace.Release.NamespaceNoSpecify the namespace to install the operator into, which allows different operators to be installed into different namespaces from the same chart.
operators[].automaticIntermediateManualUpgradesfalseIf true and installPlanApproval is Manual and there are required intermediate upgrades between the currently installed csv and the specified csv, automatically inclemently install those intermediate versions until reaching the specified csv. If false and there are required intermediate upgrades then chart will fail.
operators[].automaticIntermediateManualUpgradesIncrementalInstallBackoffLimit10NoWhen automaticIntermediateManualUpgrades is true, the number of retries for installing and then then verifying each incremental install
operators[].automaticIntermediateManualUpgradesIncrementalInstallDelayIncrement5NoWhen automaticIntermediateManualUpgrades is true, the delay increment to scale by attempts to wait between each retry of installing or verifying each incremental install
operatorGroups[]NoOptional list of configuration for OperatorGroups. If this is not supplied then it is assumed OperatorGroups are already in place in the selected operators[].namespaces.
operatorGroups[].name.Release.NamespaceNoName of the OperatorGroup & Namespace the OperatorGroup will be placed in.
operatorGroups[].createNamespacefalseNoIf true create the Namespace of the same name of the OperatorGroup. If false assumed the Namespace is already in place.
operatorGroups[].namespaceLabels{}NoLabels to add to the created OperatorGroup namespace.
operatorGroups[].targetOwnNamespacefalseNoIf true add the OperatorGroup's Namespace as a targetNamespaces. If true then OperatorGroup will only work for Operators using OwnNamespace or MultiNamespace installModes. If blank and no otherTargetNamespaces specified then OperatorGroup will be configured to allow for operators using installModes AllNamespaces.
operatorGroups[].otherTargetNamespaces[]NoList of additional Namespaces to target. If specified OperatorGroup will only work for operators using SingleNamespace or MultiNamespace installModes depending on value of targetOwnNamespace.
installPlanApproverAndVerifyJobsImageregistry.redhat.io/openshift4/ose-cli:v4.10YesImage to use for the InstallPlan Approver and Verify Jobs
installPlanApproverAndVerifyJobsImagePullSecret''NoName of existing secret for pulling installPlanApproverAndVerifyJobsImage from a private registry
approveManualInstallPlanViaHooktrueNotrue to create (and clean up) manual InstallPlan approval resources as part of post-install,post-upgrade helm hookfalse to create manual InstallPlan approval resources as part of normal installThe hook method is nice to not have lingering resources needed for the manual InstallPlan approval but has the downside that no CustomResources using CustomResourceDefinitions installed by the operator can be used in the same chart because the operator InstallPlan wont be approved, and therefor the operator wont be installed, until the post-install,post-upgrade phase which means you will never get to that phase because your CustomResources wont be able to apply because the Operator isn't installed.This is is ultimately a trade off between cleaning up these resources or being able to install and configure the operator in the same helm chart that has a dependency on this helm chart.
installPlanApproverAndVerifyJobsTolerations[]NoTolerations to apply to the approver and verify Jobs. See Kubernetes documentation on tolerations.
installPlanApproverAndVerifyJobsExtraEnv[]NoExtra environment variables to add to the InstallPlan Approver and Verify Job containers. Useful for injecting proxy configuration. Each entry should have name and value (or valueFrom) fields.
installRequiredPythonLibrariestrueNoIf true, install the required Python libraries (openshift-client, semver==2.13.0) dynamically from the given pythonIndexURL and pythonExtraIndexURL into the installPlanApproverAndVerifyJobsImage at run time
pythonIndexURLhttps://pypi.org/simple/NoIf installRequiredPythonLibraries is true then use this python index to pull required libraries
pythonExtraIndexURLhttps://pypi.org/simple/NoIf installRequiredPythonLibraries is true then use this python extra index to pull required library dependencies
commonLabels{}NoCommon labels to add to all chart created resources. Implements the same idea from Kustomize for this chart.
global.commonLabels{}NoCommon labels coming from global values to add to all chart created resources. Implements the same idea from Kustomize for this chart.

Warnings

Disconnected Use

If wanting use this chart in a disconnected environment you need to either:

Option 1: local python index

Set the pythonIndexURL and pythonExtraIndexURL values to a local disconnected python index that minimally includes (and their dependencies):

  • openshift-client
  • semver==2.13.0

Option 2: custom installPlanApproverAndVerifyJobsImage with required dependencies

Build a custom container image with:

  • binary - oc
  • python lib - openshift-client
  • python lib - semver==2.13.0

Suggestion is to build such an image on top of the latest registry.redhat.io/openshift4/ose-cli image

Then provide that custom image to installPlanApproverAndVerifyJobsImage and set installRequiredPythonLibraries to false.

HTTP Proxy

If your environment requires an HTTP proxy for internet access, use installPlanApproverAndVerifyJobsExtraEnv to inject proxy environment variables into the approver and verifier Job containers:

installPlanApproverAndVerifyJobsExtraEnv:
  - name: HTTP_PROXY
    value: "http://proxy.example.com:3128"
  - name: HTTPS_PROXY
    value: "http://proxy.example.com:3128"
  - name: NO_PROXY
    value: ".cluster.local,10.0.0.0/8"

This is needed when installRequiredPythonLibraries is true (the default), as pip install requires network access to download Python packages from pythonIndexURL.

Can not install / upgrade different operators in same namespace independently

As documented in How can Operators be updated independently from each other? when more then one operator install or update is pending in the same namespace the Operator Lifecycle Manager (OLM) will combine those installs/updates into a single InstallPlan and there is no way to separate them. Therefor if you use this helm chart in namespace ZZZ to install operator A at v1.0 and it has a pending update to v1.1 and then update the configuration to also install operator B at v42.0 in namespace ZZZ the ZZZ v42.0 InstallPlan and the A v1.1 InstallPlan will get merged (by OLM) and this helm chart will then approve that InstallPlan as it will match on the ZZZ v42.0 pending install, which will incidentally install the A v1.1 update.

There is no way for this or any helm chart, automation, or even click ops to prevent this, as documented in How can Operators be updated independently from each other? this is currently considered "a feature of OLM".

Therefor if you do not want this unintentional behavior, which these helm chart righters assume you don't since you are going to the trouble of declaratively controlling your operator versions, your only current option is to only have one operator installed per namespace, which primarily means don't use the openshift-operators namespace, or if you do, only use it for one operator, maybe OpenShift GitOps (ArgoCD).

ArgoCD / Red Hat OpenShift GitOps Sync Status and Health Checks

If using this helm chart with ArgoCD / Red Hat OpenShift GitOps then you will need to patch how ArgoCD does health checks on Subscriptions by default because the default health check will fail if there is any pending instal

Deploy operators-installer with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has operators-installer on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartoperators-installer is pinned at v3.5.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply