Much ado about scripting, Linux & Eclipse: card subject to change

2019-06-29

Discovering containers loaded by Che 7

Second in this series... more tips for Che 7 on Minishift.

Discovering containers loaded by Che 7

Prerequisites

You need a Kubernetes or OpenShift cluster (eg., minikube or minishift), into which you have installed Che.
Follow the steps in this document to deploy Che. Steps below can be done in parallel to collect a list of containers involved in deployment.

Procedure

  1. Once you have started your cluster, you can watch events and see which images are pulled. Start this in a console window before deploying Che to your cluster.
    oc project che
    oc get po
    oc get events -w | tee /tmp/minishift.log.txt
  2. Watch for lines containing the following lines to see what containers are pulled.
    Successfully pulled image "..."
      and
    Container image "..." already present on machine
  3. For example, this should extract just a list of pulled containers, including any duplicate re-pulls:
    cat /tmp/minishift.log.txt | \
      egrep "Successfully pulled image|Container image" | \
      sed -e 's#.*\(Successfully pulled image\|Container image\) "\(.\+\)\".*#\2#g'
  4. You can also look at the available images in the minishift docker context:
    eval $(minishift docker-env)
    docker images
  5. Next, using chectldeploy Che to your cluster and watch the events get logged.
  6. You can also see container events at this URL:
    • https://192.168.YOUR.IP:8443/console/project/che/browse/events

Deploying Che 7 to Minishift with chectl

With the Che 7 just around the corner, and the realisation that I miss writing, I've decided to resurrect this blog from the dead and start a series of Che 7 tips. 

First up, the handful of steps required to get Che 7 running on Minishift 1.34 (OKD 3.11).

----

Deploying Che 7 to Minishift with chectl

Prerequisites

You need the latest Minishift and chectl releases.
Fetch them like this (or similar):
cd ~/bin
curl -sSL https://github.com/che-incubator/chectl/releases/download/20190724230954/chectl-linux -o chectl
chmod +x chectl
cd /tmp
curl -sSL https://github.com/minishift/minishift/releases/download/v1.34.1/minishift-1.34.1-linux-amd64.tgz -o minishift.tgz
tar xvzf minishift.tgz
mv minishift*/minishift ~/bin/
chmod +x ~/bin/minishift

Procedure

  1. Start up minishift. (See Start up Minishift for some suggested default settings.)
    minishift start
  2. Log in once startup is complete. NOTE: you need cluster admin priviledges.
    oc login 192.168.MY.IP:8433 -u system -p admin
  3. To watch the events and see which images are pulled, see this document.
  4. Deploy Che to minishift using the operator:
    chectl server:start -a operator -p minishift -n che
  5. If using Fix the plugin registry URL to use the latest version:
    oc set env dc/che CHE_WORKSPACE_PLUGIN__REGISTRY__URL=https://che-plugin-registry.openshift.io/v3
    You can also use the -a minishift-addon approach to deploy che, which uses a deployment configuration instead of an operator. However, this approach is deprecated as it does not support using a custom resource (eg., for air gap deployments).
    Also, if using Minishift 1.34.0 or earlier with the minishift-addon, you must fix the plugin registry URL to use the latest version:
    oc set env dc/che CHE_WORKSPACE_PLUGIN__REGISTRY__URL=https://che-plugin-registry.openshift.io/v3
    You can open the console for the che minishift-addondeployment to verify your change has been applied:
    You should see:
    CHE_WORKSPACE_PLUGIN__REGISTRY__URL = https://che-plugin-registry.openshift.io/v3
  6. Wait for redeployment to complete.
  7. Once running, you can see your Che instance here:
    • http://che-che.192.168.YOUR.IP.nip.io/
  8. If you then add a new workspace, you can see even more images pulled in the openshift event log.