operator lifecycle manager (olm)可帮助用户安装、更新和管理所有operator以及在用户集群中运行的关联服务的生命周期。operator lifecycle manager是operator framework的一部分,后者是一个开源工具包,用于以有效、自动化且可扩展的方式管理kubernetes operator。
$ k get csv cert-manager.v1.10.2
NAME DISPLAY VERSION REPLACES PHASE
cert-manager.v1.10.2 cert-manager 1.10.2 cert-manager.v1.10.1 Succeeded
$ k get catalogsources -n olm
NAME DISPLAY TYPE PUBLISHER AGE
certified-operators Certified Operators grpc aap-build-team 127m
operatorhubio-catalog Community Operators grpc OperatorHub.io 130m
redhat-operators Red Hat Operators grpc aap-build-team 127m
$ k get subscription
NAME PACKAGE SOURCE CHANNEL
keycloak-operator keycloak-operator operatorhubio-catalog alpha
$ k get subscription keycloak-operator -o yaml
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
generation: 2
labels:
operators.coreos.com/keycloak-operator.keycloak: ""
name: keycloak-operator
namespace: keycloak
resourceVersion: "8739"
uid: efa1e036-ba83-496c-bdc4-17832334ecda
spec:
channel: alpha
installPlanApproval: Manual
name: keycloak-operator
source: operatorhubio-catalog
sourceNamespace: olm
$ k get ip -A
NAMESPACE NAME CSV APPROVAL APPROVED
keycloak install-lm4z5 keycloak-operator.v19.0.3 Automatic true
operators install-gc4sm aap-operator.v2.3.0-0.1674778407 Automatic true
operators install-hgb4n cert-manager.v1.10.2 Automatic true
operators install-x6kgs aap-operator.v2.3.0-0.1674778407 Automatic true
$ k get operatorgroup keycloak-operator-group -o yaml
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
generation: 1
name: keycloak-operator-group
namespace: keycloak
resourceVersion: "7413"
uid: f1f61839-134a-473f-a39b-a5ff62fb9cc6
spec:
targetNamespaces:
- ansible-automation-platform
status:
lastUpdated: "2023-02-01T08:03:52Z"
namespaces:
- ansible-automation-platform
查找operator:
$ k get packagemanifests | grep keycloak-operator
edp-keycloak-operator Community Operators 5h7m
keycloak-operator Community Operators 5h7m
查看operator的installmode和channel:
$ k describe packagemanifests keycloak-operator
创建订阅operatorgroup和subscription:
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: keycloak-operator-group
namespace: keycloak
spec:
targetNamespaces:
- keycloak
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: keycloak-operator
namespace: keycloak
spec:
channel: alpha
installPlanApproval: Manual
name: keycloak-operator
source: operatorhubio-catalog
sourceNamespace: olm
LEo at 00:12