Posts

Kubernetes Cluster Architecture

  1. What is Kubernetes cluster architecture? A Kubernetes cluster has two main parts: Control plane: The brain of the cluster. It decides and coordinates what should happen. Worker nodes: The machines that run your application Pods. +----------------------+ |    Control Plane     | +----------------------+ | kube-apiserver       | | etcd                 | | kube-scheduler       | | kube-controller-mgr  | | cloud-controller     | +----------------------+           |           v +----------------------+ |     Worker Nodes     | +----------------------+ | kubelet              | | container runti...

GKE (Google Kubernetes Engine)

  GKE (Google Kubernetes Engine) - Easy Notes & Interview Summary What is GKE? Google Kubernetes Engine (GKE) is Google's fully managed Kubernetes service that allows you to deploy, manage, and scale containerized applications on Google Cloud without managing the underlying Kubernetes infrastructure. Remember the difference: Kubernetes: The system that manages containerized applications. GKE: Google Cloud's service that helps you run Kubernetes without having to manage all the underlying infrastructure yourself. Real-world example Suppose you have a Java Spring Boot application with a PostgreSQL database, and you want to deploy it to the cloud. Without GKE, you might need to install and maintain Kubernetes yourself, manage cluster machines, handle upgrades, and configure recovery. With GKE, Google manages many of these infrastructure and Kubernetes operations for you, depending on the operating mode you select. Why GKE? Imagine you're running Kubernetes yourself: Need ...

Image vs. container — understand this first

Image
 1. Image vs. container — understand this first Image Container A blueprint/template A running instance of an image Read-only Read-write while running Created using a Dockerfile Created from an image Does not execute by itself Actually runs your application Can be shared via registries (Docker Hub, ECR, etc.) Exists on a host machine while running/stopped Simple analogy Think of it like a Java application: Image = the compiled JAR file ( myapp.jar ) Container = the running Java process ( java -jar myapp.jar ) Or: Image = class definition Container = object instance Example # Build image docker build -t myapp . # Create and run container from image docker run -d --name myapp-container myapp After running: myapp → Docker image myapp-container → Docker container Relationship One image can create many containers: After running: myapp → Docker image myapp-container → Docker container Relationship One image can create many containers: Image: nginx:latest       ...

Introduction to Containers

Image
  Section: Introduction to Containers By the end of this lesson, you should understand: What containers are and why we need them. The difference between physical servers, virtual machines (VMs), and containers. How containers work. Why containers are important for Kubernetes and GKE. 1. First, understand the problem Imagine you have developed a Java Spring Boot application. For your application to run, you need: Java (JDK/JRE) Required libraries and dependencies Configuration files Your application code The problem is that your application works on your laptop but fails on another computer because the Java version or dependencies are different. Containers solve this problem by packaging your application with its required dependencies. 2. The evolution: Physical servers → VMs → Containers 1. Physical servers Imagine one physical computer dedicated to running your application. Problems: Hardware is expensive. Resources can be wasted. Scaling requires additional machines. Setup and ma...

App Engine vs Compute Engine vs GKE

  1. What is App Engine? App Engine is a Google Cloud service that lets you deploy and run your application without having to manage the server yourself. Suppose you have developed a Java Spring Boot application. Normally, you might need to: Create a server. Install Linux. Install Java. Configure the server. Deploy your application. Monitor the server and manage scaling. With App Engine, Google manages much of this infrastructure for you. You focus mainly on writing your application and deploying it. 2. Real-life example Imagine you're building a food delivery application like Swiggy. Your Java Spring Boot code Restaurant API, login API, order API Deploy to App Engine Google provisions and manages the application runtime Google runs your application Hosting, traffic handling and scaling features Customer uses your app The app sends HTTP requests to your APIs For example, a customer requests restaurant details. The request reaches your application running on App Engine, your Java co...

GKE Foundations — Google Cloud's Compute Workload Options

Image
  GKE Foundations — Google Cloud's Compute Workload Options Google Cloud provides different services to run applications. The best choice depends on how much control you need over the infrastructure and how you want to deploy your application. Let's understand each service from a beginner's perspective. 1. The main compute services 1. Kubernetes Engine (GKE) Containers A managed environment for deploying and managing containerized applications using Kubernetes. Example: Deploy multiple Spring Boot microservices in Docker containers and let Kubernetes manage scaling and recovery. 2. Compute Engine Virtual machines Provides virtual machines (VMs) where you control the operating system, software, and runtime configuration. Example: Create a Linux VM, install Java, and run your Spring Boot JAR file. 3. App Engine Platform as a service A managed platform for deploying applications without managing the underlying servers directly. Example: Deploy a supported web application and l...

How to Interact with Google Cloud Platform (GCP)

Image
  GKE Foundations — Section: How to Interact with Google Cloud Platform (GCP) Let's understand this video from zero, with simple examples and practical commands. This topic is important because, while learning Kubernetes Engine (GKE), you'll use tools like Google Cloud Console, Cloud Shell, gcloud , and kubectl . 1. What is GCP? Google Cloud Platform (GCP) is Google's cloud computing platform. Instead of purchasing and maintaining physical servers, you can use Google's infrastructure to run applications. For example, imagine you have a Java Spring Boot application that you want to deploy. You might need: A virtual machine or Kubernetes cluster to run your application. Storage to store files. A network to connect services. Monitoring to check CPU usage and application errors. GCP provides these services, and you need tools to manage them. 2. The four ways to interact with GCP 1. Google Cloud Console GUI A website where you manage cloud resources using your mouse and keyb...

Deployment strategies in real projects

Image
  Deployment strategies in real projects Three deployment approaches are worth knowing: Rolling deployment Gradually replace old application instances with new ones. Useful for many routine releases. Blue-green deployment Run old and new versions in separate environments, test the new version, then switch traffic. This needs additional capacity and careful handling of state. Canary deployment Release the new version to a small portion of traffic first, check its performance, and gradually expand the release if everything looks good. For example, a bank might first release a new payment-service version to a small group of users or a limited portion of traffic before making it available to everyone. Note that Kubernetes Deployments support rolling updates directly.  Blue-green and canary releases typically need additional traffic-routing configuration or deployment tooling.

Java 21 Interview Preparation: 8 Topics Every Senior Java Developer Should Know

  Java 21 Interview Preparation: 8 Topics Every Senior Java Developer Should Know Java 21 introduced important features that interviewers may explore through coding questions, internal workings, and real-world scenarios. If you have 8+ years of Java experience, prepare these topics: 1. Virtual Threads * Platform threads vs virtual threads * How does Project Loom work? * When should you use virtual threads? * What are thread pinning and its implications? 2. Structured Concurrency (Preview in Java 21) * What problem does structured concurrency solve? * How do you manage multiple concurrent tasks? * How should task cancellation and failures be handled? 3. Pattern Matching for switch * How is it different from traditional switch? * How do type patterns and guarded patterns work? * What is exhaustive pattern matching? 4. Record Patterns * How do record patterns simplify data extraction? * How do nested record patterns work? * How can they be combined with pattern matching for switch? 5....