Posts

Showing posts with the label Spring Boot

AWS Lambda with API Gateway and spring boot

Image
Authentication with Firebase using AWS Lambda, API Gateway and Spring boot In this post, i will show you an example on how to create a Lambda function using a spring boot application, and then access the lambda function using API Gateway. A good use- case for this kind of set-up is as follows: Consider you have an api key which you are using to access a backend service like Firebase authentication.  Assuming that you have a frontend single page application like Angular, React etc, in a typical scenario you provide the api key in the environment.ts file and then invoke the backend using the api.  The biggest problem obviously is that since the single page applications are executed on the browser, anyone accessing the application can use the api key. There are different ways to solve this problem, for example keep the key in some backend application and make a request to the backend application to fetch the key. Though i feel this is not the best solution as the end users can st...

Spring Boot with Elastic Search

Image
Spring Boot With Elastic Search Elastic Search setup Installation The latest version can be downloaded from the following link: https://www.elastic.co/downloads/elasticsearch The server can be started by executing the elasticsearch.bat (for windows). Access http://localhost:9200 and you should get an output similar to this: { "cluster_name" : "elasticsearch", "cluster_uuid" : "LPD9wz2cSqOrzB9hUYCfGA", "version" : { "number" : "7.6.2", "build_flavor" : "default", "build_type" : "zip", "build_hash" : "ef48eb35cf30adf4db14086e8aabd07ef6fb113f", "build_date" : "2020-03-26T06:34:37.794943Z", "build_snapshot" : false, "lucene_version" : "8.4.0", "minimum_wire_compatibility_version" : "6.8.0", "minimum_index_compatibility_version" : "6.0.0...

Deploy Spring Boot Application on Kubernetes

Image
Deployment on Kubernetes The blog assumes that minikube and kubectl are setup on your machine. In addition the OS supports virtualization. The setup can be done using the following link: https://kubernetes.io/docs/setup/learning-environment/minikube/ The blog focusses on deploying your spring boot application on a kubernetes. As a pre-requisite, the docker images for the applications that need to be deployed should already be present in a public docker hub repository. For more instructions , kindly refer to the previous blog post : Dockerization of Spring Boot applications. Configuration Files Creation of Deployment.yaml The first step is to create a deployment.yaml for each application. The deployment yaml contains instructions like the name of the application, the number of replicas, name of the image etc. The yaml files can be executed using kubectl which will enable kubernetes(minikube) to create a service, pod as...