<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sri Harsha Kavuluri on Medium]]></title>
        <description><![CDATA[Stories by Sri Harsha Kavuluri on Medium]]></description>
        <link>https://medium.com/@harsha.kavuluri?source=rss-67311b2a1f7b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*BXpRJmRPzRvhyw7DlPj5wA.jpeg</url>
            <title>Stories by Sri Harsha Kavuluri on Medium</title>
            <link>https://medium.com/@harsha.kavuluri?source=rss-67311b2a1f7b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 10:45:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@harsha.kavuluri/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building a Production-Grade Istio Service Mesh on k3d with Zero-Trust Security]]></title>
            <link>https://medium.com/@harsha.kavuluri/building-a-production-grade-istio-service-mesh-on-k3d-with-zero-trust-security-ef89bf540906?source=rss-67311b2a1f7b------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef89bf540906</guid>
            <dc:creator><![CDATA[Sri Harsha Kavuluri]]></dc:creator>
            <pubDate>Tue, 06 Jan 2026 05:57:59 GMT</pubDate>
            <atom:updated>2026-01-06T05:57:59.351Z</atom:updated>
            <content:encoded><![CDATA[<p>Step-by-step guide to deploy Istio with sidecar injection, traffic management, observability, and zero-trust policies on a lightweight Kubernetes cluster</p><blockquote><strong>Introduction</strong></blockquote><p>Kubernetes has become the standard for running containerized workloads, but managing service-to-service communication, traffic policies, observability, and security can quickly become complex as the number of microservices grows.</p><p><strong>Istio</strong>, a popular service mesh, provides:</p><ul><li>Sidecar-based traffic management</li><li>mTLS encryption between services</li><li>Advanced routing and traffic shaping</li><li>Observability with Prometheus, Grafana, Kiali, and Jaeger</li><li>Zero-trust security policies</li></ul><p>In this guide, I will show you how to deploy a <strong>fully functional, production-grade Istio service mesh</strong> on a lightweight <strong>k3d cluster</strong>, implement <strong>sidecar injection</strong>, <strong>traffic management</strong>, and <strong>zero-trust policies</strong>, and integrate observability tools.</p><blockquote><strong>Prerequisites</strong></blockquote><ul><li>Docker installed and running</li><li>k3d (Kubernetes in Docker)</li><li>kubectl and istioctl installed</li></ul><p>For this demo, we’ll deploy <strong>a k3d cluster with 3 servers and 5 agents</strong> to simulate a production environment.</p><blockquote><strong>Step 1: Create a Kubernetes Cluster</strong></blockquote><pre>k3d cluster create istio-cluster --servers 3 --agents 5<br>kubectl get nodes</pre><p>Label the namespace for <strong>Istio sidecar injection</strong>:</p><pre>kubectl create namespace apps<br>kubectl label namespace apps istio-injection=enabled</pre><blockquote><strong>Step 2: Deploy Istio Control Plane</strong></blockquote><p>Istio uses a <strong>sidecar pattern</strong>, where an <strong>Envoy proxy is injected into every pod</strong>. We will use the <strong>IstioOperator YAML</strong> for production-grade deployment.</p><p><strong>IstioOperator.yaml Highlights</strong></p><ul><li>Sidecar auto-injection enabled</li><li><strong>Ingress gateway</strong> with LoadBalancer</li><li><strong>Egress gateway</strong> for controlled outbound traffic</li><li><strong>Pilot replicas</strong> for HA</li><li>Tracing enabled</li></ul><pre>apiVersion: install.istio.io/v1alpha1<br>kind: IstioOperator<br>spec:<br>  profile: default<br>  components:<br>    pilot:<br>      k8s:<br>        replicaCount: 2<br>    ingressGateways:<br>    - name: istio-ingressgateway<br>      enabled: true<br>      k8s:<br>        replicaCount: 2<br>        service:<br>          type: LoadBalancer<br>    egressGateways:<br>    - name: istio-egressgateway<br>      enabled: true<br>      k8s:<br>        replicaCount: 1<br>  values:<br>    global:<br>      proxy:<br>        autoInject: enabled</pre><p>Install Istio:</p><pre>istioctl install -f 01-istio-operator.yaml -y</pre><blockquote><strong>Step 3: Deploy a Sample Application</strong></blockquote><p>We will use the <strong>Bookinfo application</strong> to validate our Istio setup</p><pre>kubectl apply -n apps -f https://raw.githubusercontent.com/istio/istio/release-1.28/samples/bookinfo/platform/kube/bookinfo.yaml</pre><p>Check pods:</p><pre>root@PF4XQ8QF:istio$ kubectl get pods -n apps<br>NAME                              READY   STATUS    RESTARTS   AGE<br>details-v1-77b775f46-5f2ff        2/2     Running   0          40m<br>productpage-v1-78dfd4688c-gkf46   2/2     Running   0          40m<br>ratings-v1-7c4c8d6794-cbkpq       2/2     Running   0          40m<br>reviews-v1-849f9bc5d6-bmfmv       2/2     Running   0          40m<br>reviews-v2-5c757d5846-lx82f       2/2     Running   0          40m<br>reviews-v3-6d5d98f5c4-6kjf4       2/2     Running   0          40m<br>root@PF4XQ8QF:istio$</pre><p>Each pod should show <strong>2/2 containers</strong>, indicating the <strong>Envoy sidecar is injected</strong>.</p><blockquote><strong>Step 4: Configure Gateway and VirtualService</strong></blockquote><p>Istio exposes applications externally through a <strong>Gateway</strong>, while <strong>VirtualService</strong> defines the routing rules.</p><p><strong>Gateway</strong></p><pre>apiVersion: networking.istio.io/v1beta1<br>kind: Gateway<br>metadata:<br>  name: bookinfo-gateway<br>  namespace: apps<br>spec:<br>  selector:<br>    istio: ingressgateway<br>  servers:<br>  - port:<br>      number: 80<br>      name: http<br>      protocol: HTTP<br>    hosts:<br>    - &quot;*&quot;</pre><p><strong>VirtualService</strong></p><pre>apiVersion: networking.istio.io/v1beta1<br>kind: VirtualService<br>metadata:<br>  name: bookinfo<br>  namespace: apps<br>spec:<br>  hosts:<br>  - &quot;*&quot;<br>  gateways:<br>  - bookinfo-gateway<br>  http:<br>  - match:<br>    - uri:<br>        prefix: /<br>    route:<br>    - destination:<br>        host: productpage<br>        port:<br>          number: 9080</pre><blockquote><strong>Step 5: Traffic Management and Canary Deployments</strong>DestinationRule</blockquote><p><strong>DestinationRule</strong></p><p>Define subsets for service versions:</p><pre>apiVersion: networking.istio.io/v1beta1<br>kind: DestinationRule<br>metadata:<br>  name: reviews<br>  namespace: apps<br>spec:<br>  host: reviews<br>  subsets:<br>  - name: v1<br>    labels:<br>      version: v1<br>  - name: v2<br>    labels:<br>      version: v2</pre><p>VirtualService for Canary</p><pre>apiVersion: networking.istio.io/v1beta1<br>kind: VirtualService<br>metadata:<br>  name: reviews-canary<br>  namespace: apps<br>spec:<br>  hosts:<br>  - reviews<br>  http:<br>  - route:<br>    - destination:<br>        host: reviews<br>        subset: v1<br>      weight: 80<br>    - destination:<br>        host: reviews<br>        subset: v2<br>      weight: 20<br>    retries:<br>      attempts: 3<br>      perTryTimeout: 2s<br>      retryOn: gateway-error,connect-failure,refused-stream<br>    timeout: 5s</pre><blockquote>Step 6: Observability Stack</blockquote><p>Enable <strong>Grafana, Prometheus, Kiali, Jaeger</strong>:</p><pre>kubectl apply -n istio-system -f https://raw.githubusercontent.com/istio/istio/release-1.28/samples/addons/prometheus.yaml<br>kubectl apply -n istio-system -f https://raw.githubusercontent.com/istio/istio/release-1.28/samples/addons/grafana.yaml<br>kubectl apply -n istio-system -f https://raw.githubusercontent.com/istio/istio/release-1.28/samples/addons/kiali.yaml<br>kubectl apply -n istio-system -f https://raw.githubusercontent.com/istio/istio/release-1.28/samples/addons/jaeger.yaml</pre><pre>root@PF4XQ8QF:istio$ k get po -n istio-system<br>NAME                                    READY   STATUS    RESTARTS   AGE<br>grafana-58df5dd565-q2ffg                1/1     Running   0          36m<br>istio-egressgateway-8b6f546bb-hmtgm     1/1     Running   0          49m<br>istio-ingressgateway-6f65c4b977-2782m   1/1     Running   0          49m<br>istiod-5d97bc8bb8-5dkd2                 1/1     Running   0          50m<br>jaeger-5f7447d5c5-b5ncc                 1/1     Running   0          36m<br>kiali-75466ff674-xfhcq                  1/1     Running   0          36m<br>prometheus-54c7c856b5-b2vfz             2/2     Running   0          36m<br>root@PF4XQ8QF:istio$</pre><p>Access dashboards:</p><pre>istioctl dashboard kiali<br>istioctl dashboard grafana<br>istioctl dashboard jaeger</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yMxVGX0Ylu4dO3AFmXwkLQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XrRj46LsbBI_pBF8oEZlEw.png" /></figure><blockquote><strong>Step 7: Zero-Trust Security Policies</strong></blockquote><p>Enable mTLS Strict Mode</p><pre>apiVersion: security.istio.io/v1beta1<br>kind: PeerAuthentication<br>metadata:<br>  name: default<br>  namespace: apps<br>spec:<br>  mtls:<br>    mode: STRICT</pre><p>AuthorizationPolicy Example</p><pre>apiVersion: security.istio.io/v1beta1<br>kind: AuthorizationPolicy<br>metadata:<br>  name: productpage-access<br>  namespace: apps<br>spec:<br>  selector:<br>    matchLabels:<br>      app: productpage<br>  action: ALLOW<br>  rules:<br>  - from:<br>    - source:<br>        principals:<br>        - cluster.local/ns/apps/sa/default</pre><p>Deny Egress Traffic</p><pre>apiVersion: security.istio.io/v1beta1<br>kind: AuthorizationPolicy<br>metadata:<br>  name: deny-external<br>  namespace: apps<br>spec:<br>  action: DENY<br>  rules:<br>  - to:<br>    - operation:<br>        hosts:<br>        - &quot;*&quot;</pre><p>These policies enforce a <strong>zero-trust environment</strong>, allowing only authorized service accounts to communicate and preventing unauthorized egress traffic.</p><blockquote><strong>Conclusion</strong></blockquote><p>With the steps above, you can deploy a <strong>full-featured Istio service mesh</strong> on a lightweight k3d cluster.</p><p><strong>Key takeaways:</strong></p><ul><li>Sidecar proxies <strong>secure and manage service-to-service traffic</strong></li><li>Istio Gateways + VirtualServices allow <strong>flexible routing and ingress/egress control</strong></li><li>Observability stack provides <strong>metrics, logs, and distributed tracing</strong></li><li>Zero-trust policies enforce <strong>strict access control and mTLS encryption</strong></li></ul><p>This setup is <strong>production-grade</strong>, fully automated, and can be extended to <strong>real-world multi-tenant environments</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef89bf540906" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating KeyDB Password Rotation on Kubernetes: A Complete Guide]]></title>
            <link>https://medium.com/@harsha.kavuluri/automating-keydb-password-rotation-on-kubernetes-a-complete-guide-29cf28105478?source=rss-67311b2a1f7b------2</link>
            <guid isPermaLink="false">https://medium.com/p/29cf28105478</guid>
            <dc:creator><![CDATA[Sri Harsha Kavuluri]]></dc:creator>
            <pubDate>Sun, 30 Nov 2025 07:05:49 GMT</pubDate>
            <atom:updated>2025-11-30T07:06:42.522Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lQLW0lkxXQLBpZ2hy9PkiQ.png" /></figure><p>Password rotation is a core security practice for any production-grade system — especially for in-memory data stores like <strong>KeyDB</strong>, which often hold real-time, sensitive, or mission-critical data. Regularly refreshing authentication credentials reduces the risk of unauthorized access, prevents credential reuse, and ensures compliance with security policies.</p><p>In this guide, we walk through a <strong>fully automated, zero-downtime-ready KeyDB password rotation workflow</strong> designed for Kubernetes-based deployments. The approach uses:</p><ul><li>Kubernetes Secrets</li><li>StatefulSets</li><li>Automated pod restarts</li><li>PVC finalizer handling</li><li>Cryptographically strong password generation</li></ul><p>Everything is handled through a purpose-built shell script that eliminates manual steps and significantly reduces operational overhead.</p><p>All environment-specific details, organization names, and infrastructure identifiers have been sanitized in this article.</p><h4>Why Password Rotation Matters for KeyDB</h4><p>KeyDB often sits at the center of high-throughput platforms where it stores:</p><ul><li>Authentication tokens</li><li>Session data</li><li>Realtime state</li><li>Application metadata</li><li>Cache entries</li></ul><p>Because of its critical role, failing to rotate KeyDB credentials can lead to:</p><ul><li>Unauthorized access</li><li>Credential leakage</li><li>Compliance violations</li><li>Lateral movement risks</li></ul><p>Automated rotation ensures that security hygiene is maintained across clusters without manual effort or risk of human error.</p><h4>What This Guide Covers</h4><ul><li>Why KeyDB password rotation is important</li><li>How the rotation process works in Kubernetes</li><li>A step-by-step explanation of the automation script</li><li>How it handles PVC finalizers, backups, and rollout checks</li><li>Zero-downtime rotation strategy</li></ul><h4>Password Rotation Workflow (High-Level)</h4><p>The rotation process is designed to be:</p><ul><li>Safe</li><li>Repeatable</li><li>Audit-friendly</li><li>Automated</li><li>Compatible across on-prem &amp; cloud Kubernetes setups</li></ul><p>The full rotation sequence consists of:</p><ul><li>Input validation</li><li>Backup of the existing KeyDB password</li><li>Generation of a new strong password</li><li>Scaling down the KeyDB StatefulSet</li><li>Ensuring pods terminate cleanly (with PVC finalizer cleanup)</li><li>Updating the Kubernetes Secret</li><li>Scaling the cluster back up</li><li>Post-rotation health validation</li></ul><p>This ensures that every KeyDB node starts with the new authentication secret without risk of mismatched credentials.</p><h4>Step 1 — Input Requirements</h4><p>The script takes <strong>one input argument</strong>: the Kubernetes <strong>namespace</strong> where KeyDB is deployed.</p><p>It also pre-defines operational parameters such as:</p><ul><li>StatefulSet name</li><li>Secret name</li><li>Secret key</li><li>Backup directory path</li><li>Wait interval before secret patch</li></ul><p>These values can be customized based on your environment.</p><h4>Step 2 — Backup the Existing Password</h4><p>Before making any changes, the script extracts the existing KeyDB password from the Kubernetes Secret:</p><pre>kubectl get secret keydb-secret -n &lt;namespace&gt; \<br>  -o jsonpath=&quot;{.data.password}&quot; | base64 -d</pre><p>It backs up the password to a timestamped file:</p><pre>/var/backups/keydb-passwords/&lt;namespace&gt;_keydb-secret_&lt;timestamp&gt;.txt</pre><p>The backup file is permission-restricted (600) for safety.</p><h4>Step 3 — Generate a New Secure Password</h4><p>A cryptographically strong password is generated using OpenSSL:</p><pre>openssl rand -base64 16</pre><p>This avoids weak or predictable credentials.</p><h4>Step 4 — Scale Down StatefulSet + Verify Pod Termination</h4><p>To avoid mismatched credentials between pods:</p><pre>kubectl scale sts keydb-keydb -n &lt;namespace&gt; --replicas=0</pre><p>The script continuously checks whether all pods are terminated.</p><p>If PVCs get stuck due to finalizers (a common Kubernetes issue with StatefulSets), the script <strong>automatically removes the finalizers</strong> to unblock cleanup:</p><pre>kubectl get pvc -n &lt;namespace&gt; -o json \<br>  | tr -d &quot;\n&quot; \<br>  | sed &#39;s/&quot;finalizers&quot;: \[[^]]\+\]/&quot;finalizers&quot;: []/&#39; \<br>  | kubectl replace -f -</pre><h4>Step 5 — Patch Kubernetes Secret with the New Password</h4><p>Once the environment is ready, the script applies the new password:</p><pre>kubectl create secret generic keydb-secret \<br>  --from-literal=password=&lt;new_password&gt; \<br>  -n &lt;namespace&gt; \<br>  --dry-run=client -o yaml | kubectl apply -f -</pre><p>This replaces the old secret without deleting it, ensuring seamless rollout.</p><h4>Step 6 — Scale Up StatefulSet + Verify Cluster Health</h4><p>The StatefulSet is scaled back up to its original replica count:</p><pre>kubectl scale sts keydb-keydb -n &lt;namespace&gt; --replicas=&lt;old_count&gt;</pre><p>The script then waits for the rollout to complete:</p><pre>kubectl rollout status sts/keydb-keydb -n &lt;namespace&gt;</pre><p>Each newly launched pod reads the updated Secret and initializes KeyDB with the rotated password.</p><h4>Final Verification</h4><p>Once the rollout completes:</p><ul><li>All pods should be in <strong>Running</strong> state</li><li>Applications using KeyDB should authenticate successfully</li><li>Old backups remain stored for safe rollback</li></ul><p>The script prints the final status and timestamp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*TMhds_epW0mqSRsFonZSEw.png" /></figure><h4>Full Password Rotation Script</h4><p>Below is the sanitized script used in this guide (ready to use):</p><pre>#!/bin/bash<br>set -euo pipefail<br><br>if [[ $# -ne 1 ]]; then<br>  echo &quot;Usage: $0 &lt;namespace&gt;&quot;<br>  exit 1<br>fi<br><br>NS=$1<br>STS_NAME=&quot;keydb-keydb&quot;<br>SECRET_NAME=&quot;keydb-secret&quot;<br>SECRET_KEY=&quot;password&quot;<br>BACKUP_DIR=&quot;/var/backups/keydb-passwords&quot;<br>SLEEP_TIME=240<br><br>mkdir -p &quot;$BACKUP_DIR&quot;<br><br>check_pods_terminated() {<br>  local ns=$1<br>  local sts=$2<br>  while [[ $(kubectl get pods -n &quot;$ns&quot; -l statefulset.kubernetes.io/pod-name | grep &quot;$sts&quot; | wc -l) -gt 0 ]]; do<br>    for pvc in $(kubectl get pvc -n &quot;$ns&quot; -o name | grep &quot;$sts&quot; || true); do<br>      if kubectl get &quot;$pvc&quot; -n &quot;$ns&quot; -o json | grep -q &#39;&quot;finalizers&quot;: \[&#39;; then<br>        kubectl get &quot;$pvc&quot; -n &quot;$ns&quot; -o json \<br>          | tr -d &quot;\n&quot; \<br>          | sed &#39;s/&quot;finalizers&quot;: \[[^]]\+\]/&quot;finalizers&quot;: []/&#39; \<br>          | kubectl replace -f -<br>      fi<br>    done<br>    sleep 5<br>  done<br>}<br><br>check_pods_ready() {<br>  kubectl rollout status sts/&quot;$2&quot; -n &quot;$1&quot; --timeout=300s<br>}<br><br>if kubectl get secret &quot;$SECRET_NAME&quot; -n &quot;$NS&quot; &gt;/dev/null 2&gt;&amp;1; then<br>  OLD_PASS=$(kubectl get secret &quot;$SECRET_NAME&quot; -n &quot;$NS&quot; -o jsonpath=&quot;{.data.$SECRET_KEY}&quot; | base64 -d)<br>  DATE=$(date +&quot;%Y%m%d-%H%M%S&quot;)<br>  BACKUP_FILE=&quot;$BACKUP_DIR/${NS}_${SECRET_NAME}_$DATE.txt&quot;<br>  echo &quot;$OLD_PASS&quot; &gt; &quot;$BACKUP_FILE&quot;<br>  chmod 600 &quot;$BACKUP_FILE&quot;<br>fi<br><br>NEW_PASS=$(openssl rand -base64 16)<br><br>REPLICAS=$(kubectl get sts &quot;$STS_NAME&quot; -n &quot;$NS&quot; -o jsonpath=&#39;{.spec.replicas}&#39;)<br>kubectl scale sts &quot;$STS_NAME&quot; -n &quot;$NS&quot; --replicas=0<br><br>check_pods_terminated &quot;$NS&quot; &quot;$STS_NAME&quot;<br><br>sleep &quot;$SLEEP_TIME&quot;<br><br>kubectl create secret generic &quot;$SECRET_NAME&quot; \<br>  --from-literal=$SECRET_KEY=&quot;$NEW_PASS&quot; \<br>  -n &quot;$NS&quot; \<br>  --dry-run=client -o yaml | kubectl apply -f -<br><br>kubectl scale sts &quot;$STS_NAME&quot; -n &quot;$NS&quot; --replicas=&quot;$REPLICAS&quot;<br><br>check_pods_ready &quot;$NS&quot; &quot;$STS_NAME&quot;</pre><h4>Conclusion</h4><p>Automating password rotation is one of the most effective measures to strengthen the security of KeyDB clusters. The workflow described in this guide ensures:</p><ul><li>Zero stale credentials</li><li>Fully automated rollout</li><li>Safe, timestamped backups</li><li>Robust PVC and pod termination handling</li><li>Predictable and repeatable rotation cycles</li></ul><p>By integrating this script into a CI/CD pipeline or CronJob, teams can enforce organization-wide security standards without manual effort — making KeyDB more secure, reliable, and compliant.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29cf28105478" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[KeyDB Upgrade Guide: Safely Migrating from 6.3.1 to 6.3.4 on Kubernetes]]></title>
            <link>https://medium.com/@harsha.kavuluri/keydb-upgrade-guide-safely-migrating-from-6-3-1-to-6-3-4-on-kubernetes-7dad12d1882d?source=rss-67311b2a1f7b------2</link>
            <guid isPermaLink="false">https://medium.com/p/7dad12d1882d</guid>
            <dc:creator><![CDATA[Sri Harsha Kavuluri]]></dc:creator>
            <pubDate>Sat, 29 Nov 2025 06:57:53 GMT</pubDate>
            <atom:updated>2025-11-29T06:57:53.950Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p3Wp5DmV5pbz_J5OyH4I1A.png" /></figure><p>KeyDB is a high-performance, multi-threaded fork of Redis designed for modern, high-volume, low-latency workloads. With features like multi-master replication, TLS support, and strong performance optimizations, KeyDB has become a preferred in-memory data store in many Kubernetes environments.</p><p>This guide walks you through a <strong>safe, structured, and production-grade approach to upgrading KeyDB from version 6.3.1 to 6.3.4</strong>, including backup, restore, validation, and optional features like metrics and TLS.</p><p>All screenshots and commands shared here are <strong>fully sanitized</strong> to avoid exposing any internal system details.</p><h4>Why Upgrade KeyDB?</h4><p>Upgrading KeyDB ensures:</p><ul><li>Security patches and CVE fixes</li><li>Better performance &amp; stability</li><li>Improved metrics support</li><li>TLS enhancements</li><li>Compatibility with newer Kubernetes versions</li></ul><h4>Upgrade Overview</h4><p>This guide covers:</p><ul><li>Checking existing KeyDB version</li><li>Taking a safe RDB backup</li><li>Scaling down the old StatefulSet</li><li>Deploying KeyDB 6.3.4</li><li>Validating pod health &amp; version</li><li>Restoring backup</li><li>(Optional) Enabling Metrics</li><li>(Optional) Enabling TLS</li></ul><h4>Step 1: Check the existing version of KeyDB</h4><p>Exec into KeyDB pod and execute the below command</p><p>First, exec into the existing KeyDB pod and verify the running version:</p><pre>kubectl exec -it &lt;keydb-pod-name&gt; -n &lt;namespace&gt; -- bash<br>keydb-server --version</pre><p>You should see something like:</p><pre>KeyDB Server v=6.3.1</pre><h4>Step 2 — Backup KeyDB 6.3.1 Before Upgrade</h4><ol><li>Generate RDB Snapshot</li></ol><p>Inside the KeyDB pod:</p><pre>kubectl exec -it &lt;keydb-pod-name&gt; -n &lt;namespace&gt; -- bash<br>keydb-cli -a &lt;password&gt; SAVE</pre><p>or use background save:</p><pre>keydb-cli -a &lt;password&gt; BGSAVE</pre><p>2. Copy the RDB Backup to Your Local Machine</p><pre>kubectl cp &lt;namespace&gt;/&lt;keydb-pod-name&gt;:/data/dump.rdb ./dump.rdb</pre><p>This file will be restored into the newer version later.</p><h4>Step 3 — Scale Down Existing KeyDB Pods</h4><p>Scale down the StatefulSet:</p><pre>kubectl scale sts keydb -n &lt;namespace&gt; --replicas=0</pre><p>Do NOT delete the PVCs — these hold your persistent data.</p><h4>Step 4 — Install KeyDB 6.3.4</h4><p>If using Helm:</p><pre>helm upgrade --install keydb-upgrade ./ -f values.yaml -n &lt;namespace&gt;</pre><p>This deploys the new version while keeping your storage intact.</p><h4>Step 5 — Verify Pod Status &amp; Version</h4><p>Check if the pods are running:</p><pre>kubectl get pods -n &lt;namespace&gt;</pre><p>Exec into the new pod:</p><pre>kubectl exec -it &lt;new-pod-name&gt; -n &lt;namespace&gt; -- bash<br>keydb-server --version</pre><p>Expected output:</p><pre>KeyDB Server v=6.3.4</pre><h4>Step 6 — Restore the Backup into KeyDB 6.3.4</h4><p>Copy the RDB file into the new pod:</p><pre>kubectl cp ./dump.rdb &lt;namespace&gt;/&lt;new-pod-name&gt;:/data/dump.rdb</pre><p>Once copied, restart the KeyDB pod if it does not automatically reload RDB:</p><pre>kubectl delete pod &lt;new-pod-name&gt; -n &lt;namespace&gt;</pre><p>Kubernetes will recreate the pod, loading the new dump.</p><h4>Step 7 — Enabling KeyDB Metrics (Optional)</h4><p>If you run Redis/KeyDB Exporter as a sidecar container, you can check metrics via:</p><pre>kubectl exec -it &lt;pod-name&gt; -n &lt;namespace&gt; -c metrics bash<br>curl http://localhost:9121/metrics</pre><p>Metrics exposed include:</p><ul><li>Memory usage</li><li>Commands processed</li><li>Clients connected</li><li>Latency stats</li></ul><p>These can be scraped by Prometheus and visualized in Grafana.</p><h4>Step 8 — Enabling TLS (Optional)</h4><p>To enable TLS, set the following in values.yaml:</p><pre>tls:<br>  enabled: true</pre><p>Ensure certificates are included under /certs.</p><p>After applying your updated Helm chart:</p><pre>helm upgrade keydb-upgrade ./ -f values.yaml -n &lt;namespace&gt;</pre><p>Validate using:</p><pre>openssl s_client -connect localhost:6379 -CAfile /certs/ca.crt</pre><h4>Final Checklist</h4><p>Before marking the upgrade as complete, ensure:</p><ul><li>KeyDB version updated to 6.3.4</li><li>RDB backup restored</li><li>Write/read tests successful</li><li>Metrics functional (optional)</li><li>TLS enabled and validated (optional)</li><li>No pod restarts or crash loops</li><li>PVCs healthy</li></ul><h4>Conclusion</h4><p>Upgrading KeyDB on Kubernetes requires careful planning, proper backups, and thorough validation. By following a safe upgrade workflow — backup → scale down → upgrade → restore — you ensure zero data loss and a smooth transition to the latest version.</p><p>Whether you’re upgrading for performance, compliance, or compatibility, these steps help maintain a reliable and production-grade in-memory data platform.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7dad12d1882d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing RBAC in Kubernetes: A Practical, Step-by-Step Guide]]></title>
            <link>https://medium.com/@harsha.kavuluri/implementing-rbac-in-kubernetes-a-practical-step-by-step-guide-e5b19b7cd7ea?source=rss-67311b2a1f7b------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5b19b7cd7ea</guid>
            <dc:creator><![CDATA[Sri Harsha Kavuluri]]></dc:creator>
            <pubDate>Sat, 29 Nov 2025 05:19:32 GMT</pubDate>
            <atom:updated>2025-11-29T05:36:33.558Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ye4cHPxtCE1T-8eCAMsEoA.png" /></figure><p>Role-Based Access Control (RBAC) is one of the most critical security building blocks in Kubernetes. Whether you’re managing clusters in production or designing secure multi-tenant environments, RBAC ensures that users and applications access only what they are authorized to — nothing more.</p><p>This guide walks through a clean, real-world RBAC implementation in Kubernetes using ServiceAccounts, Roles, RoleBindings, ClusterRoles, and ClusterRoleBindings. Sensitive organizational details have been redacted to keep this article generic and publicly shareable.</p><h4>Why RBAC Matters in Kubernetes</h4><p>Kubernetes is highly flexible, but that flexibility can become a security risk if not managed properly. RBAC helps you implement the <strong>principle of least privilege</strong>, allowing:</p><ul><li>Fine-grained access control</li><li>Defined permissions per user/service</li><li>Auditable and secure operations</li><li>Controlled multi-tenant environments</li></ul><p>By mapping permissions to roles instead of individuals, RBAC ensures scalable and predictable access management.</p><h4>Overview of What We’ll Cover</h4><p>This guide walks through:</p><ul><li>Creating Kubernetes Service Accounts</li><li>Defining Roles and ClusterRoles</li><li>Binding Users to Allowed Permissions</li><li>Generating Access Tokens</li><li>Updating kubeconfig</li><li>Testing Access Restrictions</li><li>Highlighting RBAC limitations and security pitfalls</li></ul><p>All code is generic and safe to use.</p><h4>RBAC Example: Creating a Restricted “Test User”</h4><p>Below is a minimal RBAC setup for a user who only needs read-only access.</p><p>Step 1: Create a ServiceAccount</p><pre>apiVersion: v1<br>kind: ServiceAccount<br>metadata:<br>  name: keydb-user<br>  namespace: kube-system</pre><p>Apply it:</p><pre>kubectl apply -f serviceaccount.yaml</pre><p>Step 2: Create Role &amp; RoleBinding</p><p>A Role defines permissions <strong>within a specific namespace</strong>.</p><pre>apiVersion: rbac.authorization.k8s.io/v1<br>kind: Role<br>metadata:<br>  name: readonly<br>  namespace: kube-system<br>rules:<br>- apiGroups: [&quot;*&quot;]<br>  resources: [&quot;*&quot;]<br>  verbs:<br>    - get<br>    - list<br>    - watch</pre><p>Bind the role to the ServiceAccount:</p><pre>apiVersion: rbac.authorization.k8s.io/v1<br>kind: RoleBinding<br>metadata:<br>  name: readonly-binding<br>  namespace: kube-system<br>subjects:<br>- kind: ServiceAccount<br>  name: keydb-user<br>  namespace: kube-system<br>roleRef:<br>  kind: Role<br>  name: readonly<br>  apiGroup: rbac.authorization.k8s.io</pre><p>Step 3: (Optional) Create ClusterRole &amp; ClusterRoleBinding</p><p>Use this when the user needs read access <strong>across namespaces</strong>.</p><pre>apiVersion: rbac.authorization.k8s.io/v1<br>kind: ClusterRole<br>metadata:<br>  name: view-clusterrolebindings<br>rules:<br>- apiGroups: [&quot;rbac.authorization.k8s.io&quot;]<br>  resources: [&quot;clusterrolebindings&quot;]<br>  verbs: [&quot;get&quot;, &quot;list&quot;, &quot;watch&quot;]<br><br>---<br>apiVersion: rbac.authorization.k8s.io/v1<br>kind: ClusterRoleBinding<br>metadata:<br>  name: test-user-view-binding<br>subjects:<br>- kind: ServiceAccount<br>  name: keydb-user<br>  namespace: kube-system<br>roleRef:<br>  kind: ClusterRole<br>  name: view-clusterrolebindings<br>  apiGroup: rbac.authorization.k8s.io</pre><p>Step 4: Generate a Token</p><pre>kubectl create token -n kube-system testuser --duration=8760h | base64 -w 0</pre><p>Decode:</p><pre>echo &lt;token&gt; | base64 -d</pre><p>Step 5: Update kubeconfig</p><p>Add a new entry:</p><pre>users:<br>- name: testuser<br>  user:<br>    token: &lt;decoded-token&gt;<br><br>contexts:<br>- name: testuser-context<br>  context:<br>    cluster: &lt;your-cluster&gt;<br>    user: test-user</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*-aYleu12IVa8CVeGxaWIAg.png" /></figure><p>Step 6: Test the role restrictions for testuser</p><p>Try commands the user should be allowed or blocked from:</p><pre>kubectl get pods -n kube-system<br>kubectl delete pod xyz     # should fail</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*nCV7JsE5F8nmRDZBUCErxA.png" /></figure><h4>Limitations of RBAC (Important!)</h4><p>Even though RBAC is powerful, it <strong>cannot</strong> solve everything.</p><ol><li>RBAC does not control actions <em>inside</em> the database</li></ol><p>If a user enters a Pod, they can still:</p><ul><li>Run SQL commands inside MariaDB</li><li>Run Redis/KeyDB commands</li></ul><p>2. RBAC cannot protect Secrets if a user has “get/list” access</p><p>Users with access to Secrets can still read passwords.</p><p>Recommended:</p><ul><li>Enable <strong>Secrets Encryption at Rest</strong></li><li>Use an external secret manager (Vault, AWS KMS, etc.)</li></ul><h4>Final Thoughts</h4><p>RBAC is the backbone of secure Kubernetes operations. When implemented correctly, it ensures cluster safety, operational discipline, and compliance. The key is combining RBAC with:</p><ul><li>Strong database-level access control</li><li>Strict secret-management practices</li><li>Limited Pod shell access</li><li>Continuous auditing</li></ul><p>This approach gives you a robust and production-grade security model suitable for any enterprise Kubernetes environment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5b19b7cd7ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>