halkyonio / operator

Kubernetes Operator simplifying the development of microservices on k8s !
Apache License 2.0
41 stars 14 forks source link

[Discussion] Provision a service when OLM is present #220

Open cmoulliard opened 4 years ago

cmoulliard commented 4 years ago

Discussion

We should discuss if we will support the idea to provision a service using an operator backed by OLM according to the following use case and conditions.

At the condition that the RBAC used by Halkyon includes the ACL needed to perform the following job, then we could support the deployment of an operator If OLM is deployed on the cluster AND If the capability matches an existing operator from the catalog. In this case, we could generate a Subscription CR.

The capability name could be used to look for an operator which include its name with the CSV:

Examples

1) Prometheus

CSV definition includes the word prometheus within the keywords - https://github.com/operator-framework/community-operators/blob/master/community-operators/prometheus/0.32.0/prometheusoperator.0.32.0.clusterserviceversion.yaml#L310-L318

Subscription to be generated

apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: prometheus
spec:
  channel: beta -> Channel defined within the packageManifest
  installPlanApproval: Automatic
  name: prometheus -> name of the operator
  source: operatorhubio-catalog " name of the catalog -> CatalogSource
  sourceNamespace: olm -> namespace where CatalogSource has been installed

2) AMQP

CSV definition includes the word amqp within the keywords https://github.com/operator-framework/community-operators/blob/master/community-operators/enmasse/0.30.2/enmasse.0.30.2.clusterserviceversion.yaml#L372

Channel and packagename are found here : https://github.com/operator-framework/community-operators/blob/master/community-operators/enmasse/enmasse.package.yaml#L1-L4

Subscription to be generated

apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: amqp
spec:
  channel: alpha
  installPlanApproval: Automatic
  name: enmasse
  source: operatorhubio-catalog
  sourceNamespace: olm