Posts

Showing posts from March, 2025

ETCD -- ETCD Snapshot

 To ensure etcd backups for a production-grade Kubernetes cluster, follow these ste Use etcdctl for Snapshots etcd provides a built-in snapshot mechanism using the etcdctl command-line tool. Here's how to take a backup: Log in to the control plane node where etcd is running. Run the following command to create a snapshot: ETCDCTL_API=3 etcdctl \   --endpoints=https://127.0.0.1:2379 \   --cacert=/etc/kubernetes/pki/etcd/ca.crt \   --cert=/etc/kubernetes/pki/etcd/server.crt \   --key=/etc/kubernetes/pki/etcd/server.key \   snapshot save /path/to/backup/etcd.db Replace /path/to/backup/etcd.db with your desired backup file location. Automate Backups Use a cron job to schedule regular backups. Store backups in a secure location, such as an S3 bucket or a remote server . . Verify Backups After creating a snapshot, verify its integrity: ETCDCTL_API=3 etcdctl snapshot status /path/to/backup/etcd.db Restore from Backup If you need to restore etcd, use the follo...

Laptop : Configure your laptop to connect to AKS - Azure

To configure your laptop to connect to an Azure Kubernetes Service (AKS) cluster, follow these steps: Install Prerequisites Azure CLI: Install the Azure CLI to interact with Azure resources. For installation instructions, visit Azure CLI Installation Guide . kubectl: Install the Kubernetes CLI tool to manage your AKS cluster. Install it using Azure CLI: az aks install-cli Authenticate with Azure Log in to your Azure account using the Azure CLI: az login If you have multiple subscriptions, set the desired subscription: az account set --subscription "<subscription-id>" Connect to the AKS Cluster Retrieve the cluster credentials and configure kubectl : az aks get-credentials --resource-group <resource-group-name> --name <aks-cluster-name> This command downloads the kubeconfig file and sets up kubectl to interact with the cluster. Verify the Connection Check the nodes in your AKS cluster: kubectl get nodes Optional: Use Azure Cloud Shell If you prefer not to ...

Kube-Proxy : Configure Production Grade Cluster

Configuring kube-proxy involves setting up its behavior for managing network traffic within a Kubernetes cluster. Here's a general guide: 1. Understand kube-proxy Modes kube-proxy supports two main modes for handling traffic: iptables Mode: Uses Linux iptables for routing traffic. It's simple and widely supported. IPVS Mode: Uses Linux Virtual Server (IPVS) for advanced load balancing and connection tracking. Configuring iptables mode for kube-proxy involves setting up network rules to route traffic efficiently within a Kubernetes cluster. Here's a step-by-step guide: Step 1: Verify kube-proxy Mode By default, kube-proxy operates in iptables mode . To confirm this: kubectl get configmap kube-proxy -n kube-system -o yaml Look for the mode field in the configuration file. Step 2: Modify kube-proxy Configuration If kube-proxy is not in iptables mode, update its configuration: Edit the kube-proxy ConfigMap: kubectl edit configmap kube-proxy -n kube-system Set the proxy-mod...

ETCD -- Deploying in productin grade cluster

Configuring etcd for a production-grade cluster requires careful planning to ensure high availability, fault tolerance, and consistency. Here's a step-by-step guide for the best configuration practices: 1. Plan a Highly Available Setup Deploy etcd as a distributed cluster with 3, 5, or 7 nodes to ensure fault tolerance. Use an odd number of nodes because etcd relies on quorum-based voting. Quorum: At least (N/2 + 1) nodes need to be available for the cluster to function (e.g., for 3 nodes, 2 must be active). Choose Stable Infrastructure Dedicated Nodes: Run etcd on dedicated nodes separate from other workloads to avoid resource contention. Persistent Storage: Use SSDs for high IOPS and low latency. Backup Strategy: Regularly back up etcd data using tools like etcdctl snapshot or automated backup solutions. Networking Configuration Ensure that low-latency, high-bandwidth networking is in place for cluster communication. Enable TLS encryption for secure communication betw...