Box

Allgemein

Profil

Aktionen

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

  1. Web console login with a user with cluster-admin role

  2. Goto "OperatorHub"

  3. Search your operator (we use the namespace-configuration-operator as example

  4. Click "Install" (there's no install now)

  5. 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
  6. 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=
  7. Now you can Cancel the install (we want to install via manifest).

  8. 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
    
  9. 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