Skip to content

Instantly share code, notes, and snippets.

@rhopp
Created June 18, 2020 19:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rhopp/e7b00d7dfae9680460c135ff292e13ff to your computer and use it in GitHub Desktop.
Save rhopp/e7b00d7dfae9680460c135ff292e13ff to your computer and use it in GitHub Desktop.
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: operatorgroup
namespace: <TODO-EXISTING_NAMESPACE>
spec:
targetNamespaces:
- <TODO-EXISTING_NAMESPACE>
apiVersion: operators.coreos.com/v1
kind: OperatorSource
metadata:
name: crw-operatorsource
namespace: openshift-marketplace
spec:
type: appregistry
endpoint: https://quay.io/cnr
registryNamespace: crw
displayName: "Custom Operators"
publisher: "Red Hat"
if operatorsource is not present on cluster
oc apply -f operatorsource.yaml
fi
oc new-project myNamespace
change <TODO-EXISTING_NAMESPACE> to `myNamespace` in all the files
oc apply -f operatorgroup.yaml
oc apply -f subscription.yaml
# Now the situation in the cluster is the same, as you would "install" operator through operatorhub
oc apply -f checluster.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: codeready-workspaces
namespace: <TODO-EXISTING_NAMESPACE>
spec:
channel: latest
installPlanApproval: Automatic
name: codeready-workspaces
source: crw-operatorsource
sourceNamespace: openshift-marketplace
startingCSV: crwoperator.v2.2.0
@nickboldt
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment