<p>I do have a spring boot microservice(SERVICE A) &amp; Artemis JMS server running inside the Azure AKS cluster and React web application serving the static pages also from within the cluster. These three applications have Kubernetes deployment and service resources and are deployed using a <strong>helm</strong> chart.</p>

<p>Now I need to spin up another microservice on demand whenever the user creates an entry from UI.
For example, I do have pre-defined Kubernetes resources(as helm chart) for Customer microservice but only need to spin up the microservice when user creates a customer, also every time a new customer created, I need to spin up another customer microservice instance. I also need to pass the customer name as an environment variable to the customer microservice every time it is being created so each customer microservice can subscribe to a particular topic. </p>

<p>Is there a way to achieve this? I also, want to manage the created microservice. for example, when the customer is deleted then I need to delete the Kubernetes resources related to the customer. Is it easy to achieve this using a helm chart? but I want to know how to manage the helm chart from within the running Spring boot application. </p>

<p>Can this be achieved using the Fabric8 library?</p>

<p>Any suggestions would be greatly helpful. </p>

seenimurugan
<p>You don't really need a Helm chart for this. In general, you can access the <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.16/" rel="nofollow noreferrer">Kubernetes API</a> from an application running in the cluster in the same way as from outside the cluster. The Kubernetes API is an HTTP REST API and you just have to make HTTP requests to it with proper authentication credentials.</p>

<p>Since you're using Java, you could use the official <a href="https://github.com/kubernetes-client/java" rel="nofollow noreferrer">Java client library</a> for Kubernetes to access the Kubernetes API and create/delete any resources directly from your application code.</p>

<p>The Java client library also assists you for using the right authentication and takes care of any other details.</p>
