Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WFLY-18493] adds the missing helm chart, removes deprecated openshif… #701

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 4 additions & 17 deletions microprofile-config/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ include::../shared-doc/run-integration-tests-with-server-distribution.adoc[level
// Undeploy the Quickstart
include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+1]

// Run the Quickstart in Red Hat CodeReady Studio or Eclipse
include::../shared-doc/run-the-quickstart-in-jboss-developer-studio.adoc[leveloffset=+1]

[[creating-new-project]]
== Creating the Maven Project

Expand Down Expand Up @@ -797,22 +794,12 @@ endpoint using your browser or
converter. You will see the configured value which is taken from our created
`MicroProfileCustomValue` object.

ifdef::EAPXPRelease[]
// Getting Started with OpenShift
include::../shared-doc/xp-openshift-getting-started.adoc[leveloffset=+1]
//Prepare OpenShift for Quickstart Deployment
include::../shared-doc/xp-create-project.adoc[leveloffset=+2]
// Import the Latest {xpaasproduct-shortname} Image Streams and Templates
include::../shared-doc/xp-import-imagestreams-templates.adoc[leveloffset=+2]
// Deploy the {ProductShortName} Source-to-Image (S2I) Quickstart to OpenShift
include::../shared-doc/xp-deploy-project.adoc[leveloffset=+2]
// Post deployment tasks
include::../shared-doc/xp-post-deployment-tasks.adoc[leveloffset=+2]
endif::[]

//Bootable JAR
// Bootable JAR
include::../shared-doc/build-and-run-the-quickstart-with-bootable-jar.adoc[leveloffset=+1]

// Openshift
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]

== Conclusion

MicroProfile Config provides a way for your application to separate the configuration
Expand Down
6 changes: 6 additions & 0 deletions microprofile-config/charts/helm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
build:
uri: https://github.com/wildfly/quickstart.git
ref: main
contextDir: microprofile-config
deploy:
replicas: 1
7 changes: 0 additions & 7 deletions microprofile-config/src/main/jkube/route.yml

This file was deleted.

2 changes: 1 addition & 1 deletion shared-doc/attributes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Enable the following flag to build README.html files for EAP XP product builds.
// Comment it out for WildFly or JBoss EAP product builds.
//***********************************************************************************
:EAPXPRelease:
//:EAPXPRelease:

// This is a universal name for all releases
:ProductShortName: JBoss EAP
Expand Down
175 changes: 1 addition & 174 deletions shared-doc/build-and-run-the-quickstart-with-bootable-jar.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -95,177 +95,4 @@ After the quickstart application is deployed, the bootable JAR includes the appl
====

// Bootable Jar Testing with Arquillian
include::../shared-doc/run-integration-tests-with-bootable-jar.adoc[leveloffset=+1]

// TODO this should go away and the MP quickstart's README.adoc should instead include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
// NOT doing this now cause of the content conditional exceptions below for some MP quickstarts
== On a {productName} OpenShift platform

You can use the Maven plug-in to build a {productName} bootable JAR, and then you can run the application on a {productName} OpenShift platform. The following example demonstrates a quickstart `pom.xml` file that contains a Maven profile named *bootable-jar-openshift*:

[source,xml,subs="attributes+"]
----
<profile>
<id>openshift</id>
<build>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-jar-maven-plugin</artifactId>
<configuration>
<feature-pack-location>wildfly@maven(org.jboss.universe:community-universe)#${version.server}</feature-pack-location>
<layers>
ifndef::custom-bootable-jar-layers[]
<layer>jaxrs-server</layer>
<layer>microprofile-platform</layer>
endif::[]
ifdef::reactive-messaging[]
<layer>cloud-server</layer>
<layer>h2-default-datasource</layer>
<layer>microprofile-reactive-messaging-kafka</layer>
endif::[]
</layers>
<plugin-options>
<jboss-fork-embedded>true</jboss-fork-embedded>
</plugin-options>
<cloud/>
</configuration>
<executions>
<execution>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.jkube</groupId>
<artifactId>openshift-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>resource</goal>
<goal>build</goal>
</goals>
</execution>
</executions>
<configuration>
<enricher>
<config>
<jkube-service>
<type>NodePort</type>
</jkube-service>
</config>
</enricher>
ifdef::reactive-messaging[]
<resources>
<env>
<!--
Set environment vars to adjust the JVM metaspace or we might end up
with OutOfMemoryErrors on OpenShift
-->
<GC_MAX_METASPACE_SIZE>256</GC_MAX_METASPACE_SIZE>
<GC_METASPACE_SIZE>96</GC_METASPACE_SIZE>
<!-- Set the AMQ Streams URL to what is set up by the instructions -->
<MP_MESSAGING_CONNECTOR_SMALLRYE_KAFKA_BOOTSTRAP_SERVERS>my-cluster-kafka-bootstrap:9092</MP_MESSAGING_CONNECTOR_SMALLRYE_KAFKA_BOOTSTRAP_SERVERS>
</env>
</resources>
endif::[]
</configuration>
</plugin>
</plugins>
</build>
</profile>
ifdef::reactive-messaging[]
<profile>
<id>os-jar-amq-streams</id>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.jkube</groupId>
<artifactId>openshift-maven-plugin</artifactId>
<version>${version.jkube.maven.plugin}</version>
<configuration>
<resources>
<env>
<!-- Set the AMQ Streams URL to what is set up by the instructions -->
<MP_MESSAGING_CONNECTOR_SMALLRYE_KAFKA_BOOTSTRAP_SERVERS>my-cluster-kafka-bootstrap:9092</MP_MESSAGING_CONNECTOR_SMALLRYE_KAFKA_BOOTSTRAP_SERVERS>
</env>
</resources>
</configuration>
</plugin>
</plugins>
</build>
</profile>
endif::[]
----
.Procedure

. Log in to your OpenShift instance using the `oc login` command.

. Create a new project for the quickstart bootable JAR on OpenShift. For example:
+
[options="nowrap",subs="attributes"]
----
$ oc new-project bootable-jar-project
----
ifdef::reactive-messaging[]
. Install *AMQ Streams* into the `bootable-jar-project` OpenShift project as outlined link:#install_amq_streams[earlier] in this quickstart.
endif::[]
. Build the quickstart bootable JAR by issuing the following command. This command also completes the following tasks: creates the OpenShift deployment, service and route; generates a docker image and pushes the docker image to OpenShift; and runs the application.
+
// Bootable jar Deployment
+
ifndef::reactive-messaging[]
[source,subs="attributes+",options="nowrap"]
----
$ mvn oc:deploy -Popenshift
----
endif::[]
ifdef::reactive-messaging[]
The command to deploy the application is slightly different depending on which Kafka installation you want to target.
+
First add the Helm repository, if you have not done so already, as described in {helmRepoUrl}.
+
Then:
+
[source,subs="attributes+",options="nowrap"]
----
$ helm install mp-rm-qs -f ./helm-bootable-jar-amq-streams.yml {helmChartName} --set build.uri={githubRepoCodeUrl} --set build.ref={WildFlyQuickStartRepoTag}
----
The contents of link:./helm-bootable-jar-amq-streams.yml[`helm-bootable-jar-amq-streams.yml`] are mostly similar to what was discussed for link:./helm-amq-streams.yml[`helm-amq-streams.yml`] earlier. The main difference is that `build.mode` is set to `bootable-jar`, and we specify `-Popenshift` in the `MAVEN_ARGS_APPEND` environment variable to trigger the `openshift` Maven profile when building the bootable jar.
+
NOTE: Although the above command will return quite quickly, it will take a while until the application pod is actually brought up. In the OpenShift console you will see a pod whose name starts with {hemlAppName} in the `ErrImagePull` or `ImagePullBackoff` state until the build has completed.
+
endif::[]
+
// Bootable jar Deployment - END
+
. Get the URL of the route.
+
[options="nowrap"]
----
$ oc get route
----
+
. Access the application in your web browser by using a URL. The URL is the value of the `HOST/PORT` field that was provided by the `oc get route` command output. For example, the route of the URL for the quickstart used in this procedure is `https://_HOST_PORT_Value_/`.


== Customizing OpenShift resources with resource fragments

With the Eclipse JKube Maven plug-in, you can customize the generated OpenShift resources, such as deployments, routes, and so on, with YAML file extracts located in the _src/main/jkube_ directory.

The `route.yml` file, which is located in the _src/main/jkube_ directory, is an example of a resource fragment. You can configure this resource fragment to change the Openshift application service route to use HTTPS:

[options="nowrap",subs="attributes"]
----
spec:
tls:
insecureEdgeTerminationPolicy: Redirect
termination: edge
to:
kind: Service
name: {artifactId}
----

For more information about resource fragments, see the link:https://www.eclipse.org/jkube/docs/openshift-maven-plugi[Eclipse JKube documentation].
include::../shared-doc/run-integration-tests-with-bootable-jar.adoc[leveloffset=+1]