OpenShift Pipelines - Disconnected Install
-
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:
-
Prepare a space for the OpenShift Pipelines Install:
mkdir ${OKD_LAB_PATH}/work-dir cd ${OKD_LAB_PATH}/work-dir
-
Clone the operator code:
git clone https://github.com/tektoncd/operator.git cd operator git checkout v0.51.2
-
Mac OS: Start the Podman environment:
podman machine init podman machine start
-
Select the Lab subdomain that you want to work with:
labctx
-
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}
-
Create a
.docker/config.json
file. KO does not use the podman auth.json file.cp ~/.config/containers/auth.json ~/.docker/config.json
-
Log into the OpenShift cluster:
oc login -u admin https://api.okd4.${SUB_DOMAIN}.${LAB_DOMAIN}:6443
-
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
-
Wait for the cluster nodes to restart as they apply the
ImageContentSourcePolicy
You can watch the progress with:
oc get nodes
-
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
-
After a couple of minutes, you should see the Tekton pods running in the
openshift-pipelines
namespace:oc get pods -n openshift-pipelines
-
Finally, clean up after yourself:
podman image rm -a podman machine stop cd rm -rf ${OKD_LAB_PATH}/work-dir
-
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