How to Get Started with Cloud Native Starter for Java EE Microservices on Kubernetes and Istio

Jan 19, 2023 | Programming

The Cloud Native Starter project serves as an excellent foundation for building cloud-native applications and microservices with Java EE. It leverages powerful frameworks and tools to set you on the right path. This guide walks you through the setup of the project, its components, and tips for troubleshooting.

Understanding the Project Structure

This project consists of three main parts:

  • Basic Concepts: Learn to develop and operate enterprise applications using Java, MicroProfile, Kubernetes, OpenShift, and Istio. For a quick overview, visit the basic-concepts landing page.
  • Reactive: Understand reactive programming and event-based messaging within Quarkus applications. You can find this in the reactive folder, or check out the reactive landing page.
  • Security: Discover authentication and authorization in Quarkus applications with Keycloak and preventing vulnerabilities via network encryption with Istio. The details are available in the security folder or the security landing page.

Setting Up Cloud Native Starter on Minikube

To run the sample application locally, follow these instructions carefully:

  1. Ensure you have Minikube and Istio properly installed. If you need help, refer to the setup instructions.
  2. Clone the repository and navigate into it:
  3. $ git clone https://github.com/IBM/cloud-native-starter.git
    $ cd cloud-native-starter
  4. Set the root folder as follows:
  5. $ ROOT_FOLDER=$(pwd)
  6. Install the necessary tools if not already done:
  7. Install using a Docker image:
  8. $ cd $ROOT_FOLDER
    $ docker run -v $ROOT_FOLDER:cloud-native-starter -it --rm ibmcom/ibm-cloud-developer-tools-amd64
  9. Run the deployment scripts:
  10. $ cd $ROOT_FOLDER
    $ scripts/check-prerequisites.sh
    $ scripts/deploy-articles-java-jee.sh
    $ scripts/deploy-web-api-java-jee.sh
    $ scripts/deploy-authors-nodejs.sh
    $ scripts/deploy-istio-ingress-v1.sh
    $ scripts/deploy-web-app-vuejs.sh
    $ scripts/show-urls.sh
  11. You will see a list of URLs where your applications can be accessed.

Understanding the Code: An Analogy

Think of developing microservices as preparing distinct dishes for a dinner party. Each dish (microservice) needs its ingredients (code) and a unique recipe (functionality). You utilize various kitchen gadgets (frameworks like Kubernetes, OpenShift, and Istio) to ensure that everything runs smoothly and enhances your dishes (by bringing in traffic, handling failures, and adding flavor of security). Finally, just like you might serve your dinner in different courses (deploying in separate environments), the setup allows you to showcase your culinary skills in a restaurant environment (production). Just as each chef has a preferred style, developers can choose to focus on the basic concepts, reactive programming, or security, depending on their taste and requirements.

Troubleshooting Tips

If you encounter issues while setting up or running your microservices, consider the following:

  • Ensure Minikube and Istio are running correctly by following the respective installation instructions.
  • Check for any missing dependencies listed in the prerequisites.
  • If deployment scripts fail, look at the logs to identify where the error occurred.
  • Restart your local environment to resolve any transient issues.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Cleanup and Uninstalling the Project

To remove all components from your environment, run:

$ scripts/delete-all.sh

You can also delete specific components individually.

Conclusion

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox