Posts

Showing posts from 2023

Kubernetes and Helm packing

Image
SETUP for Kubernetes Install the docker and check the version. (Visit the docker website to install) check the version using the command docker version Install Minikube  wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 cp minikube-linux-amd64 /usr/local/bin/minikube sudo chmod 755 /usr/local/bin/minikube minikube version minikube start ->to start the Kubernetes this command will take a couple of minutes to complete. Install Kubectl curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl   give permission for the folder chmod u+x kubectl move this folder to user bin  sudo mv kubectl /usr/local/bin/ execute kubectl version to check client and server versions  See the compatible client and server GitVersions v1.25.2 check whether the cluster is running or not using - >minikube status Helm Installation Visit https:/...

How to Test Application Context in Spring Boot

 Usually, we won't bother about the Junit test for the application context and bean instantiations, blindly trust about the stability of the spring boot framework. And spring boot generates automatically a test class with a method contextLoads() @Test void contextLoads () { } To check the beans are launching properly or not we can frame springboot application like below  @SpringBootApplication public class PracticeApplication { public static void main (String[] args) { ConfigurableApplicationContext ctx=SpringApplication. run (PracticeApplication. class , args); printBeanNames (ctx); } Lets deal with the context object  private static void printBeanNames (ApplicationContext ctx) { String[] beanDefinitionNames = ctx.getBeanDefinitionNames(); for (String bean:beanDefinitionNames) System. out .println( "BeanNAme is " +bean); int beanDefinitionCount = ctx.getBeanDefinitionCount(); System. out .println( "beanDefinitionCount...