Install on Openshift

You need Administrator access to the cluster.

You may prefer to use the Openshift’s internal Container Registry or an external one. In the following, you find instructions for both.

Internal Container Registry

  1. Enable route to Openshift internal CR

    oc patch configs.imageregistry.operator.openshift.io/cluster --patch '{"spec":{"defaultRoute":true}}' --type=merge
    export REGISTRY=$(oc get route default-route -n openshift-image-registry --template='{{ .spec.host }}')
    echo $REGISTRY
  2. Login into the Openshift’s internal registry

    oc registry login --skip-check
  3. You may need to configure your /etc/docker/daemon.json adding the route to the internal container registry in the list insecure-registries.

    {
      "insecure-registries": ["URL TO INTERNAL CONTAINER REGISTRY"]
    }

    you can use jq to update it (as root)

    sudo cp /etc/docker/daemon.json{,.bkp}
    jq '."insecure-registries" += ["'$REGISTRY'"]' /etc/docker/daemon.json.bkp | sudo tee /etc/docker/daemon.json
  4. If you updated the /etc/docker/daemon.json, you have to restart the docker service (as root)

    sudo systemctl restart docker.service docker.socket

Install with OLM

  1. Build and push the operator’s image

    export OPERATOR_IMAGE_REF=$REGISTRY/openshift-operators/service-binding-operator:latest
    make image push-image -o registry-login
  2. Build and push the bundle image

    export OPERATOR_BUNDLE_IMAGE_REF=$REGISTRY/openshift-marketplace/sbo-bundle:latest
    export OPERATOR_REPO_REF=image-registry.openshift-image-registry.svc:5000/openshift-operators/service-binding-operator
    
    make bundle-image push-bundle-image -o registry-login -o push-image -o image
  3. Build and push the index image

    export OPERATOR_INDEX_IMAGE_REF=$REGISTRY/openshift-marketplace/service-binding-operator:index
    
    make index-image -o push-bundle-image OPM_RENDER_OPTS=--skip-tls-verify && \
        sed -i 's/default-route-openshift-image-registry\..*\/openshift-/image-registry.openshift-image-registry.svc:5000\/openshift-/g' service-binding-operator-index/index.yaml && \
        docker build -f service-binding-operator-index.Dockerfile -t $OPERATOR_INDEX_IMAGE_REF . && \
        docker push $OPERATOR_INDEX_IMAGE_REF
  4. Deploy from index image

    export OPERATOR_IMAGE_REF=$(kubectl get imagestream -n openshift-operators service-binding-operator -o jsonpath='{.status.tags[0].items[0].dockerImageReference}')
    export OPERATOR_INDEX_IMAGE_REF=$(kubectl get imagestream -n openshift-marketplace service-binding-operator -o jsonpath='{.status.tags[0].items[0].dockerImageReference}')
    export OPERATOR_BUNDLE_IMAGE_REF=$(kubectl get imagestream -n openshift-marketplace sbo-bundle -o jsonpath='{.status.tags[0].items[0].dockerImageReference}')
    
    CATSRC_NAME_OVERRIDE=catsrc-sbo-dev make deploy-from-index-image
CATSRC_NAME_OVERRIDE is needed otherwise the generated name for the catalogsource will be too long (bigger than 63 characters)

Install with Helm

  1. Build and push the operator’s image

    export OPERATOR_IMAGE_REF=$REGISTRY/openshift-operators/service-binding-operator:latest
    make image push-image -o registry-login
  2. Install the CRDs

    make install
    make deploy-cert-manager
  3. Get the operator image name to use for reference inside the cluster

    export OPERATOR_IMAGE_LOCAL_REF=$(kubectl get imagestream -n openshift-operators service-binding-operator -o jsonpath='{.status.tags[0].items[0].dockerImageReference}')
  4. Deploy the operator

    helm install \
        --namespace openshift-operators \
        --set image.image=$OPERATOR_IMAGE_LOCAL_REF \
        service-binding-operator \
        ./charts/service-binding-operator

    or if you prefer to use helm template and kubectl you can use the following command:

    helm template \
        --skip-tests \
        --namespace openshift-operators \
        --set image.image=$OPERATOR_IMAGE_LOCAL_REF \
        ./charts/service-binding-operator | kubectl apply -f -

Install with manifests

  1. Build and push the operator’s image

    export OPERATOR_IMAGE_REF=$REGISTRY/service-binding-operator/service-binding-operator:latest
    make image push-image -o registry-login
  2. Deploy the operator

    export OPERATOR_IMAGE_REF=$(kubectl get imagestream -n service-binding-operator service-binding-operator -o jsonpath='{.status.dockerImageRepository}:{.status.tags[0].tag}')
    make deploy -o image -o push-image

External Container Registry

First of all, follow the instructions at Release to a Container Registry to login to an external Container Registry and configure the shell.

Install with OLM

  1. Build and push the operator’s image

    export OPERATOR_REPO_REF=$REGISTRY/service-binding-operator
    make image push-image -o registry-login
  2. Build and push the bundle image

    export OPERATOR_BUNDLE_REPO_REF=$REGISTRY/sbo-bundle
    make bundle-image push-bundle-image \
        -o registry-login \
        -o push-image \
        -o image
  3. Build and push the index image

    export OPERATOR_INDEX_REPO_REF=$REGISTRY/service-binding-operator
    make index-image push-index-image \
        -o registry-login \
        -o image \
        -o push-image \
        -o bundle-image \
        -o push-bundle-image
  4. Deploy from index image

    CATSRC_NAME_OVERRIDE=catsrc-sbo-dev make deploy-from-index-image
CATSRC_NAME_OVERRIDE is needed otherwise the generated name for the catalogsource will be too long (bigger than 63 characters)

Install with Helm

  1. Build and push the operator’s image

    export OPERATOR_IMAGE_REF=$REGISTRY/service-binding-operator:latest
    make image push-image -o registry-login
  2. Install the CRDs

    make install
  3. Deploy the operator

    helm install \
        --create-namespace \
        --namespace openshift-operators \
        --set image.image=$OPERATOR_IMAGE_REF \
        service-binding-operator \
        ./charts/service-binding-operator

    or if you prefer to use only the templates

    kubectl create namespace openshift-operators
    helm template \
        --skip-tests \
        --namespace openshift-operators \
        --set image.image=$OPERATOR_IMAGE_REF \
        ./charts/service-binding-operator | kubectl apply -f -

Install with manifests

  1. Build and push the operator’s image

    export OPERATOR_REPO_REF=$REGISTRY/service-binding-operator/service-binding-operator
    make image push-image -o registry-login
  2. Deploy the operator

    make deploy

Install with OLM and a given Index image

You can install the Service Binding Operator from a given index image, like the one on OperatorHub.io or the one generated for each Service Binding Operator’s Pull Request.

From OperatorHub.io

To install the OperatorHub.io's image use the following command:

CATSRC_NAME=operatorhubio OPERATOR_INDEX_IMAGE_REF=quay.io/operatorhubio/catalog:latest make deploy-from-index-image

From a Pull Request index image

For each Pull Request the images needed to install with OLM are create and pushed to the Service Binding Operator’s Quay Repository.

In the following <PR_NUMBER> is the Pull Request’s number and <COMMIT_ID> is the short commit ID (i.e., the first 8 characters of the commit ID).

CATSRC_NAME=sbo-pr OPERATOR_INDEX_IMAGE_REF=quay.io/redhat-developer/servicebinding-operator:pr-<PR_NUMBER>-<COMMIT_ID>-index make deploy-from-index-image