Add operators in OKD or OpenShift with YAML files¶
Normally you want to install operators not via the Web console. It's more GitOps to install them with a manifest. Here comes a short description how this is done easily!
Find the parameters of your operator¶
-
Web console login with a user with cluster-admin role
-
Goto "OperatorHub"
-
Search your operator (we use the
namespace-configuration-operator
as example -
Click "Install" (there's no install now)
-
You get something like the following URL and screen:
- URL
https://........./operatorhub/subscribe?pkg=namespace-configuration-operator&catalog=community-operators&catalogNamespace=openshift-marketplace&targetNamespace=undefined
- URL
-
Now you can see the parameters for the operator subscription yaml. You need:
- name: comes from the URL parameter:
pkg=
- namespace: is
openshift-operators
normally - channel: you can see the channels in the install mask
- name: comes from the URL parameter:
pkg=
- source: comes from the URL parameter:
catalog=
- sourceNamespace: comes from the URL parameter:
catalogNamespace=
- name: comes from the URL parameter:
-
Now you can Cancel the install (we want to install via manifest).
-
if you've recorded all the parameter, here's the resulting YAML manifest:
apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: namespace-configuration-operator namespace: openshift-operators spec: channel: alpha name: namespace-configuration-operator source: community-operators sourceNamespace: openshift-marketplace
-
Save the manifest and apply it with
oc apply -f filename.yaml
Reference: https://docs.okd.io/latest/operators/admin/olm-adding-operators-to-cluster.html
Von Peter Pfläging vor fast 4 Jahren aktualisiert · 3 Revisionen