• Stars
    star
    109
  • Rank 319,077 (Top 7 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created about 6 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Marketplace Operator

Marketplace Operator

Marketplace is a conduit to bring off-cluster operators to your cluster.

Prerequisites

In order to deploy the Marketplace Operator, you must:

  1. Have an OKD or a Kubernetes cluster with Operator Lifecycle Manager (OLM) installed.
  2. Be logged in as a user with Cluster Admin role.

Using the Marketplace Operator

Description

The operator manages one CRD: OperatorSource.

OperatorSource

OperatorSource is used to define the external datastore we are using to store operator bundles.

Here is a description of the spec fields:

  • type is the type of external datastore being described. At the moment we only support Quay's app-registry as our external datastore, so this value should be set to appregistry

  • endpoint is typically set to https:/quay.io/cnr if you are using Quay's app-registry.

  • registryNamespace is the name of your app-registry namespace.

  • displayName and publisher are optional and only needed for UI purposes.

Please see here for an example OperatorSource.

If you want an OperatorSource to work with private app-registry repositories, please take a look at the Private Repo Authentication documentation.

On adding an OperatorSource to an OKD cluster, operators will be visible in the OperatorHub UI in the OKD console. There is no equivalent UI in the Kubernetes console.

The creation of an OperatorSource results in the creation of an OLM CatalogSource in the same namespace the marketplace operator is running in. This CatalogSource will be populated with operators from the OperatorSource ready to be managed by OLM.

Deploying the Marketplace Operator with OKD

The Marketplace Operator is deployed by default with OKD and no further steps are required.

Deploying the Marketplace Operator with Kubernetes

First ensure that the Operator Lifecycle Manager is installed on your cluster.

Deploying the Marketplace Operator

$ kubectl apply -f deploy/upstream

Installing an operator using Marketplace

The following section assumes that Marketplace was installed in the marketplace namespace. For Marketplace to function you need to have at least one OperatorSource CR present on the cluster. To get started you can use the OperatorSource for upstream-community-operators. If you are on an OKD cluster, you can skip this step as the OperatorSource for community-operators is installed by default instead.

$ kubectl apply -f deploy/upstream/07_upstream_operatorsource.cr.yaml

Once the OperatorSource has been successfully deployed, you can discover the operators available using the following command:

$ kubectl get opsrc upstream-community-operators -o=custom-columns=NAME:.metadata.name,PACKAGES:.status.packages -n marketplace
NAME                           PACKAGES
upstream-community-operators   federationv2,svcat,metering,etcd,prometheus,automationbroker,templateservicebroker,cluster-logging,jaeger,descheduler

Note: Please do not install upstream-community-operators and community-operators OperatorSources on the same cluster. The rule of thumb is to install community-operators on OpenShift clusters and upstream-community-operators on upstream Kubernetes clusters.

Now if you want to install the descheduler and jaeger operators, create OLM Subscriptions for desheduler and jaeger in the appropriate namespace. For upstream Kubernetes, this will be marketplace (i.e. the same namespace the CatalogSource created by the OperatorSource is in). This is because marketplace is not a global catalog namespace in upstream Kubernetes.

apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: jaeger
  namespace: marketplace
spec:
  channel: alpha
  name: jaeger
  source: upstream-community-operators
  sourceNamespace: marketplace

For OLM to act on your subscription please note that an OperatorGroup that matches the InstallMode(s) in your CSV needs to be present in the subscription namespace (which is marketplace in this example).

For OKD, the openshift-marketplace namespace is the global catalog namespace, so a subscription to an operator from a CatalogSource in the openshift-marketplace namespace can be created in any namespace.

Uninstalling an operator via the CLI

After an operator has been installed, to uninstall the operator you need to delete the following resources. Below we uninstall the jaeger operator as an example.

Delete the Subscription in the namespace that the operator was installed into. For upstream Kubernetes, this is the marketplace namespace. Keeping to the above example subscription jaeger, we can run the following command to delete it from the command line:

$ kubectl delete subscription jaeger -n marketplace

For OKD, if the install was done via the OpenShift OperatorHub UI, the subscription will be named after the operator's packageName and will be located in the namespace you chose in the UI. By modifying the namespace in the above command it can be used to delete the appropriate subscription.

Delete the ClusterServiceVersion in the namespace that the operator was installed into. This will also delete the operator deployment, pod(s), rbac, and other resources that OLM created for the operator. This also deletes any corresponding CSVs that OLM "Copied" into other namespaces watched by the operator.

$ kubectl delete clusterserviceversion jaeger-operator.v1.8.2 -n marketplace

Populating your own App Registry OperatorSource

Follow the steps here to upload operator artifacts to quay.io.

Once your operator artifact is pushed to quay.io you can use an OperatorSource to add your operator offering to Marketplace. An example OperatorSource is provided here.

An OperatorSource must specify the registryNamespace the operator artifact was pushed to, and set the name and namespace for creating the OperatorSource on your cluster.

Add your OperatorSource to your cluster:

$ oc create -f your-operator-source.yaml

Once created, the Marketplace operator will use the OperatorSource to download your operator artifact from the app registry and display your operator offering in the Marketplace UI.

You can also access private AppRegistry repositories via an authenticated OperatorSource, which you can learn more about here.

Marketplace End to End (e2e) Tests

A full writeup on Marketplace e2e testing can be found here

More Repositories

1

operator-sdk

SDK for building Kubernetes applications. Provides high level APIs, useful abstractions, and project scaffolding.
Go
6,553
star
2

awesome-operators

A resource tracking a number of Operators out in the wild.
3,471
star
3

operator-lifecycle-manager

A management framework for extending Kubernetes with Operators
Go
1,710
star
4

java-operator-sdk

Java SDK for building Kubernetes Operators
Java
794
star
5

getting-started

An end-to-end scenario showing how to use the Operator Framework.
535
star
6

community-operators

The canonical source for Kubernetes Operators that appear on OperatorHub.io, OpenShift Container Platform and OKD.
Dockerfile
419
star
7

operator-sdk-samples

Contains samples of operators built using the operator-sdk
Shell
237
star
8

operator-registry

Operator Registry runs in a Kubernetes or OpenShift cluster to provide operator catalog data to Operator Lifecycle Manager.
Go
188
star
9

helm-app-operator-kit

Tool for creating a Kubernetes Operator from a Helm Chart
Shell
132
star
10

kubectl-operator

Manage Kubernetes Operators from the command line
Go
68
star
11

helm-operator-plugins

Experimental refactoring of the operator-framework's helm operator
Go
47
star
12

rukpak

RukPak runs in a Kubernetes cluster and defines APIs for installing cloud native content
Go
41
star
13

operator-lib

This is a library to help Operator developers
Go
40
star
14

operatorhub.io

TypeScript
39
star
15

josdk-spring-boot-starter

Java
36
star
16

api

Contains the API definitions used by OLM and Marketplace
Go
29
star
17

java-operator-plugins

Operator SDK Java Plugin
Go
26
star
18

community

Community organizational documentations and process for Operator Framework
25
star
19

olm-book

Documentation for OLM
25
star
20

operator-sdk-ansible-util

A collection of Ansible assets for use with Ansible-based operators built with the operator-sdk.
Python
18
star
21

catalogd

On-cluster FBC catalog content server
Go
14
star
22

operator-manifests

Artisanally packaged Kubernetes Operators
Go
14
star
23

kubernetes-webooks-framework

Framework and tooling to support writing admission controllers and conversion hooks for Kubernetes in Java
Java
12
star
24

enhancements

10
star
25

audit

audit operator bundles and catalogs, producing a report.
Go
10
star
26

deppy

Deppy: The dependency resolver for Kubernetes
Go
10
star
27

olm-docs

Hugo doc site for https://github.com/operator-framework/operator-lifecycle-manager
SCSS
10
star
28

java-controller-runtime

Repo for the Java controller-runtime.
Java
8
star
29

combo

Go
8
star
30

olm-broker

Service Catalog integration for OLM
Go
8
star
31

ansible-operator-plugins

Experimental extraction/refactoring of the Operator SDK's ansible operator plugin
Go
7
star
32

operator-manifest-tools

Tooling that enables software release pipelines for operator manifests
Go
7
star
33

operator-controller

Go
7
star
34

cool-catalog

Repository that showcases example workflows for building OLM Catalogs via Declarative Configurations
Dockerfile
6
star
35

oria-operator

Go
5
star
36

index-mermaid-graph

a tool that produces SVG diagrams using OLM graphs as the input
Go
5
star
37

go-appr

Go client bindings for App Registry
5
star
38

operator-framework.io

Website for the framework at https://operatorframework.io
HTML
4
star
39

mock-extension-apiserver

Go
3
star
40

bundle-example

Dockerfile
3
star
41

community-operator-catalog

Community Operator Catalog
Shell
3
star
42

logos

2
star
43

tekton-scorecard-image

a SDK Scorecard custom image for the tekton operator
Java
1
star
44

tilt-support

Library of shared Tilt helpers
Starlark
1
star
45

test-infra

1
star
46

flake-analyzer

Go
1
star