<?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 Shashankp on Medium]]></title>
        <description><![CDATA[Stories by Shashankp on Medium]]></description>
        <link>https://medium.com/@shashankp9353?source=rss-945bb38774d3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0mOMZJYAatAXtaCg9Xi_Gw.jpeg</url>
            <title>Stories by Shashankp on Medium</title>
            <link>https://medium.com/@shashankp9353?source=rss-945bb38774d3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 21:32:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shashankp9353/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[How ArgoCD Simplifies Kubernetes Deployments Using GitOps]]></title>
            <link>https://medium.com/@shashankp9353/argocd-made-simple-7e4740d8c46e?source=rss-945bb38774d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e4740d8c46e</guid>
            <dc:creator><![CDATA[Shashankp]]></dc:creator>
            <pubDate>Mon, 29 Dec 2025 11:32:05 GMT</pubDate>
            <atom:updated>2025-12-29T17:49:47.642Z</atom:updated>
            <content:encoded><![CDATA[<p>A beginner-friendly introduction to ArgoCD, with a simple hands-on guide to deploy applications on Kubernetes using Git as the single source of truth.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zpPE2ZJyaaDuQQCP5qv5BA.png" /></figure><h4><strong>Introduction</strong></h4><p>Managing Kubernetes applications manually can quickly become complex and error-prone. Keeping track of YAML files, ensuring the cluster state matches what was intended, and handling deployments consistently across environments is challenging.<br>This is where <strong>ArgoCD</strong> comes in.<br><strong>ArgoCD</strong> is a <strong>declarative, GitOps-based continuous delivery tool for Kubernetes</strong>. It helps you deploy, monitor, and manage applications in Kubernetes using Git as the <strong>single source of truth.</strong></p><p><strong>What is GitOps?<br></strong>Before understanding ArgoCD, let’s quickly understand <strong>GitOps</strong>.</p><p>👉 <strong>GitOps</strong> is a practice where:</p><ul><li>All Kubernetes manifests (YAML files, Helm charts, Kustomize, etc.) are stored in <strong>Git</strong></li><li>Git becomes the <strong>source of truth</strong></li><li>Any change in Git is automatically reflected in the Kubernetes cluster</li></ul><p>So instead of running:</p><pre>kubectl apply -f deployment.yaml</pre><p>You just:</p><ol><li>Update the YAML in Git</li><li>ArgoCD detects the change</li><li>ArgoCD syncs the cluster automatically</li></ol><p><strong>What is ArgoCD?<br>ArgoCD</strong> is a Kubernetes-native CD (Continuous Delivery) tool that:</p><ul><li>Watches a Git repository</li><li>Compares Git state with the cluster state</li><li>Automatically syncs the cluster to match Git</li></ul><p>In simple words:<br><strong><em>“What is in Git should be running in Kubernetes.”</em></strong></p><p><strong>Why Do We Need ArgoCD?</strong></p><p>Without ArgoCD:</p><ul><li>Manual deployments</li><li>Configuration drift (Git says one thing, cluster runs something else)</li><li>Hard to audit changes</li><li>Rollbacks are manual and risky</li></ul><p>With ArgoCD:</p><ul><li>✅ Automated deployments</li><li>✅ Drift detection</li><li>✅ Easy rollbacks (via Git)</li><li>✅ Clear visibility via UI</li><li>✅ Works well with DevOps &amp; platform teams</li></ul><p><strong>Key Features of ArgoCD</strong></p><ul><li>Declarative GitOps</li><li>Web UI &amp; CLI</li><li>Auto-sync &amp; manual sync</li><li>Drift detection</li><li>Role-based access (RBAC)</li><li>Supports Helm, Kustomize, plain YAML</li><li>Easy rollback using Git history</li></ul><p><strong>High-Level Architecture</strong></p><pre>Git Repository<br>     |<br>     | (manifests)<br>     v<br>ArgoCD<br>     |<br>     | (sync)<br>     v<br>Kubernetes Cluster</pre><p>ArgoCD continuously compares:</p><ul><li><strong>Desired state</strong> → Git</li><li><strong>Live state</strong> → Kubernetes</li></ul><p>If they differ → ArgoCD shows it as <strong>OutOfSync</strong></p><h3>Hands-On Walkthrough: Deploying a Kubernetes App with ArgoCD</h3><h4><strong>Prerequisites</strong></h4><ul><li>Kubernetes cluster (Minikube / Kind / Cloud)</li><li>kubectl installed</li><li>A Git repository containing Kubernetes manifests</li></ul><h4><strong>Step 1: Install ArgoCD</strong></h4><pre>kubectl create namespace argocd<br><br>kubectl apply -n argocd \<br>-f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml</pre><p>This command creates the argocd namespace and installs all ArgoCD components into the Kubernetes cluster using the official ArgoCD manifests.</p><h4><strong>Step 2: Access ArgoCD UI</strong></h4><p>Port-forward the ArgoCD server:</p><pre>kubectl port-forward svc/argocd-server -n argocd 8080:443</pre><p>Get password:</p><pre>kubectl get secret argocd-initial-admin-secret -n argocd \<br>-o jsonpath=&quot;{.data.password}&quot; | base64 -d</pre><p>Use the above command to fetch the initial ArgoCD admin password. Once retrieved, open <a href="https://localhost:8080/">https://localhost:8080</a> in your browser and log in using the username <strong>admin</strong> and the decoded password.</p><h4>Step 3: Create a Sample Git Repo</h4><p>Create a simple Git repository with the following structure:</p><pre>my-nginx-app/<br> ├── deployment.yaml<br> └── service.yaml</pre><p><strong>deployment.yaml</strong></p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: nginx<br>spec:<br>  replicas: 1<br>  selector:<br>    matchLabels:<br>      app: nginx<br>  template:<br>    metadata:<br>      labels:<br>        app: nginx<br>    spec:<br>      containers:<br>        - name: nginx<br>          image: nginx:latest<br>          ports:<br>            - containerPort: 80</pre><p><strong>service.yaml</strong></p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: nginx-service<br>spec:<br>  selector:<br>    app: nginx<br>  ports:<br>    - port: 80<br>  type: ClusterIP</pre><h4>Step 4: Create an ArgoCD Application Manifest</h4><p>Now create a file called <strong>nginx-application.yaml</strong>:</p><pre>apiVersion: argoproj.io/v1alpha1<br>kind: Application<br>metadata:<br>  name: nginx-app<br>  namespace: argocd<br>spec:<br>  project: default<br><br>  source:<br>    repoURL: https://github.com/&lt;your-username&gt;/&lt;your-repo&gt;.git<br>    targetRevision: HEAD<br>    path: my-nginx-app<br><br>  destination:<br>    server: https://kubernetes.default.svc<br>    namespace: default<br><br>  syncPolicy:<br>    automated:<br>      prune: true<br>      selfHeal: true</pre><p>🔹 <strong>Important:</strong></p><ul><li><strong>repoURL</strong>: Replace this with the URL of your Git repository that contains the Kubernetes manifests.</li><li><strong>targetRevision</strong>: Specifies the Git branch, tag, or commit ArgoCD should track (for example, HEAD, main, or a specific tag or commit hash)</li><li>automated sync ensures ArgoCD automatically applies changes from Git</li></ul><h4>Step 5: Apply the Application Manifest</h4><p>Apply the ArgoCD Application YAML:</p><pre>kubectl apply -f nginx-application.yaml</pre><p>This tells ArgoCD to:</p><ul><li>Watch the Git repository</li><li>Monitor the specified path</li><li>Automatically sync Kubernetes resources</li></ul><h4>Step 6: Verify the Deployment</h4><p>Check the application in ArgoCD:</p><pre>kubectl get applications -n argocd</pre><p>Check Kubernetes resources:</p><pre>kubectl get pods<br>kubectl get svc</pre><p>You can also view the application status in the ArgoCD UI, where it should show <strong>Synced</strong> and <strong>Healthy</strong>.</p><p><strong>GitOps in Action 🚀</strong></p><p>Now try updating Git:</p><ul><li>Change replicas: 1 to replicas: 2</li><li>Commit and push the change</li></ul><p>ArgoCD will automatically:</p><ul><li>Detect the change</li><li>Sync the cluster</li><li>Update the running application</li></ul><p>No manual kubectl apply needed.</p><h4>Conclusion</h4><p>By creating applications using <strong>ArgoCD manifest files</strong>, we fully embrace GitOps principles:</p><ul><li>Everything is declarative</li><li>Git is the single source of truth</li><li>Application creation itself is version-controlled</li></ul><p>This method is <strong>preferred in production environments</strong> and scales well for large teams.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e4740d8c46e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting Up Grafana Alerts with Custom Templates (via Email ) ]]></title>
            <link>https://medium.com/@shashankp9353/setting-up-grafana-alerts-with-custom-templates-via-email-86622994f17c?source=rss-945bb38774d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/86622994f17c</guid>
            <dc:creator><![CDATA[Shashankp]]></dc:creator>
            <pubDate>Mon, 01 Sep 2025 16:44:08 GMT</pubDate>
            <atom:updated>2025-09-01T16:44:08.234Z</atom:updated>
            <content:encoded><![CDATA[<p>Monitoring is only useful if it tells you <strong>when something goes wrong — and fast</strong>. That’s where <strong>alerting</strong> comes in. Grafana’s alerting system lets you define rules that watch your data and send notifications when thresholds are breached. But just getting an alert isn’t enough — it needs to be <strong>clear, actionable, and timely.</strong></p><p>This is why Grafana’s notification templates are so important. A well-crafted alert with a clear message (e.g., what’s wrong, where it’s happening, and what to check) helps teams respond faster and avoid downtime. Whether it’s a sudden spike in latency or a service going offline, receiving a clear, well-formatted notification in real time makes all the difference — especially in production environments.</p><h3>✅ What You Need Before Setting Up Grafana Alerts</h3><p><strong>Before setting up any alerting channel in Grafana, it’s important to check a few prerequisites.</strong><br><strong>1. Grafana Installed &amp; Running: </strong>You should already have a Grafana instance running (via Docker, Helm/Kubernetes).<br><strong>2. Unified Alerting Enabled: </strong>Grafana v8+ comes with Unified Alerting by default. Make sure you can see Alerting → Alert rules in the sidebar.<br><strong>3. Data Source Configured:</strong> Connect at least one data source (Prometheus, Loki, InfluxDB, etc.). Alerts are triggered based on queries from these sources.<br><strong>4. Basic Alert Rule Created: </strong>Have at least one test alert rule (e.g., “CPU usage &gt; 80%”). This ensures you have something to trigger notifications.</p><p>📌 <strong>Note:</strong> You can also check out this open-source repository <a href="https://github.com/Sanketika-Obsrv/obsrv-automation/tree/main/helmcharts/services/system-rules-ingestor">obsrv-automation</a> which helps you configure and deploy Grafana alerts.</p><h3><strong>🔔 Notification Options in Grafana</strong></h3><p>Grafana supports multiple notification channels so that teams can receive alerts where they work best. Some popular integrations include:</p><p><strong>1. 📩 Email (SMTP)</strong> — Direct alerts to your inbox (simple and universal).<br><strong>2. 💬 Slack</strong> — Post alerts into Slack channels for instant collaboration.<br><strong>3. 💻 Microsoft Teams</strong> — Notify users in Teams channels.<br><strong>4. 📲 PagerDuty / OpsGenie</strong> — For on-call and escalation management.<br><strong>5. 🌐 Webhook </strong>— Send custom payloads to your own apps or automation workflows.<br>👉 All of these can be configured under Alerting → Contact points.</p><p>In this blog, we’ll walk through how to set up <strong>email alerts in Grafana</strong>, and how they can play a critical role in your <strong>incident response</strong> workflow.</p><h3><strong>🛠️ Step1: Configuring SMTP for Email Alerts in Grafana (deploying grafana via Helm Chart)</strong></h3><p>To start receiving alerts via email, you first need to configure <strong>SMTP (Simple Mail Transfer Protocol)</strong> in Grafana. This allows Grafana to send emails using your mail server (like Gmail).</p><p>If you’re using the <strong>Grafana Helm chart</strong>, Create a file named `grafana.ini` with your email settings:</p><pre>[smtp]<br>enabled = true #Turn on email functionality<br>host = smtp.gmail.com:587 #Gmail&#39;s email server address<br>user = your-email@gmail.com #Your Gmail address<br>password = your-app-password #Your Gmail app password (not regular password)<br>skip_verify = false <br>from_address = your-email@gmail.com #Email address that appears as sender<br>from_name = Your Name #Name that appears as sender</pre><p>Then create a ConfigMap named ‘grafana-config’ containing your grafana.ini file</p><pre><br>apiVersion: v1<br>kind: ConfigMap<br>metadata:<br>  name: grafana-config<br>  namespace: {{ include &quot;common.names.namespace&quot; . | quote }}<br>  labels: {{- include &quot;common.labels.standard&quot; ( dict &quot;customLabels&quot; .Values.commonLabels &quot;context&quot; $ ) | nindent 4 }}<br>    app.kubernetes.io/component: grafana<br>  {{- if .Values.commonAnnotations }}<br>  annotations: {{- include &quot;common.tplvalues.render&quot; ( dict &quot;value&quot; .Values.commonAnnotations &quot;context&quot; $ ) | nindent 4 }}<br>  {{- end }}<br>data:<br>  grafana.ini: |<br>    [smtp]<br>    enabled = true<br>    host = smtp.gmail.com:587<br>    user = {{ .Values.smtp.user }}<br>    password = {{ .Values.smtp.password }}<br>    skip_verify = {{ .Values.smtp.skipVerify }}<br>    from_address = {{ .Values.smtp.fromAddress }}<br>    from_name = {{ .Values.smtp.fromName }}</pre><p>Modify the<strong> values.yaml</strong> file. Find the config section (around line 200–210):</p><pre># Enable custom grafana.ini file<br>config:<br>  useGrafanaIniFile: true<br>  grafanaIniConfigMap: &quot;grafana-config&quot;  # This MUST match your ConfigMap name<br>  grafanaIniSecret: &quot;&quot;</pre><p>🔗 <strong>Reference:</strong> A Helm chart with pre-configured Grafana notification settings is available in this repository <a href="https://github.com/Shashankpgit/grafana-helm-chart"><strong>grafana-helm-chart</strong></a></p><p>🔐 <strong>Note:</strong> The password here is an App Password generated from your Gmail account (if you use 2FA). Never use your regular Gmail password.</p><p>Once this is configured and the Helm chart is deployed with the updated values, <strong>Grafana will be able to send alerts via email</strong> to any recipient you define in the notification channel<strong>.</strong></p><h3>📬 Step2: Create the Notification Template</h3><p>Once email delivery is enabled, the next step is ensuring that alert messages are clear, informative, and actionable. Grafana allows you to customize alert emails using <strong>notification templates</strong>, which define the <strong>format, content, and structure</strong> of the message — including the subject, body, and layout. These templates use the <strong>Go templating language</strong>, enabling dynamic insertion of alert details such as status, labels, and descriptions. This makes alerts more meaningful, consistent across teams, and easier to understand and act upon.</p><p>For example, a well-formatted email template can include:</p><p>🔹 Alert name and status (e.g., “🔥 High CPU Usage on prod-server-1”)<br>🔹 Dashboard or panel link<br>🔹 Labels (e.g., environment, job name)<br>🔹 Summary of what triggered the alert<br>🔹 Custom messages for team guidance</p><ol><li><strong>Navigate to the Contact Points</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*peP9L1Yp4Y74RYqj6hUYLQ.avif" /></figure><ul><li>From the main menu, locate the left-hand navigation menu.</li><li>Click on the Contact Points option under Alerting dropdown.</li></ul><p>2. <strong>Add New Notification Template</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2l3c2pSUCmbI-YqE15IYgw.avif" /></figure><ul><li>Click on Notification Templates Beside the Contact Points.</li><li>Click Add Notification Template to create the new notification template.</li></ul><p>3. <strong>Define and Test the Template Output</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3qIx41NBgrX3Crpct9fjBw.avif" /></figure><ul><li><strong>Enter a Name</strong>: Provide a meaningful name for your notification template.</li><li><strong>Edit Payload</strong>: Click on Edit Payload to start customizing the template.</li><li><strong>(Optional) Use Existing Alert Data</strong>:<br> →<strong>Select an Existing Alert Instance</strong>: From the dropdown, choose Use an existing alert instance.<br> →<strong>Pick Firing Instances</strong>: Select one or more firing instances associated with the chosen alert rule.<br> →<strong>Add Alert Data to Payload</strong>: Click on Add the alert data to payload to include the relevant alert information into your template.</li><li><strong>Format the Template</strong>: In the Template field, use only the necessary fields from the payload to define how your notification message should be structured and displayed.</li><li><strong>Preview the Template</strong>: Click on Preview (located at the top-right corner) to view how the notification message will appear.</li><li><strong>Review and Save:</strong> Review the output carefully, make any necessary adjustments, and save the template.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JDmIrmLefUoMeWSj8sBN8w.png" /></figure><p>The image above shows how to create a <strong>custom notification template</strong> in Grafana using the built-in <strong>Go templating language.</strong></p><p>The <strong>template code block</strong> ({{ define &quot;default.message&quot; }} ...) formats how the alert email will appear when it&#39;s triggered.</p><ul><li>On the <strong>right side</strong>, the <strong>preview panel</strong> shows how the final alert will be rendered — based on the sample payload at the bottom.</li><li>The <strong>payload</strong> (bottom section) simulates real alert data, including:</li><li>status: firing</li><li>alertname: InstanceDown</li><li>summary: Instance instance1 has been down for more than 5 minutes</li><li>startsAt: when the alert started</li><li>generatorURL: link back to the Grafana panel</li></ul><p>This gives you a <strong>real-time preview</strong> of what the email will look like when an alert is fired — making it easier to <strong>design, test, and adjust</strong> your template before using it in a notification channel. <br>Save the template by giving the related name. Grafana will now recognize this and allow it to be selected in your contact point settings.</p><h3>📬Step 3: Create the Notification Channel (Contact Point)</h3><p>Once you’ve created a custom message template, it’s time to configure an <strong>email contact point</strong> in Grafana that will <strong>use that template</strong> when an alert fires.</p><ol><li>Go to <strong>Alerting → Contact points</strong> from the left-hand menu.</li><li>Click on <strong>“New contact point”</strong> (or edit an existing one).</li><li>Give your contact point a <strong>name</strong> (e.g., Email Notification Channel).</li><li>Under the <strong>Integration</strong> dropdown, select <strong>Email</strong>.</li><li>In the <strong>Addresses</strong> field, add the email address where you want to receive alerts (e.g., receiver@gmail.com).</li><li>📌 <strong>Important</strong>: Scroll down to the <strong>Message</strong> section and click <strong>“Edit Message”</strong>.<br> →In the message editor, choose your custom message template (e.g., default.message or any other one you&#39;ve created).<br> →Save the message template settings.</li><li>(Optional) You can also customize the <strong>subject</strong> using the Edit Subject option.</li><li>Click <strong>“Save contact point”</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DqDRn3ByYhhvYuM07avsJw.png" /><figcaption>Email contact point setup</figcaption></figure><h3>🚨 Step 4: Connecting the Notification Channel to Your Alert Rules</h3><h4>➤ How to do this:</h4><ol><li>Go to <strong>Alerting → Alert rules</strong>.</li><li>Either create a <strong>new alert rule</strong> or edit an existing one.</li><li>In the <strong>“Notifications”</strong> section of the alert rule.</li><li>Click <strong>“Add contact point”</strong>.</li><li>Choose your <strong>email notification channel</strong> from the dropdown.</li><li>Save the alert rule.</li></ol><p>That’s it! Now, whenever the alert condition is met — like CPU usage spiking or a service going down — Grafana will evaluate the rule and send a well-formatted email using the template you defined.</p><h3>Notification Template Examples — Code Snippets and Email Previews</h3><p>Example Snippet for the email Body.</p><pre>{{ define &quot;Simple-Notification-Template&quot; -}}<br>{{ range .Alerts -}}<br>📛 Alert Code: {{ index .Labels &quot;alert_code&quot; }}<br>🏷️ Alert Name: {{ index .Labels &quot;alertname&quot; }}<br>⚠️ Severity: {{ index .Labels &quot;severity&quot; }}<br>📝 Summary: {{ index .Annotations &quot;description&quot; }}<br>🖥️ Alert Source: {{ index .Labels &quot;alertSource&quot; }}<br>📊 Dataset: {{ index .Labels &quot;dataset&quot; }}<br>🔗 For more assistance reach out to administrative support or refer  https://docs.obsrv,ai/how-tos/alerts-and-notifications/alerts-and-recomeneded-actions<br>{{ end -}}<br>{{ end }}</pre><p>Below is an example of how the email notification looks when triggered:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C_GGTCNxKwz5DbMUWZoX9A.png" /></figure><p>For more such examples refer <a href="https://docs.obsrv.ai/how-tos/alerts-and-notifications/notifications/sample-notification-templates">obsrv-docs</a></p><h4>🧩 Wrapping It Up</h4><p>Configuring a notification channel with a proper template isn’t just about sending alerts — it’s about sending <strong>meaningful</strong>, <strong>readable</strong>, and <strong>actionable</strong> alerts.<br>A well-structured alert:<br> →Reduces confusion during critical incidents.<br> →Helps teams respond faster.<br> →Creates a cleaner alerting workflow across systems and teams.</p><p>With Grafana’s flexibility — especially using templated messages and contact points — your alerts can be as powerful as your dashboards.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86622994f17c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>