-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d6fc610
commit 4348280
Showing
1 changed file
with
34 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,51 @@ | ||
# Your Project Name | ||
# MongoDb probe app | ||
 | ||
|
||
## Description | ||
|
||
|
||
Sample mongodb app. | ||
Generated with Claude Sonet 3.5 | ||
Based on spring boot + mongodb starter + opentelemetry starter. | ||
Packaged as: | ||
- a cloudfoundry compatible jar | ||
- an OCI image | ||
- a helm chart for convenient k8s deployment of the image with adapter config (mongodb uri, otel endpoint) | ||
|
||
|
||
references: | ||
|
||
## references: | ||
- https://github.com/kokuwaio/helm-maven-plugin | ||
- https://opentelemetry.io/blog/2024/spring-starter-stable/ | ||
- https://opentelemetry.io/docs/languages/java/configuration/ | ||
|
||
## basic tests | ||
|
||
chart values.yaml: | ||
|
||
``` | ||
mongodb: | ||
uri: mongodb://databaseAdmin:yyyy.zzzz:27017,rs0-1-2e385b67-a1c9-4aa0-910d-b25dc99e9c5d.zzzz:27017,rs0-2-2e385b67-a1c9-4aa0-910d-b25dc99e9c5d.zzzz:27017/admin?replicaSet=rs0 | ||
otlp: | ||
serviceName: probe-for-mongodb | ||
tracing: | ||
endpoint: http://jaeger-collector-303ada4c-4478-49dd-b427-8c482bfc17b8.zzzz:443 | ||
sampling: | ||
probability: 1.0 | ||
``` | ||
|
||
|
||
install OCI chart: | ||
|
||
``` | ||
helm template oci://ghcr.io/poblin-orange/mongodb-probe/mongodb-probe --version 0.0.1 -f ./mongodb-probe-values.yaml | kubectl apply -f - | ||
./mvnw clean install | ||
./mvnw spring-boot:build-image | ||
``` | ||
|
||
#docker run -d -p 8080:8080 docker run -i spring-mongo-demo:0.0.1-SNAPSHOT | ||
docker run -i spring-mongo-demo:0.0.1-SNAPSHOT | ||
|
||
testing probe REST API: | ||
``` | ||
``` | ||
|
||
docker tag ${project.artifactId}:${project.version} your-username/${project.artifactId}:latest | ||
docker push your-username/${project.artifactId}:latest |