Deploying Containerized Applications on Openshift Flashcards
Basic Command to create an application
oc new-app mysql MYSQL_USER=user \ MYSQL_PASSWORD=pass MYSQL_DATABASE=testdb \
-l db=mysql
oc new-app –docker-image=myregistry.com/mycompany/myapp –name=myapp
oc new-app https://github.com/openshift/ruby-hello-world –name=ruby-hello
oc new-app \
–template=mysql-persistent \
-p MYSQL_USER=user1 \
-p MYSQL_PASSWORD=mypa55 \
-p MYSQL_DATABASE=testdb \
-p MYSQL_ROOT_PASSWORD=r00tpa55 \
-p VOLUME_CAPACITY=10Gi
Managing Persistent Storage
oc get pv
oc get pv pv0001 -o yaml
To add PersistentVolume
oc create -f pv1001.yaml
To define persistent volume claims
oc create -f pvc.yaml
oc get pvc
Managing Openshift Resources CLI
oc get all
oc describe <resource-name></resource-name>
oc get <resource-name></resource-name>
oc create
oc delete
oc exec <container-id></container-id>