To list all pods and containers use the below command kubectl get pods -o=custom-columns=POD:.metadata.name,CONTAINERS:.spec.containers[*].name To list all pods and containers in a given namespace use the below command kubectl get pods -o=custom-columns=POD:.metadata.name,CONTAINERS:.spec.containers[*].name -n <<namespace>> Output of the above command will show PODs and the containers against it in a tabular format. Details on what are … Continue reading How do you list all the PODs and containers in your Kubernetes cluster
Author: rajeshsgr
What is a spring bean and is it different from Java class?
Spring beans and Java classes are both objects in Java, but they have different characteristics and are used for different purposes. A Spring bean is an object that is managed by the Spring Framework. This means that the Spring Framework is responsible for creating, configuring, and destroying the bean. Spring beans are typically used to … Continue reading What is a spring bean and is it different from Java class?
What is data lineage and why is it relevant?
Data lineage refers to the process of tracing the movement of data from its origin and the different stages of transformation it has to go through over a period of time before reaching its final destination. It provides a comprehensive view of the data source, its transformations, and its final destination within the data pipeline. … Continue reading What is data lineage and why is it relevant?
Inheritance & Java Sealed Classes
In Java, inheritance allows you to inherit the fields, methods, and nested classes of the parent class, and also add new features through polymorphism and method overriding. Declaring a class as final , prevents the class from getting inherited or extended. So at one end of the spectrum we have inheritance, which allows any subclass … Continue reading Inheritance & Java Sealed Classes
Mac keyboard shortcuts
A short blog to share Mac keyboard shortcuts that i use on a day to day basis for better productivity The shortcuts that i have compiled in this list are primarily for Taking Screenshot To Lock . Logout , Close Open windows Navigating between open applications Some short cuts for Safari or other web browsers … Continue reading Mac keyboard shortcuts
How to read variable set as File type in gitlab-ci.yml ?
If you have created variables in gitlab CI/CD setting, here is how you can access it in your gitlab-ci pipeline. In the above example, the variable has following settings Type: File Key: DB_ACCESS_URL Value: jdbc:oracle:thin:@myoracle.db.server:1521:my_sid To access this in your pipeline , gitlab provides 2 ways echo $Key will give the file path cat $Key … Continue reading How to read variable set as File type in gitlab-ci.yml ?
How do i check logs of a docker container ?
To demonstrate this, i have a sample spring boot application which prints log every 1000 milliseconds (1 second) @RestController public class RandomLoggerResource { private static final Logger logger = LoggerFactory.getLogger(RandomLoggerResource.class); private Random random = new Random(); @Scheduled(fixedRate = 1000) public void logRandomMessage() { int randomInt = random.nextInt(); String randomMessage = "Generating a Random integer every … Continue reading How do i check logs of a docker container ?
How do you add custom response headers in a Spring Boot application?
To add custom response headers in a Spring boot application use ResponeEntity class. Set the values using HttpHeader object. Set the header object in response entity To set a response header for all the response , implement a Filter class and set the header in the ServletResponse class Code Snippet @Component public class ResFilter implements … Continue reading How do you add custom response headers in a Spring Boot application?
How do you find period or times of the day in Java ?
I accidentally stumbled upon this feature in Java and although it might not be super useful, I have encountered a few use cases to identify the time or period of the day, such as morning, afternoon, or night and this feature has helped . Starting Java 16 , the DateTimeFormatter class which is used for … Continue reading How do you find period or times of the day in Java ?
My favorite reads of 2022
This year, my reading habit wasn't as regular and consistent as I wanted it to be, but I still managed to read quite a few books. These were my favorites Phoenix Project The Phoenix Project is a business novel written by Gene Kim, Kevin Behr, and George Spafford. It is a fictional story that follows … Continue reading My favorite reads of 2022