0
0
Kubernetesdevops~5 mins

OperatorHub for community operators in Kubernetes - Commands & Configuration

Choose your learning style9 modes available
Introduction
OperatorHub is a place where you can find and install Kubernetes operators made by the community. Operators help you manage complex applications on Kubernetes automatically, saving you time and effort.
When you want to add new capabilities to your Kubernetes cluster without writing complex scripts.
When you need to deploy and manage databases or middleware with automatic updates and backups.
When you want to try community-built operators for popular software like Prometheus or Elasticsearch.
When you want to simplify managing application lifecycle tasks like upgrades and scaling.
When you want to share your own operator with others in the Kubernetes community.
Commands
This command lists all available operators from OperatorHub in the 'olm' namespace where Operator Lifecycle Manager stores them.
Terminal
kubectl get packagemanifests -n olm
Expected OutputExpected
NAME PACKAGE CHANNEL CURRENTCSV AGE prometheus-operator prometheus-operator stable prometheus-operator.v0.47.0 10d etcd etcd stable etcdoperator.v0.9.4 10d elasticsearch elasticsearch-operator stable elasticsearch-operator.v1.2.0 10d
This command installs the Prometheus operator from OperatorHub by applying its installation manifest directly from the web.
Terminal
kubectl create -f https://operatorhub.io/install/prometheus.yaml
Expected OutputExpected
namespace/monitoring created serviceaccount/prometheus-operator created clusterrole.rbac.authorization.k8s.io/prometheus-operator created clusterrolebinding.rbac.authorization.k8s.io/prometheus-operator created deployment.apps/prometheus-operator created
This command checks that the Prometheus operator pods are running in the 'monitoring' namespace after installation.
Terminal
kubectl get pods -n monitoring
Expected OutputExpected
NAME READY STATUS RESTARTS AGE prometheus-operator-5f7d9f7d7b-abcde 1/1 Running 0 2m
This command lists the ClusterServiceVersions (CSVs) which show the installed operator versions and their status.
Terminal
kubectl get csv -n monitoring
Expected OutputExpected
NAME DISPLAY VERSION REPLACES PHASE prometheus-operator.v0.47.0 Prometheus Operator 0.47.0 prometheus-operator.v0.46.0 Succeeded
Key Concept

If you remember nothing else from this pattern, remember: OperatorHub lets you easily find and install community operators to automate managing apps on Kubernetes.

Common Mistakes
Trying to install an operator without Operator Lifecycle Manager (OLM) installed.
Operators from OperatorHub require OLM to manage their lifecycle, so installation will fail or operators won't work properly.
First install OLM on your cluster before installing operators from OperatorHub.
Applying operator manifests from unknown or untrusted sources.
This can lead to security risks or unstable operators running in your cluster.
Always use official OperatorHub URLs or verified sources to install operators.
Not checking the operator pod status after installation.
The operator might fail to start or crash, causing your app management to break silently.
Always verify operator pods are running and healthy with kubectl get pods.
Summary
Use 'kubectl get packagemanifests -n olm' to see available community operators.
Install an operator by applying its manifest from OperatorHub.
Verify operator pods and ClusterServiceVersions to ensure successful installation.