Create an OpenShift ImageStream
Create an OpenShift Imagestream
Arlen High has decided to consolidate their OpenShift project with Tom Landry high school, but they need your help importing the Docker container that hosts the website. Import the image into the OpenShift container registry so that it is available to users under the
Edit Create an OpenShift ImageStream
Arlen High has decided to consolidate their OpenShift project with Tom Landry high school, but they need your help importing the Docker container that hosts the website. Import the image into the OpenShift container registry so that it is available to the users under the arlen-high project.
Log in to the OpenShift cluster (Master node) using the credentials provided on the hands-on lab page. Note that the bootstrap scropt may take a while to complete so be patient and tray again every 10 seconds if you get 'Conneciton refused':
Become the root user:
Check the health of the cluster:
oc get nodes
Create the project that they will use for their application:
oc new-project arlen-high --description="Arlen Tx Engineering project"
Create the user account for the administrator of the project:
htpasswd -b /etc/origin/master/htpasswd peggy propanerules
peggyadmin privileges to the
oc adm policy add-role-to-user admin peggy -n arlen-high
registry-viewerclusterrole to peggy:
oc adm policy add-role-to-user registry-viewer peggy
registry-editorclusterrole to peggy:
oc adm policy add-role-to-user registry-editor peggy
Switch to the arlen-high project:
oc project arlen-high
Since the docker file will try to run this image as root and OpenShift will not allow this, we will need to add an exception:
oc adm policy add-scc-to-user anyuid -z default
Check the loaded images before we begin:
A number of students have reported problems downloading the lab Docker image from GitHub (opton A below). While we sort this out we are offering a work around (option B). Feel free to use either one. Take time to note the differences and consider why they are different. Sincerly, your cloud team.
Download Arlen High's Application image tomlandy:
Option A - Download the
tomlandry.tarimage from Git hub and 'load' it into into docker.
wget -O tomlandry.tar.xz https://github.com/linuxacademy/content-openshift-ex280/raw/release-3.9/docker-images/tomlandry.tar.xz
docker load -i tomlandry.tar.xz
Option B - Pull the image from Docker Hub.
docker pull amunix/tomlandry:latest1
Option A & B - Check to see if the image is there and it's full name and tag:
Option A & B - Find the registry URL on
oc get routes -n default
Option A & B - Login as peggy:
oc login https://okd.10.0.2.203.xip.io:8443 -u peggy -p propanerules -n arlen-high
Option A & B - Login to the docker registry as peggy:
docker login docker-registry-default.apps.okd.10.0.2.204.xip.io -u $(oc whoami) -p $(oc whoami -t)
Update Tag for the
tomlandry:v1image in the following format:
docker tag tomlandry:v1 docker-registry-default.apps.okd.10.0.2.204.xip.io/arlen-high/tomlandry:latest
docker tag docker.io/amunix/tomlandry:latest1 docker-registry-default.apps.okd.10.0.2.204.xip.io/arlen-high/tomlandry:latest
Option A & B - Check the loaded images after tagging:
Option A & B - Push the tagged image into the container registry:
docker push docker-registry-default.apps.okd.10.0.2.204.xip.io/arlen-high/tomlandry:latest
Option A & B - Check your imageStream:
oc get is
Option A & B - As Peggy, create an application using the docker image you just imported:
oc new-app --image-stream=tomlandry --name="tomlandry-high"
Option A & B - Check the pods.
oc get pods
Congratulations, you've completed this hands-on lab!