<?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 Zartash Aslam on Medium]]></title>
        <description><![CDATA[Stories by Zartash Aslam on Medium]]></description>
        <link>https://medium.com/@zartashrao96?source=rss-6c54e469df51------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ZNfiFn8JAUqWRDbrgVjJSQ.jpeg</url>
            <title>Stories by Zartash Aslam on Medium</title>
            <link>https://medium.com/@zartashrao96?source=rss-6c54e469df51------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 09:53:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zartashrao96/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[ Fixing 401 Unauthorized in elasticsearch_exporter: Why My Credentials Weren’t Working (and What…]]></title>
            <link>https://medium.com/@zartashrao96/fixing-401-unauthorized-in-elasticsearch-exporter-why-my-credentials-werent-working-and-what-b7775af2e4eb?source=rss-6c54e469df51------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7775af2e4eb</guid>
            <category><![CDATA[elasticsearch-monitoring]]></category>
            <category><![CDATA[devops-tips]]></category>
            <category><![CDATA[prometheus-exporter]]></category>
            <category><![CDATA[configuration-kubernetes]]></category>
            <dc:creator><![CDATA[Zartash Aslam]]></dc:creator>
            <pubDate>Tue, 15 Jul 2025 14:08:35 GMT</pubDate>
            <atom:updated>2025-07-15T14:11:26.556Z</atom:updated>
            <content:encoded><![CDATA[<h3>🔐 Fixing 401 Unauthorized in elasticsearch_exporter: Why My Credentials Weren’t Working (and What Fixed It)</h3><p>I recently ran into an odd issue while setting up the <a href="https://github.com/prometheus-community/elasticsearch_exporter">prometheus-community/elasticsearch_exporter</a> for a Kubernetes cluster.</p><p>The setup was seemingly correct:</p><ul><li>Credentials were injected using ES_USERNAME and ES_PASSWORD via environment variables</li><li>I could curl Elasticsearch directly using those credentials</li><li>Everything looked fine inside the pod (printenv confirmed the variables were there)</li></ul><p>Yet, the exporter stubbornly responded with:</p><blockquote><strong><em>401 Unauthorized</em></strong></blockquote><p>It had worked before. Nothing major had changed. So what went wrong?</p><h3>🔎 The Problem: Unauthenticated Responses from Elasticsearch</h3><p>Here’s the context:</p><ul><li>I was running version 1.3.0 of the exporter using Helm chart 4.11.0</li><li>The Elasticsearch cluster and exporter were running in the same namespace via ECK</li><li>Both username and password were long, valid strings (ruling out URL-escaping issues)</li><li>Credentials were injected properly via Kubernetes secrets</li></ul><p>In one environment, everything worked fine. In another, it broke — and <strong>all exporter requests to Elasticsearch failed authentication</strong>.</p><h3>🧠 The Mistake I Made: Interpolating Credentials in the URI</h3><p>I had configured the exporter like this:</p><pre>--es.uri=http://$(ES_USERNAME):$(ES_PASSWORD)@&lt;host&gt;:9200</pre><p>It felt logical: pull the credentials from environment variables and plug them directly into the URI. But the problem? <strong>Shell-style interpolation doesn’t happen inside Helm values or manifest YAMLs</strong> — at least not the way I expected.</p><p>As a result, the actual request looked like:</p><pre>http://$(ES_USERNAME):$(ES_PASSWORD)@&lt;host&gt;:9200</pre><p>Literally. The exporter tried to authenticate with those literal strings — and naturally, Elasticsearch rejected it.</p><h3>✅ The Fix: Let the Exporter Use Environment Variables Natively</h3><p>After revisiting the <a href="https://github.com/prometheus-community/elasticsearch_exporter">official documentation</a>, I learned that the exporter <strong>automatically uses </strong><strong>ES_USERNAME and </strong><strong>ES_PASSWORD from the environment</strong> — no need to put them in the URI.</p><p>I changed the config to:</p><pre>--es.uri=http://&lt;host&gt;:9200</pre><p>And kept the environment variables set as before.</p><p><strong>Boom. Problem solved. The exporter authenticated properly again.</strong></p><h3>💡 Key Takeaways</h3><ul><li>🧪 Don’t interpolate environment variables in the URI — the exporter handles credentials automatically.</li><li>📚 Always check the official docs when in doubt — this behavior was clearly documented, but easy to overlook.</li><li>💬 Commenting on GitHub issues helps — I <a href="https://github.com/prometheus-community/elasticsearch_exporter/issues/573#issuecomment-2215690920">shared my findings</a> to help others facing similar problems. It’s a small but real open source contribution.</li></ul><h3>👣 My Takeaway</h3><p>This experience reminded me that even small misconfigurations can lead to major confusion — and that <strong>sharing what you learn is just as important as learning it</strong>.</p><p>Open source isn’t just about code. It’s also about showing up, contributing your experience, and making the next person’s journey smoother.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7775af2e4eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating an EKS Cluster using Terraform]]></title>
            <link>https://medium.com/@zartashrao96/creating-an-eks-cluster-using-terraform-2cff71426648?source=rss-6c54e469df51------2</link>
            <guid isPermaLink="false">https://medium.com/p/2cff71426648</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[elastic-container-service]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[terraform-aws]]></category>
            <dc:creator><![CDATA[Zartash Aslam]]></dc:creator>
            <pubDate>Mon, 16 Jan 2023 17:30:43 GMT</pubDate>
            <atom:updated>2023-01-16T17:30:43.524Z</atom:updated>
            <content:encoded><![CDATA[<p>AWS Elastic Kubernetes Service (EKS) is a managed Kubernetes service that makes it easy to deploy, scale, and manage containerized applications using Kubernetes on AWS. In this blog post, we will walk through the process of creating an EKS cluster using Terraform, a popular infrastructure as code tool.</p><p><strong>Prerequisites:</strong></p><ul><li>An AWS account</li><li>Terraform installed on your local machine</li><li>AWS CLI configured on your local machine</li></ul><p><strong>Step 1: Create an IAM user</strong></p><p>To create an EKS cluster, we first need to create an IAM user with the necessary permissions. To do this, log in to the AWS Management Console, navigate to the IAM service, and create a new user with the “AdministratorAccess” policy. Make sure to save the access key and secret key for the user.</p><p><strong>Step 2: Configure Terraform</strong></p><p>Create a new Terraform configuration file and add the following code to it:</p><pre>provider &quot;aws&quot; {<br>  region = &quot;us-west-2&quot;<br>}<br><br>resource &quot;aws_eks_cluster&quot; &quot;example&quot; {<br>  name     = &quot;example-cluster&quot;<br>  role_arn = aws_iam_role.example.arn<br>}<br><br>resource &quot;aws_iam_role&quot; &quot;example&quot; {<br>  name = &quot;example-role&quot;<br><br>  assume_role_policy = &lt;&lt;EOF<br>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Principal&quot;: {<br>        &quot;Service&quot;: &quot;eks.amazonaws.com&quot;<br>      },<br>      &quot;Action&quot;: &quot;sts:AssumeRole&quot;<br>    }<br>  ]<br>}<br>EOF<br>}<br><br>resource &quot;aws_iam_role_policy&quot; &quot;example&quot; {<br>  name = &quot;example-policy&quot;<br>  role = aws_iam_role.example.id<br><br>  policy = &lt;&lt;EOF<br>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Action&quot;: [<br>        &quot;autoscaling:*&quot;,<br>        &quot;cloudwatch:*&quot;,<br>        &quot;ec2:*&quot;,<br>        &quot;elasticloadbalancing:*&quot;,<br>        &quot;iam:PassRole&quot;,<br>        &quot;route53:*&quot;,<br>        &quot;s3:*&quot;,<br>        &quot;sns:*&quot;,<br>        &quot;sqs:*&quot;<br>      ],<br>      &quot;Resource&quot;: &quot;*&quot;<br>    }<br>  ]<br>}<br>EOF<br>}</pre><p>This code creates an EKS cluster named “example-cluster” in the “us-west-2” region and an IAM role with the necessary permissions to manage the cluster.</p><p><strong>Step 3: Run Terraform</strong></p><p>In your terminal, navigate to the directory containing your Terraform configuration file and run the following commands:</p><pre>terraform init<br>terraform apply</pre><p>Terraform will prompt you to confirm that you want to create the resources defined in the configuration file. Once you confirm, Terraform will create the EKS cluster and the necessary resources.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2cff71426648" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing Docker on Ubuntu: A Step-by-Step Guide]]></title>
            <link>https://medium.com/@zartashrao96/installing-docker-on-ubuntu-a-step-by-step-guide-bca8ceb5c404?source=rss-6c54e469df51------2</link>
            <guid isPermaLink="false">https://medium.com/p/bca8ceb5c404</guid>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[docker-compose]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[dockerfiles]]></category>
            <dc:creator><![CDATA[Zartash Aslam]]></dc:creator>
            <pubDate>Wed, 11 Jan 2023 17:47:59 GMT</pubDate>
            <atom:updated>2023-01-11T17:49:32.659Z</atom:updated>
            <content:encoded><![CDATA[<p>Docker is a powerful tool that enables you to easily create, deploy, and run applications in containers. This allows you to easily manage your dependencies and isolate your application from the host system, making it easy to create portable and consistent development and production environments.</p><p>In this tutorial, I’ll guide you through the process of installing Docker on Ubuntu. Whether you’re new to Docker or a seasoned veteran, you’ll find this guide to be a helpful resource.</p><p><strong>Step 1: Update Your Packages</strong></p><p>The first thing you’ll need to do is update your existing list of packages. This can be done by running the following command in your terminal:</p><pre>sudo apt-get update</pre><p><strong>Step 2: Install Prerequisites</strong></p><p>Before we can install Docker, we’ll need to install some packages that allow apt to use a repository over HTTPS. You can do this by running the following command:</p><pre>sudo apt-get install apt-transport-https ca-certificates curl software-properties-common</pre><p>Step 3: Add the Docker Repository GPG Key</p><p>Next, we’ll need to add the official Docker repository GPG key to our system. You can do this by running the following command:</p><pre>curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -</pre><p><strong>Step 4: Verify the Key Fingerprint</strong></p><p>It’s important to verify the key fingerprint to ensure that the key is authentic. You can do this by running the following command:</p><pre>sudo apt-key fingerprint 0EBFCD88</pre><p><strong>Step 5: Add the Docker Repository</strong></p><p>Now, we’ll need to add the stable Docker repository to our system’s package sources. You can do this by running the following command:</p><pre>sudo add-apt-repository &quot;deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable&quot;</pre><p><strong>Step 6: Update the Package Database</strong></p><p>With the Docker repository added to our package sources, we’ll need to update the package database with the Docker packages. You can do this by running the following command:</p><pre>sudo apt-get update</pre><p><strong>Step 7: Install Docker</strong></p><p>Finally, we’re ready to install Docker! You can do this by running the following command:</p><pre>sudo apt-get install docker-ce    </pre><p><strong>Step 8: Verify the Installation</strong></p><p>To verify that Docker was installed correctly, you can run the following command, which should display the version of Docker CE running on your system:</p><pre>docker --version    </pre><p>Congratulations, you’ve successfully installed Docker on Ubuntu! You can now start using Docker by running the “docker” command.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bca8ceb5c404" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create AWS VPC and Subnets using Terraform]]></title>
            <link>https://medium.com/@zartashrao96/create-aws-vpc-and-subnets-using-terraform-939147acd465?source=rss-6c54e469df51------2</link>
            <guid isPermaLink="false">https://medium.com/p/939147acd465</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[iaac]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Zartash Aslam]]></dc:creator>
            <pubDate>Wed, 11 Jan 2023 17:27:20 GMT</pubDate>
            <atom:updated>2023-01-11T17:27:20.725Z</atom:updated>
            <content:encoded><![CDATA[<p>Creating an Amazon Web Services (AWS) Virtual Private Cloud (VPC) using Terraform is a powerful way to manage your infrastructure as code. By using Terraform to create your VPC, you can version control your infrastructure and easily replicate it across different environments. In this blog post, I will walk you through the process of creating a simple VPC with a single subnet using Terraform.</p><h3>Prerequisites</h3><p>Before you begin, you will need to have the following:</p><ul><li>An AWS account</li><li>Terraform installed on your local machine</li><li>An IAM user with permissions to create and manage VPCs in your AWS account</li><li>AWS Access and Secret Key</li></ul><h3>Setting up the Provider</h3><p>The first step in creating a VPC using Terraform is to configure the AWS provider. This tells Terraform where to create the VPC and what credentials to use.</p><p>To configure the AWS provider, you need to create a file called provider.tf and add the following code:</p><pre>provider &quot;aws&quot; {<br>  region = &quot;us-west-2&quot;<br>}</pre><h3>Creating the VPC</h3><p>Once the provider is configured, you can use the aws_vpc resource to create the VPC. Create a new file called vpc.tf and add the following code:</p><pre>resource &quot;aws_vpc&quot; &quot;example&quot; {<br>  cidr_block = &quot;10.0.0.0/16&quot;<br>  <br>  tags = {<br>    Name = &quot;example-vpc&quot;<br>  }<br>}</pre><p>This creates a VPC with a CIDR block of 10.0.0.0/16, and adds a tag with the key of Name and the value example-vpc.</p><h3>Creating the Subnet</h3><p>To create the subnet for the VPC, you will need to use the aws_subnet resource. In the same file vpc.tf , you can add the following code:</p><pre>resource &quot;aws_subnet&quot; &quot;example&quot; {<br>  vpc_id            = aws_vpc.example.id<br>  cidr_block        = &quot;10.0.1.0/24&quot;<br>  availability_zone = &quot;us-west-2a&quot;<br><br>  tags = {<br>    Name = &quot;example-subnet&quot;<br>  }<br>}</pre><p>This creates a subnet in the us-west-2a availability zone with a CIDR block of 10.0.1.0/24 and associates it with the VPC created earlier. It also adds a tag with the key of Name and the value example-subnet.</p><h3>Applying the Changes</h3><p>Once you have your provider.tf, vpc.tf file ready, you can now run the Terraform commands to create the VPC and the subnet in your AWS account.</p><pre>terraform init<br>terraform plan<br>terraform apply</pre><p>The terraform init command initializes the working directory containing Terraform configuration files. The terraform plan command shows the changes that will be made when you run the terraform apply command. Finally, the terraform apply command creates the VPC.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=939147acd465" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>