The purpose of this APP is to demonstrate, what it takes for a developer to interact with OpenShift Container Storage Object Bucket Claim feature and consume Object Storage as a persistent layer.
This demo takes about 3min to run.
The demo script will make sure the namespace is in place and clean up existing instances of the app before building the resources to re-deploy the app.
./demo.sh
- BuildConfig - image configuration from source
- ImageStream - reference to the container image
- DeploymentConfig - application deployment configuration
- ObjectBucketClaim - photo storage
- Service - web service
- Route - photo-album.{{domain}}
$ ./demo.sh [ OK ] Using apps.ocp.webwim.com as our base domain [ OK ] oc apply -f /srv/redhat/demo/namespace.yaml namespace/demo unchanged Object Bucket Demo * Cleanup existing environment Press any key to continue... [ OK ] oc delete --ignore-not-found=1 -f app.yaml objectbucketclaim.objectbucket.io "photo-album" deleted deploymentconfig.apps.openshift.io "photo-album" deleted service "photo-album" deleted route.route.openshift.io "photo-album" deleted [ OK ] oc delete --ignore-not-found=1 bc photo-album -n demo buildconfig.build.openshift.io "photo-album" deleted * Import dependencies and create build config Press any key to continue... [ OK ] oc import-image ubi8/python-38 --from=registry.redhat.io/ubi8/python-38 --confirm -n demo ubi8/python-38 imported * Deploy application [ OK ] oc create -f app.yaml objectbucketclaim.objectbucket.io/photo-album created deploymentconfig.apps.openshift.io/photo-album created service/photo-album created route.route.openshift.io/photo-album created * Build the application image [ OK ] oc new-build --binary --strategy=docker --name photo-album -n demo photo-album built [ OK ] oc start-build photo-album --from-dir . -F -n demo photo-album setup /srv/redhat/demo/photo-album
This should create an OBC and other stuff needed for the app itself like POD,SVC,ROUTE. Together with OBC, you will also get new secrets and config maps created. The important resources could be listed as
oc get po,svc,route,obc,secret,cm
At this point your app is ready to be accessed externally. Grab the URL and browse it:
- The landing page allows image to be selected and uploaded.
- Once uploaded images are listed an can be selected to view larger.
See documentation/screenshot
folder.
This demo was inspired and derived from karan singh's photo album app.