JBoss Tools' OpenShift tooling allows users to deploy a Docker image to an OpenShift cluster from a Docker daemon. Deploying an image to an OpenShift cluster generates several resources to support the image which include:
-
ImageStream
-
Deployment Configuration
-
Service
-
Route 'Optional'
The following steps require that:
|
Users have two ways to begin the image deployment process from:
a) The Docker Explorer
From the Docker Explorer choose a Docker image:
-
Select an OpenShift Connection
-
Select an OpenShift project
b) The OpenShift Explorer
From the OpenShift Explorer choose an OpenShift cluster:
-
Select a Docker daemon connection
-
Select an OpenShift project
-
Enter a Docker image in the format of '[<repo>/]<username>/<imagename>[:tag]'
-
Enter a unique name for the generated resources
The name must be unique within the scope of the OpenShift project. |
then:
Modify the Deployment Configuration
The deployment config and scalability page allows a user to over-ride the environment values declared by the image. The variable and their default values are presented initially. The values can be reset to the value which is declared by the image. Additionally, the exposed data volumes are presented along with the number of instances that are desired when the image is deployed.
Adding OpenShift routes and Exposing image ports
The created service will, by default, expose all the ports that are exposed by the docker image. Ports can be removed if necessary. A route can also be created to allow access to the image from outside the cluster.
Add labels
Labels are a key concept in OpenShift which allow a user to attach metadata to their deployed resources. These labels can be used to query or filter their resources based on desired keys and values.
Result: Successfully deploying a Docker image will present you with a summary of the created resources and refresh the Eclipse workspace to display the new OpenShift resources. The resulting deployment may take time before it is available; this might be related to the server pulling the image from its source location. To verify your deployment, check the pod status, visit the public url (if a route was included), or retrieve the pod logs.
Did you know?
|