Make sure you have Java11 installed before running the code in this repository:
$ java -version
This repository contains 3 projects:
- example-todo-app-project which is a slightly modified version of TODO Demo Application part of the Helidon examples.
This project has 2 modules, both using Dekorate to generate Kubernetes manifest files:
- helidon-examples-todo-frontend
- helidon-examples-todo-backend
- todo-app_quarkus is a slightly modified version of TODO Application with Quarkus.
- todo_app_springboot is a modified version of TODO Application with Spring Boot. The version in this repo uses a different Java version, an H2 database and way to persist its data.
You can run both Helidon example projects by going to todo_app_helidon folder:
$ cd todo-app-helidon
- If you would like to generate Kubernetes/Knative or Helm charts using the existing Docker image, please comment the Tekton dependency in the each pom.xml:
<!-- <dependency>-->
<!-- <groupId>io.dekorate</groupId>-->
<!-- <artifactId>tekton-annotations</artifactId>-->
<!-- <version>${dekorate-annotations.version}</version>-->
<!-- </dependency>-->
Then run:
$ mvn package -Ddekorate.build=false -Ddekorate.push=false
The above command will generate:
-
the Kubernetes manifests (kubernetes.json and kubernetes.yml) under: todo-app-helidon/backend/target/classes/META-INF/dekorate for the backend module or todo-app-helidon/frontend/target/classes/META-INF/dekorate for the frontend module.
-
the Knative manifests (knative.json and knative.yml) under: todo-app-helidon/backend/target/classes/META-INF/dekorate for the backend module or todo-app-helidon/frontend/target/classes/META-INF/dekorate for the frontend module.
-
the Helm manifests under: todo-app-helidon/backend/target/classes/META-INF/dekorate/helm for the backend module or todo-app-helidon/frontend/target/classes/META-INF/dekorate/helm for the frontend module.
- If you would like to generate Tekton resources, comment the Knative and Helm Dekorate dependencies present in the pom.xml files:
<!-- <dependency>-->
<!-- <groupId>io.dekorate</groupId>-->
<!-- <artifactId>knative-annotations</artifactId>-->
<!-- <version>${dekorate-annotations.version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>io.dekorate</groupId>-->
<!-- <artifactId>helm-annotations</artifactId>-->
<!-- <version>${dekorate-annotations.version}</version>-->
<!-- </dependency>-->
Uncomment the following dependency (if commented in previous use case):
<dependency>
<groupId>io.dekorate</groupId>
<artifactId>tekton-annotations</artifactId>
<version>${dekorate-annotations.version}</version>
</dependency>
And now run:
$ mvn package -Ddekorate.build=false -Ddekorate.push=false
The above command will generate the Tekton manifests under:
- todo-app-helidon/backend/target/classes/META-INF/dekorate for the backend module or
- todo-app-helidon/frontend/target/classes/META-INF/dekorate for the frontend module.
You can run the Quarkus example project by going to todo_app_quarkus folder:
cd todo-app-quarkus
If you run the following command:
mvn clean package
you will obtain the following under todo-app-quarkus/target:
- helm folder containing the Helm charts generated for the app.
- kubernetes folder containing knative.json and knative.yml manifests.
If you would like to generate Kubernetes manifests, please comment the following line in todo-app-quarkus/src/main/resources/application.properties :
quarkus.kubernetes.deployment-target=knative
and run again mvn clean package
.
This will result in generating todo-app-quarkus/target/kubernetes/kubernetes.json
and todo-app-quarkus/target/kubernetes/kubernetes.yml
You can run both SpringBoot example projects by going to todo_app_springboot folder:
$ cd todo-app-springboot
- If you would like to generate Kubernetes/Knative or Helm charts using the existing Docker image, please comment the Tekton dependency in the pom.xml:
<!-- <dependency>-->
<!-- <groupId>io.dekorate</groupId>-->
<!-- <artifactId>tekton-annotations</artifactId>-->
<!-- <version>${dekorate-annotations.version}</version>-->
<!-- </dependency>-->
Then run:
$ mvn package -Ddekorate.build=false -Ddekorate.push=false
The above command will generate:
-
the Kubernetes manifests (kubernetes.json and kubernetes.yml) under todo-app-springboot/target/classes/META-INF/dekorate.
-
the Knative manifests (knative.json and knative.yml) under todo-app-springboot/target/classes/META-INF/dekorate.
-
the Helm manifests under: todo-app-springboot/target/classes/META-INF/dekorate/helm.
- If you would like to generate Tekton resources, comment the Knative and Helm Dekorate dependencies present in the pom.xml files:
<!-- <dependency>-->
<!-- <groupId>io.dekorate</groupId>-->
<!-- <artifactId>knative-annotations</artifactId>-->
<!-- <version>${dekorate-annotations.version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>io.dekorate</groupId>-->
<!-- <artifactId>helm-annotations</artifactId>-->
<!-- <version>${dekorate-annotations.version}</version>-->
<!-- </dependency>-->
Uncomment the following dependency (if commented in previous use case):
<dependency>
<groupId>io.dekorate</groupId>
<artifactId>tekton-annotations</artifactId>
<version>${dekorate-annotations.version}</version>
</dependency>
And now run:
$ mvn package -Ddekorate.build=false -Ddekorate.push=false
The above command will generate the Tekton manifests under todo-app-springboot/target/classes/META-INF/dekorate.