Kloud Native JHipster

JHipster ♥ Spring Boot ♥ K8s

Srinivasa Vasu
Geek Culture

--

JHipster is a developer-friendly platform to bootstrap, iterate, build and deploy cloud-native Spring Boot-based services. It also generates scaffolding code for front-end services based on widely used frameworks/libraries like Angular, React, etc. It does provide integration touchpoints with various data, logging, and monitoring services as well.

Over the years scaffolding support is added to deploy the generated services across various native clouds and platforms. Developers love JHipster and developer productivity is one of the core values that we iterate on as a community to continuously improve it. As the popularity of Kubernetes keeps growing day by day among different personas of an enterprise, we also have added a lot of cool k8s friendly features. In this blog, we shall look at various k8s friendly generator options and the features that are available for the developers to quickly iterate and test on any open conformant k8s distributions in both private and public clouds.

Outcomes:

  • Getting to know about various K8s generator options
  • Leveraging K8s friendly toolkits to accelerate release velocity

Pre-reqs:

  • jhipster cli binary in the local machine

Note, we will use the k8s generator options once the project is bootstrapped and built using jhipster-cli. K8s is one of the targetted platforms that JHipster supports generating deployment artifacts.

Wave#1

jhipster k8s | jhipster kubernetes

We have been supporting this generator option for quite some time now. It prompts you with a series of questions that then generates k8s manifests with a deployment script that lets you deploy the service(s) at one go. Other than the kubectl create|apply option, we have recently added support to extend it using popular k8s toolkits like kustomize and skaffold.

You may now choose to deploy the generated manifests,

./kubectl-apply.sh -f — uses the standard kubectl apply -f option

and

./kubectl-apply.sh -k — uses kustomization template to persist the changes

With skaffold now you can turn your working directory to a CI/CD source. As you work on the source code, changes get detected, built and deployed continuously to the platform. Developers focus only on the business problems and the dev software delivery pipeline is heavy lifted by the skaffold tool.

skaffold dev turns your working directory to a CI/CD source. This is super productive where developers continuously iterate on without the build and deployment overhead.

skaffold dev

Wave#2

jhipster helm | jhipster kubernetes-helm

helm generator support is in place for quite some time now. k8s generator is cool, but the challenge we had with, even we are facing the issue today in terms of maintaining the manifests for ancillary services. When you choose services like Kafka, Elastic, Mongo, etc we are facing issues keeping those manifests compatible with the upstream. This is an on-going maintenance overhead to keep those manifests in sync with the upstream. Moreover, most of the manifests are very basic and not recommended for production use.

We have a solution now with the helm generator. Under the hood, it uses k8s generator for apps, but the ancillary services’ manifests are pulled-in from the upstream stable helm sources. With this, you have an enterprise-grade stable manifest for the services that you can confidently roll it out to production.

In addition to the app and services manifests, it generates a single command ready to execute scripts helm-apply.sh for the initial installation

helm-apply.sh - first time install

helm-apply.sh

and helm-upgrade.sh for subsequent updates as you continue to iterate and evolve rapidly.

helm-upgrade.sh - continuous iteration

Generated scripts would support both helm2+ and 3+ semantics and syntax. The pre-req to use this generator is to have the helm CLI in the local machine and if you intend to use helm2+, then tiller should be deployed in the cluster. The generated service manifests would work without any issues on 2+ and you may face some issues with 3+ as some of the upstream distributions haven’t been fully upgraded for 3+ compatibility.

Wave#3

jhipster knative | jhipster kubernetes-knative

We have added support for knative constructs recently. This is still experimental. We have added it recently to generate knative serving.knative.dev service lifecycle for the generated apps. The pre-req to use this generator is istio though, as this generator generates istio specific virtual-service and destination-rule related manifests for your apps. Today it is istio only, in the future we may add support for other controllers as well. This generator, in turn, leverages both k8s and helm. Developers will be prompted to choose one of the generators while leveraging knative,

jhipster knative

Like other generators, it does provide one push deployment through kubectl-knative-apply.sh if you choose Kubernetes generator,

knative-k8s

and if you choose helm generator, it generates scripts for both install and update.

knative-helm

References:
JHispter
https://www.jhipster.tech/
K8s Generator
https://www.jhipster.tech/kubernetes/
CLI:
https://www.jhipster.tech/installation/

--

--

Srinivasa Vasu
Geek Culture

Aspiring Software Artist | views expressed on this blog are solely mine |