OpenShift Pipelines - Disconnected Install

  1. First we need to install a couple of tools: (Assuming MacOS with HomeBrew hereā€¦)

    brew install go podman ko
    

    For Fedora or other linux distributions, check out the project sites for install instructions:

  2. Prepare a space for the OpenShift Pipelines Install:

    mkdir ${OKD_LAB_PATH}/work-dir
    cd ${OKD_LAB_PATH}/work-dir
    
  3. Clone the operator code:

    git clone https://github.com/tektoncd/operator.git
    cd operator
    git checkout v0.51.2
    
  4. Mac OS: Start the Podman environment:

    podman machine init
    podman machine start
    
  5. Select the Lab subdomain that you want to work with:

    labctx
    
  6. Log into the lab Nexus registry:

    LOCAL_REGISTRY=$(yq e ".local-registry" ${OKD_LAB_PATH}/lab-config/${SUB_DOMAIN}-cluster.yaml)
    podman login -u openshift-mirror ${LOCAL_REGISTRY}
    
  7. Create a .docker/config.json file. KO does not use the podman auth.json file.

    cp ~/.config/containers/auth.json ~/.docker/config.json
    
  8. Log into the OpenShift cluster:

    oc login -u admin https://api.okd4.${SUB_DOMAIN}.${LAB_DOMAIN}:6443
    
  9. Create a proxy repository for

    cat <<EOF | oc apply -f -
    apiVersion: operator.openshift.io/v1alpha1
    kind: ImageContentSourcePolicy
    metadata:
      name: lab-registry
    spec:
      repositoryDigestMirrors:
      - mirrors:
        - nexus.${LAB_DOMAIN}:5000
        source: gcr.io
    EOF
    
  10. Wait for the cluster nodes to restart as they apply the ImageContentSourcePolicy

    You can watch the progress with:

    oc get nodes
    
  11. Build the OpenShift Pipelines operator and install it to your cluster:

    export KO_DOCKER_REPO=${LOCAL_REGISTRY}/tekton
    make TARGET=openshift CR=config/default apply 
    
  12. After a couple of minutes, you should see the Tekton pods running in the openshift-pipelines namespace:

    oc get pods -n openshift-pipelines
    
  13. Finally, clean up after yourself:

     podman image rm -a
     podman machine stop
     cd
     rm -rf ${OKD_LAB_PATH}/work-dir
    
  14. If you choose to uninstall pipelines:

    mkdir ${OKD_LAB_PATH}/work-dir
    cd ${OKD_LAB_PATH}/work-dir
    git clone https://github.com/tektoncd/operator.git
    cd operator
    git checkout v0.51.2
    oc login -u admin https://api.okd4.${SUB_DOMAIN}.${LAB_DOMAIN}:6443
    make TARGET=openshift CR=config/default clean
    cd
    rm -rf ${OKD_LAB_PATH}/work-dir