Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial operatorhub templates #64

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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