Skip to content

Commit 183b3c9

Browse files
committed
docs: update documentation to readme file
Signed-off-by: Otavio Santana <[email protected]>
1 parent b92cfe8 commit 183b3c9

File tree

1 file changed

+66
-77
lines changed

1 file changed

+66
-77
lines changed

README.adoc

+66-77
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
1-
# embedded-mongodb
1+
= embedded-mongodb
22

33
Sample Helidon MP project that includes multiple REST operations.
44

5-
## Build and run
5+
== Build and Run
66

7-
8-
With JDK21
9-
```bash
7+
With JDK21:
8+
[source,bash]
9+
----
1010
mvn package
1111
java -jar target/embedded-mongodb.jar
12-
```
12+
----
1313

14-
## Exercise the application
14+
== Exercise the Application
1515

1616
Basic:
17-
```
17+
[source,bash]
18+
----
1819
curl -X GET http://localhost:8080/simple-greet
1920
Hello World!
20-
```
21-
21+
----
2222

2323
JSON:
24-
```
24+
[source,bash]
25+
----
2526
curl -X GET http://localhost:8080/greet
2627
{"message":"Hello World!"}
2728
@@ -32,39 +33,32 @@ curl -X PUT -H "Content-Type: application/json" -d '{"greeting" : "Hola"}' http:
3233
3334
curl -X GET http://localhost:8080/greet/Jose
3435
{"message":"Hola Jose!"}
35-
```
36-
37-
36+
----
3837

39-
## Try health
38+
== Try Health
4039

41-
```
40+
[source,bash]
41+
----
4242
curl -s -X GET http://localhost:8080/health
4343
{"outcome":"UP",...
44+
----
4445

45-
```
46-
47-
48-
## Building a Native Image
46+
== Building a Native Image
4947

5048
The generation of native binaries requires an installation of GraalVM 22.1.0+.
5149

5250
You can build a native binary using Maven as follows:
53-
54-
```
51+
[source,bash]
52+
----
5553
mvn -Pnative-image install -DskipTests
56-
```
57-
58-
The generation of the executable binary may take a few minutes to complete depending on
59-
your hardware and operating system. When completed, the executable file will be available
60-
under the `target` directory and be named after the artifact ID you have chosen during the
61-
project generation phase.
54+
----
6255

56+
The generation of the executable binary may take a few minutes to complete depending on your hardware and operating system. When completed, the executable file will be available under the `target` directory and named after the artifact ID you have chosen during the project generation phase.
6357

58+
== Try Metrics
6459

65-
## Try metrics
66-
67-
```
60+
[source,bash]
61+
----
6862
# Prometheus Format
6963
curl -s -X GET http://localhost:8080/metrics
7064
# TYPE base:gc_g1_young_generation_count gauge
@@ -74,85 +68,80 @@ curl -s -X GET http://localhost:8080/metrics
7468
curl -H 'Accept: application/json' -X GET http://localhost:8080/metrics
7569
{"base":...
7670
. . .
77-
```
78-
71+
----
7972

73+
== Building the Docker Image
8074

81-
## Building the Docker Image
82-
83-
```
75+
[source,bash]
76+
----
8477
docker build -t embedded-mongodb .
85-
```
78+
----
8679

87-
## Running the Docker Image
80+
== Running the Docker Image
8881

89-
```
82+
[source,bash]
83+
----
9084
docker run --rm -p 8080:8080 embedded-mongodb:latest
91-
```
85+
----
9286

9387
Exercise the application as described above.
94-
9588

96-
## Run the application in Kubernetes
89+
== Run the Application in Kubernetes
9790

98-
If you don’t have access to a Kubernetes cluster, you can [install one](https://helidon.io/docs/latest/#/about/kubernetes) on your desktop.
91+
If you don’t have access to a Kubernetes cluster, you can https://helidon.io/docs/latest/#/about/kubernetes[install one] on your desktop.
9992

100-
### Verify connectivity to cluster
93+
=== Verify Connectivity to Cluster
10194

102-
```
95+
[source,bash]
96+
----
10397
kubectl cluster-info # Verify which cluster
10498
kubectl get pods # Verify connectivity to cluster
105-
```
99+
----
106100

107-
### Deploy the application to Kubernetes
101+
=== Deploy the Application to Kubernetes
108102

109-
```
103+
[source,bash]
104+
----
110105
kubectl create -f app.yaml # Deploy application
111106
kubectl get pods # Wait for quickstart pod to be RUNNING
112-
kubectl get service embedded-mongodb # Get service info
107+
kubectl get service embedded-mongodb # Get service info
113108
kubectl port-forward service/embedded-mongodb 8081:8080 # Forward service port to 8081
114-
```
109+
----
115110

116111
You can now exercise the application as you did before but use the port number 8081.
117112

118-
After you’re done, cleanup.
119-
120-
```
113+
After you’re done, cleanup:
114+
[source,bash]
115+
----
121116
kubectl delete -f app.yaml
122-
```
117+
----
123118

124-
125-
## Building a Custom Runtime Image
119+
== Building a Custom Runtime Image
126120

127121
Build the custom runtime image using the jlink image profile:
128-
129-
```
122+
[source,bash]
123+
----
130124
mvn package -Pjlink-image
131-
```
132-
133-
This uses the helidon-maven-plugin to perform the custom image generation.
134-
After the build completes it will report some statistics about the build including the reduction in image size.
125+
----
135126

136-
The target/embedded-mongodb-jri directory is a self contained custom image of your application. It contains your application,
137-
its runtime dependencies and the JDK modules it depends on. You can start your application using the provide start script:
127+
This uses the helidon-maven-plugin to perform the custom image generation. After the build completes, it will report some statistics about the build, including the reduction in image size.
138128

139-
```
129+
The `target/embedded-mongodb-jri` directory is a self-contained custom image of your application. It contains your application, its runtime dependencies, and the JDK modules it depends on. You can start your application using the provided start script:
130+
[source,bash]
131+
----
140132
./target/embedded-mongodb-jri/bin/start
141-
```
133+
----
142134

143-
Class Data Sharing (CDS) Archive
144-
Also included in the custom image is a Class Data Sharing (CDS) archive that improves your application’s startup
145-
performance and in-memory footprint. You can learn more about Class Data Sharing in the JDK documentation.
135+
=== Class Data Sharing (CDS) Archive
146136

147-
The CDS archive increases your image size to get these performance optimizations. It can be of significant size (tens of MB).
148-
The size of the CDS archive is reported at the end of the build output.
137+
Also included in the custom image is a Class Data Sharing (CDS) archive that improves your application’s startup performance and in-memory footprint. You can learn more about Class Data Sharing in the JDK documentation.
149138

150-
If you’d rather have a smaller image size (with a slightly increased startup time) you can skip the creation of the CDS
151-
archive by executing your build like this:
139+
The CDS archive increases your image size to get these performance optimizations. It can be of significant size (tens of MB). The size of the CDS archive is reported at the end of the build output.
152140

153-
```
141+
If you’d rather have a smaller image size (with a slightly increased startup time), you can skip the creation of the CDS archive by executing your build like this:
142+
[source,bash]
143+
----
154144
mvn package -Pjlink-image -Djlink.image.addClassDataSharingArchive=false
155-
```
145+
----
156146

157-
For more information on available configuration options see the helidon-maven-plugin documentation.
158-
147+
For more information on available configuration options, see the helidon-maven-plugin documentation.

0 commit comments

Comments
 (0)