operator-framework / operator-registry

Operator Registry runs in a Kubernetes or OpenShift cluster to provide operator catalog data to Operator Lifecycle Manager.
Apache License 2.0
212 stars 247 forks source link

Document the setup of a ConfigMap Operator Registry #93

Closed flickerfly closed 4 years ago

flickerfly commented 5 years ago

I'm looking through the code to figure out how to setup a ConfigMap Operator Registry. I figured I'd drop what I found which seems like it would be good to document here. I'd be thankful for any corrections.

Arguments to configmap-server

--debug Default: false, "enable debug logging"
--kubeconfig -k Required (or use ENV?) "absolute path to kubeconfig file"
--database -d Default: bundles.db "name of db to output"
--configMapName -c Required "name of a configmap"
--configMapNamespace -n Required "namespace of a configmap"
--port -p Default: 50051 "port number to serve on"

ENVs for configmap-server:

KUBERNETES_SERVICE_HOST
KUBERNETES_SERVICE_PORT

The config map needs to be in the following form

apiVersion: v1
kind: ConfigMap
metadata: 
  name: operator-registry
  namespace: default
data:
  customResourceDefinitions: |-
    Paste Your CRDs Here
  clusterServiceVersions: |-
    Paste Your CSVs Here
  packages: |-
    Paste Your Package YAML here

Relevant Documents: https://github.com/operator-framework/operator-registry/blob/master/configmap-registry.Dockerfile https://github.com/operator-framework/operator-registry/blob/master/configmap.example.yaml https://github.com/operator-framework/operator-registry/tree/master/cmd/configmap-server

flickerfly commented 5 years ago

Also seems important to note that this brings in the ConfigMap and outputs a grpc endpoint so it will not work in older versions of Operator Lifecycle Manager that don't support grpc as a CatalogSource.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

zach-source commented 4 years ago

I created a quick helm chart for deploying a configmap operator registry. You can find it here: https://github.com/zach-source/operatorsdk-configmap-catalog

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

flickerfly commented 4 years ago

I've learned a lot since October. ConfigMap catalogs are not a great idea because they are extremely limited in size. Also, since then the process of building up a grpc catalog has been very much improved. I recommend upgrading OLM to at least 0.12.0 and go with the better catalogs that aren't limited to approximately 3 CSVs.

gmendel commented 3 years ago

@flickerfly do you have links handy of how to deploy a grpc catalog that runs and updateable from the cluster

zach-source commented 3 years ago

@gmendel You'll find information about catalogs here: https://github.com/operator-framework/operator-registry

Once you create an index image using opm you can use CatalogSource CRs with the image spec field to point to a tagged index image. To upgrade you simply update to a new tag on the CatalogSource and it'll update the operator definitions.