Posts

Introduction to Docker

Docker provides, Package Once Deploy Anywhere, or PODA. Docker Concepts: Docker simplifies software delivery of distributed applications in three ways: Build: Provides tools to create containerized applications. Developer package the application, its dependencies and infrastructure as read only templates. These are called the Docker image. Ship: Allows to share these applications in a secure and collaborative manner. Docker images are stored, shared and manged in a Docker registry. Docker Hub is a publicly available registry. This is the default registry for all images. Run: The ability to deploy,manage and scale these applications. Docker container is a runtime representation of an image. Container can be run, started, scaled, moved and deleted. What is  Docker Client ? The client is a Docker binary that accepts commands from the user and communicates back and forth with the Docker Engine. What is Docker Host: A machine, either physical or ...

Spring Session

Spring Session provides an API and implementation for managing a user's session information. It also support clustered sessions without being tied to an application container-specific solution. Spring session support  integration with the HttpSession, WebSocket and WebSession. HttpSession : HttpSession replace HttpSession in application container with support of providing sessionId in header to work with RESTFUL APIS . WebSocket : It keeps alive HttpSession when receiving webSocket message. WebSession : WebSession replace Spring WebFlux's WebSession in an application container neutral way. Above thing can be  achieved using Spring Session Core, Spring Session Data Redis, Spring Session JDBC, Spring Session HazelCast. Spring Session Core provides core Spring Session functionality and API. Spring Session Data Redis provides SessionRepository and ReactiveSesssionRepository implementation backed by Redis and Configuration support. Spring Session JDBC provides Ses...

Spring Security Authentication

Image
Spring Security   provides comprehensive support for Authentication. Spring security Authentication has various section like, SecurityContextHolder Object Overview SecurityContextHolder: Spring Security Stores the details of who is authenticated. SecurityContextHolder uses a ThreadLocal to store authenticated user and authenticated principal. SecurityContextHolder uses ThreadLocal. Hence, We can access its details across the method. SecurityContext: It contains the Authentication of the currently authenticated user. Spring Security does not care how the securityContextHolder is populated. If it contains a value, then it is used as the currently authenticated user. The SecurityContext is obtained from the SecurityContextHolder. Authetication: Can be put input to AuthenicationManager to provide the credentials a user has provided to authenticate or the current user from the SecurityContext. The Authentication contains: principal, credentials and authorities.Prin...

Spring Security Filter

Spring Security is a framework that provides key security mechanism authentication, authorization and and protect application against attack. Spring security 5.3.2 requires a Java 8 or higher Run-time Environment. There is not any need to configure a special Java Authentication and Authorization Service (JAAS) policy file or place Spring Security into common classpath locations. All required files are contained within your application. Filter in Spring Security Spring Security Servlet support is based on Servlet Filters. The behavior of Filter is like, Client sends a request to the application and the container creates a FilterChain. FilterChain contains the Filter and Servlet that should processes the HttpServletReques based on path of RequestURI. One Servlet can handle a single HttpServletRequest and HttpServletResponse. More than one filter can prevent downstream Filter or the Servlet from being invoked. Filter can also modify the HttpServletRequest or HttpServletResponse use...

Maven Setting Mirror

Maven Mirror specify from where dependencies should be downloaded. There is already repository tag is available but maven mirror used in specific condition. Let's see that. Geographically closer mirror to get dependencies You want to represent repository which have better control of dependencies Need to provide local cache to repository manager In the organisation, to avoid external traffic we can use mirror. Let's see the working of mirror. The scenario is like, we have two repository first, Maven Central and second, Custom We have declared dependencies to an  artifact. Maven will look into Custom repository. Dependencies is not found into the Custom repository.  Maven will go to central repository. Maven will notice that mirror was configured for that repository. Maven will not go to central but it will go to mirror URL. Following way we can declare, Mirror in settings.xml <settings> ... <mirrors> <mirror> ...

Kubernetes Vs Docker

Image
                  Kubernetes and Docker both are used in Cloud Computing. Kubernetes and Docker are used in line with one another.  Using containerization technology, Kubernetes allows running containers across several compute nodes. Depending on the requirements, Kubernetes can make the containers spun up or torn down.                    Docker is a light weight VM for software packaging and delivery platform. Before Kubernetes there is concept of   Docker Swarm. Docker Swarm is an open-source container orchestration platform. It is the native clustering engine for Docker. Kubernetes vs Docker Conclusion:              Kubernetes provides container orchestration and Docker provides Operating System level virtualization. 

Kubernetes Service

Image
               Why Service needs?             Kubernetes Pods are born and when they die, they are not resurrected. Using deployment, we can assign desired state of the pod. Deployment can create and destroy Pods dynamically. In cluster, If some set of Pods (call them "backends") provides functionality to other Pods (call them "frontends"). Frontends Pods find out and keeep track of which IP address to connect to, so that the frontend can use backend part of the the Pods.            In Kubernetes, a Service  defines a logical set of Pods and a Policy by which we can access them. A service in kubernetes is a REST object, similar to object. We can create POST service to create a new instance. The set of Pods targeted by a service is determined by a selector. Frontends Pods do not care which backend they use. While the actual Pods that compose the backend ...