Spring Boot

Introduction

Spring Boot is one of the popular Java microservices framework. It is used to build stand-alone and production ready Spring applications.

  1. Deployment of springboot application on top of Kubernetes using GitOps from Client’s Git repository.
  2. Built-in logging and monitoring visualization through AppZ Dashboard.

Pre-requisites

  • Setup AppZ Cluster- Install AppZ Cluster from AWS Marketplace. Find the instructions at our product documentation. Before deploying SpringBoot application, make sure both vault and MySQL applications are deployed.

Stack Code

springboot-v2 - To be mentioned in build.image_template in appz.yml.

Sample Project

Springboot - Use this sample project to deploy Spring Boot.

If you fork Springboot under your Git account, you will see the following appz.yml in the root of your project.

app:
  code: SBW
  name: Spring Boot Web
  notify: appzdev@cloudbourne.co

build:
  build_file: pom.xml
  env: DEV
  image_template: springboot-v2
  output_files: target/*.jar
  version: 0.4

deploy:
  context: alpha/DEV
  port: 8080
  replicas: 1

properties:
  title: Spring Boot Web - Wednesday
  MYSQL_DB_HOST: mysql-5-7
  MYSQL_DB_NAME: springboot_web
  MYSQL_DB_PORT: 3306
  MYSQL_DB_USERNAME: springboot-web
  MYSQL_SPRINGBOOTWEB_PASSWORD:
    vault: MYSQL_SPRINGBOOTWEB_PASSWORD
  nano: 11

After forking the Springboot application, add app and acl records of Spring Boot application in the AppZ Dashboard. After, you should customize the following in appz.yaml file and then Commit it.

  1. "notify" under app section.

  2. change notify email to your email.

  3. "context" under deploy section

  4. Replace alpha with your GitID.

Properties

The image is vault enabled so secrets can be pulled from vault. These are placed under properties in appz.yml.

  • title - A custom name.
  • MYSQL_DB_HOST - mysql host for connecting springboot with mysql
  • MYSQL_DB_NAME - Name of Database 'springboot_web' in MySQL server
  • MYSQL_DB_PORT - Default port for MySQL
  • MYSQL_DB_USERNAME - user 'springboot-web' of the springboot_web DB in MySQL server
  • MYSQL_SPRINGBOOTWEB_PASSWORD - Password of the user springboot-web

Volumes

It is not mandatory to create volumes unless applications need them, these are optional.

Standard AppZ Volumes are enabled.