Posts

Showing posts with the label Linux

Debugging a Kubernetes Cluster Part 1

 Debugging a Kubernetes cluster can be challenging, but by using systematic approaches and the right tools, you can efficiently diagnose and resolve issues. This guide provides an overview of common debugging methods and tools to help troubleshoot problems in a Kubernetes environment. 1. Understand the Problem Scope Questions to Consider: Is the issue affecting all nodes or a specific pod? Are services unreachable? Is the control plane responding correctly? Are logs indicating specific errors? Identifying the scope helps narrow down the troubleshooting process.   2. Check Cluster Components a. Verify Node Status Check if all nodes are healthy and ready: kubectl get nodes If a node is NotReady, inspect it further: kubectl describe node <node-name> Common issues: Insufficient resources. Network connectivity problems. Crashed kubelet service. Restart kubelet if needed: sudo systemctl restart kubelet   b. Inspect Control Plane Components Verify the health of control pla...

How to Create a Vanilla Kubernetes Cluster on BareMetal

 Kubernetes (K8s) is a powerful open-source container orchestration system, and deploying it on bare metal provides high performance and direct control over hardware. This guide walks you through setting up a vanilla Kubernetes cluster on bare metal servers. Prerequisites Hardware Requirements : At least 3 machines (1 Control Plane Node and 2 Worker Nodes). Minimum specifications: Control Plane Node : 2 CPUs, 2 GB RAM, 20 GB disk space. Worker Node : 1 CPU, 1 GB RAM, 10 GB disk space. Operating System : Ubuntu 22.04 (recommended) or any other Linux distribution. Network Setup : Unique hostname for each server. Static IP addresses or DHCP reservations. Disabled swap (required by Kubernetes). Tools : SSH access to all nodes. kubectl CLI tool. kubeadm for Kubernetes initialization. containerd or Docker as the container runtime. Step 1: Prepare the Nodes Update and Install Required Packages Log into each node and execute the following commands: sudo apt update && sudo apt upgra...