Skip to content

Commit

Permalink
Add initial operatorhub templates (#64)
Browse files Browse the repository at this point in the history
* Add initial operatorhub templates

* Fix CI: yaml -> yml

* Add ordered list; Set namespace from cli or applier
  • Loading branch information
tylerauerbeck authored and pabrahamsson committed Nov 8, 2019
1 parent 9e9c193 commit 65ff835
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 0 deletions.
11 changes: 11 additions & 0 deletions operatorhub/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# OperatorHub

The below templates are used to deploy Operators from OperatorHub without having to interact with the WebUI.

To do this you would create the following in order:

1. [OperatorGroup](operatorgroup.yml)
1. [CatalogSourceConfig](catalogsourceconfig.yml)
1. [Subscription](subscription.yml)

For more details, you can see the documention [here](https://docs.openshift.com/container-platform/4.1/applications/operators/olm-adding-operators-to-cluster.html#olm-installing-operator-from-operatorhub-using-cli_olm-adding-operators-to-a-cluster).
25 changes: 25 additions & 0 deletions operatorhub/catalogsourceconfig.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
apiVersion: v1
kind: Template
message: |-
The following CatalogSourceConfig has been created: ${NAME}
metadata:
name: catalogsourceconfig-template
objects:
- apiVersion: operators.coreos.com/v1
kind: CatalogSourceConfig
metadata:
name: ${NAME}
spec:
packages: "${OPERATORS}"
targetNamespace: "${OPERATOR_NAMESPACE}"
parameters:
- name: NAME
required: true
description: Name of the CatalogSourceConfig to create
- name: OPERATOR_NAMESPACE
value: openshift-operators
description: Namespace where you want the operator to be available
- name: OPERATORS
required: true
description: a single or comma-seperated list of operators which you want to subscribe to
22 changes: 22 additions & 0 deletions operatorhub/operatorgroup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
apiVersion: v1
kind: Template
message: |-
The following OperatorGroup has been created: ${NAME}
metadata:
name: operatorgroup-template
objects:
- apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: ${NAME}
spec:
targetNamespaces:
- ${TARGET_NAMESPACE}
parameters:
- name: NAME
required: true
description: Name of the OperatorGroup to create
- name: TARGET_NAMESPACE
required: true
description: A namespace for the OperatorGroup to target
37 changes: 37 additions & 0 deletions operatorhub/subscription.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
apiVersion: v1
kind: Template
message: |-
The following subscription has been created: ${NAME}
metadata:
name: subscription-template
objects:
- apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: "${NAME}"
spec:
channel: "${CHANNEL}"
installPlanApproval: ${INSTALL_PLAN}
name: ${OPERATOR_NAME}
source: ${CATALOG_SOURCE_NAME}
sourceNamespace: ${OPERATOR_NAMESPACE}
parameters:
- name: NAME
required: true
description: Name of the subscription you would like to create
- name: OPERATOR_NAME
required: true
description: Name of the operator you would like to subscribe to
- name: OPERATOR_NAMESPACE
value: openshift-operators
description: Namespace where the operator is running
- name: CHANNEL
value: preview
description: Name of the channel that you are subscribing to
- name: INSTALL_PLAN
value: Automatic
description: Install plan that you would like to use (Automatic or Manual)
- name: CATALOG_SOURCE_NAME
required: true
description: Name of the catalog source item that was created

0 comments on commit 65ff835

Please sign in to comment.