The Operator Lifecycle Manager (OLM) is a component of the Operator Framework that manages the installation, update, and lifecycle of operators running on a Kubernetes cluster.
- A Kubernetes cluster with OLM installed.
- Operator bundle generated and pushed to a registry.
If you are testing locally or publishing a custom catalog, create a CatalogSource to tell OLM where to find the Operator.
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: stellar-catalog
namespace: olm
spec:
sourceType: grpc
image: <your-registry>/stellar-operator-catalog:latest
displayName: Stellar K8s Operators
publisher: 0xOlivanode
updateStrategy:
registryPoll:
interval: 10mCreate a namespace for the operator, and an OperatorGroup to specify its target scope.
apiVersion: v1
kind: Namespace
metadata:
name: stellar-operator-system
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: stellar-operator-group
namespace: stellar-operator-system
spec:
targetNamespaces:
- stellar-operator-systemCreate a Subscription to install the operator from the catalog.
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: stellar-operator-sub
namespace: stellar-operator-system
spec:
channel: alpha
name: stellar-operator
source: stellar-catalog
sourceNamespace: olm
installPlanApproval: AutomaticApply these files:
kubectl apply -f catalog-source.yaml
kubectl apply -f operator-group.yaml
kubectl apply -f subscription.yamlOnce installed, verify the CSV is Succeeded:
kubectl get csv -n stellar-operator-system