mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
- Removes an extra step that was added accidently to the odo documentation. - Changes a `cd` step to `<directory-name>` instead of specifying the folder
125 lines
3.3 KiB
Plaintext
125 lines
3.3 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * cli_reference/openshift_developer_cli/creating-a-multicomponent-application-with-odo.adoc
|
|
|
|
[id="deploying-the-back-end-component_{context}"]
|
|
|
|
= Deploying the back-end component
|
|
|
|
.Procedure
|
|
|
|
. Import `openjdk18` into the cluster:
|
|
+
|
|
----
|
|
$ oc import-image openjdk18 \
|
|
--from=registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift --confirm
|
|
----
|
|
|
|
. Tag the image as `builder` to make it accesible for {odo-title}:
|
|
+
|
|
----
|
|
$ oc annotate istag/openjdk18:latest tags=builder
|
|
----
|
|
|
|
. Run `odo catalog list components` to see the created image:
|
|
+
|
|
----
|
|
$ odo catalog list components
|
|
Odo Supported OpenShift Components:
|
|
NAME PROJECT TAGS
|
|
nodejs openshift 10,8,8-RHOAR,latest
|
|
openjdk18 myproject latest
|
|
----
|
|
|
|
. Change directory to the back-end source directory and check that you have the correct files in the directory:
|
|
+
|
|
----
|
|
$ cd <directory-name>
|
|
$ ls
|
|
debug.sh pom.xml src
|
|
----
|
|
|
|
. Build the back-end source files with Maven to create a JAR file:
|
|
+
|
|
----
|
|
$ mvn package
|
|
...
|
|
[INFO] --------------------------------------
|
|
[INFO] BUILD SUCCESS
|
|
[INFO] --------------------------------------
|
|
[INFO] Total time: 2.635 s
|
|
[INFO] Finished at: 2019-09-30T16:11:11-04:00
|
|
[INFO] Final Memory: 30M/91M
|
|
[INFO] --------------------------------------
|
|
----
|
|
|
|
. Create a component configuration of Java component-type named `backend`:
|
|
+
|
|
----
|
|
$ odo create openjdk18 backend --binary target/wildwest-1.0.jar
|
|
✓ Validating component [1ms]
|
|
Please use `odo push` command to create the component with source deployed
|
|
----
|
|
+
|
|
Now the configuration file `config.yaml` is in the local directory of the back-end component that contains information about the component for deployment.
|
|
|
|
. Check the configuration settings of the back-end component in the `config.yaml` file using:
|
|
+
|
|
----
|
|
$ odo config view
|
|
COMPONENT SETTINGS
|
|
------------------------------------------------
|
|
PARAMETER CURRENT_VALUE
|
|
Type openjdk18
|
|
Application app
|
|
Project myproject
|
|
SourceType binary
|
|
Ref
|
|
SourceLocation target/wildwest-1.0.jar
|
|
Ports 8080/TCP,8443/TCP,8778/TCP
|
|
Name backend
|
|
MinMemory
|
|
MaxMemory
|
|
DebugPort
|
|
Ignore
|
|
MinCPU
|
|
MaxCPU
|
|
----
|
|
|
|
. Push the component to the {product-title} cluster.
|
|
+
|
|
----
|
|
$ odo push
|
|
Validation
|
|
✓ Checking component [6ms]
|
|
|
|
Configuration changes
|
|
✓ Initializing component
|
|
✓ Creating component [124ms]
|
|
|
|
Pushing to component backend of type binary
|
|
✓ Checking files for pushing [1ms]
|
|
✓ Waiting for component to start [48s]
|
|
✓ Syncing files to the component [811ms]
|
|
✓ Building component [3s]
|
|
----
|
|
+
|
|
Using `odo push`, {product-title} creates a container to host the back-end component, deploys the container into a Pod running on the {product-title} cluster, and starts the `backend` component.
|
|
|
|
. Validate:
|
|
|
|
* The status of the action in {odo-title}:
|
|
+
|
|
----
|
|
odo log -f
|
|
2019-09-30 20:14:19.738 INFO 444 --- [ main] c.o.wildwest.WildWestApplication : Starting WildWestApplication v1.0 onbackend-app-1-9tnhc with PID 444 (/deployments/wildwest-1.0.jar started by jboss in /deployments)
|
|
----
|
|
|
|
* The status of the back-end component:
|
|
+
|
|
----
|
|
$ odo list
|
|
APP NAME TYPE SOURCE STATE
|
|
app backend openjdk18 file://target/wildwest-1.0.jar Pushed
|
|
----
|