<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: dejanualex</title>
    <description>The latest articles on DEV Community by dejanualex (@dejanualex).</description>
    <link>https://dev.to/dejanualex</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F744381%2Fa6a8a13d-0b73-4418-87e7-bcf888373407.PNG</url>
      <title>DEV Community: dejanualex</title>
      <link>https://dev.to/dejanualex</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dejanualex"/>
    <language>en</language>
    <item>
      <title>kubectl context like a pro</title>
      <dc:creator>dejanualex</dc:creator>
      <pubDate>Mon, 23 Mar 2026 20:42:58 +0000</pubDate>
      <link>https://dev.to/aws-builders/kubectl-context-like-a-pro-1gch</link>
      <guid>https://dev.to/aws-builders/kubectl-context-like-a-pro-1gch</guid>
      <description>&lt;p&gt;If your work involves working with multiple Kubernetes clusters, then this might be for you.&lt;/p&gt;

&lt;p&gt;☸️ A file that is used to configure access to a cluster is called &lt;a href="https://kubernetes.io/docs/reference/kubectl/kubectl/" rel="noopener noreferrer"&gt;kubeconfig&lt;/a&gt;(usually placed at &lt;code&gt;~/.kube/config&lt;/code&gt;), but you can easily override the location by using &lt;code&gt;--kubeconfig=&amp;lt;path_to_config&amp;gt;&lt;/code&gt; flag or using &lt;code&gt;KUBECONFIG&lt;/code&gt; environment variable &lt;code&gt;export KUBECONFIG=&amp;lt;path/to/your_kubeconfig&amp;gt;&lt;/code&gt;. A Kubernetes config file describes &lt;strong&gt;clusters&lt;/strong&gt;, &lt;strong&gt;users&lt;/strong&gt;, and &lt;strong&gt;contexts&lt;/strong&gt;. You can use multiple contexts to target different Kubernetes clusters.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Config&lt;/span&gt;
&lt;span class="na"&gt;preferences&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{}&lt;/span&gt;

&lt;span class="na"&gt;clusters&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;cluster&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;&amp;lt;cluster_name&amp;gt;&lt;/span&gt;
&lt;span class="nn"&gt;...&lt;/span&gt;

&lt;span class="na"&gt;users&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;&amp;lt;user_name&amp;gt;&lt;/span&gt;
&lt;span class="nn"&gt;...&lt;/span&gt;

&lt;span class="na"&gt;contexts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;context&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;&amp;lt;context_name&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;You can render your current config: &lt;code&gt;kubectl config view&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without further ado, let's take the example of merging two config files(one for each cluster):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# create backup for current config&lt;/span&gt;
&lt;span class="nb"&gt;cp&lt;/span&gt; ~/.kube/config ~/.kube/config.bak

&lt;span class="c"&gt;# merge the 2 configs&lt;/span&gt;
&lt;span class="nv"&gt;KUBECONFIG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;~/.kube/config:/path/to/new/config kubectl config view &lt;span class="nt"&gt;--flatten&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; ~/intermediate_config

&lt;span class="c"&gt;# replace the current config with the intermediate_config&lt;/span&gt;
&lt;span class="nb"&gt;mv&lt;/span&gt; ~/intermediate_config ~/.kube/config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A &lt;strong&gt;context&lt;/strong&gt; is a combination of a cluster and user credentials.You can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;List contexts: &lt;code&gt;kubectl config get-contexts&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check the current context: &lt;code&gt;kubectl config current-context&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Switch to desired context: &lt;code&gt;kubectl config use-context &amp;lt;context_name&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Delete context: &lt;code&gt;kubectl config delete-context &amp;lt;context_name&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;⚠️ Running &lt;code&gt;aws eks update-kubeconfig --region &amp;lt;us-east-1&amp;gt; --name &amp;lt;cluster_name&amp;gt;&lt;/code&gt; pulls your cluster's API endpoint and CA data to create/update a context in your local &lt;code&gt;kubeconfig&lt;/code&gt;. This automatically sets that cluster as your active target, so any immediate kubectl commands will execute against it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;aws eks update-kubeconfig &lt;span class="nt"&gt;--region&lt;/span&gt; us-east-1 &lt;span class="nt"&gt;--name&lt;/span&gt; demo-eks
...
&lt;span class="nv"&gt;$ &lt;/span&gt;kubectl config current-context
arn:aws:eks:us-east-1:255656399702:cluster/demo-eks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>kubernetes</category>
      <category>kubectl</category>
      <category>tutorial</category>
      <category>devops</category>
    </item>
    <item>
      <title>From Zero to EKS in Minutes</title>
      <dc:creator>dejanualex</dc:creator>
      <pubDate>Mon, 09 Mar 2026 21:51:59 +0000</pubDate>
      <link>https://dev.to/aws-builders/from-zero-to-eks-in-minutes-3blm</link>
      <guid>https://dev.to/aws-builders/from-zero-to-eks-in-minutes-3blm</guid>
      <description>&lt;p&gt;First, you're going to use the following CLIs as local tooling:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.aws.amazon.com/eks/latest/userguide/install-kubectl.html#eksctl-install-update" rel="noopener noreferrer"&gt;eksctl&lt;/a&gt;: to create EKS clusters in the AWS cloud or on-premises (with EKS Anywhere), as well as modifying and deleting those clusters&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.aws.amazon.com/streams/latest/dev/setup-awscli.html" rel="noopener noreferrer"&gt;aws&lt;/a&gt;: to interact with AWS services&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.aws.amazon.com/eks/latest/userguide/install-kubectl.html" rel="noopener noreferrer"&gt;kubectl&lt;/a&gt;: manage resources within your Kubernetes cluster.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;⚠️ Before creating the cluster, be sure you have an &lt;strong&gt;IAM identity&lt;/strong&gt; set up in place, i.e.:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;IAM User&lt;/strong&gt; specifically for running &lt;code&gt;eksctl&lt;/code&gt; commands.With the needed policies (&lt;code&gt;AmazonEKSClusterPolicy&lt;/code&gt; needed for EKS cluster management, &lt;code&gt;AmazonEKSWorkerNodePolicy&lt;/code&gt; needed for node group operations, &lt;code&gt;AmazonEC2FullAccessRequired&lt;/code&gt; for VPC, subnets, SGs, EC2 instances, &lt;code&gt;AWSCloudFormationFullAccess&lt;/code&gt; required by eksctl, etc.). i.e. &lt;code&gt;eksctl-manager&lt;/code&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3q753rgj0xddvvgcv0mc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3q753rgj0xddvvgcv0mc.png" alt="AWS_IAM_USER" width="800" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;⚠️ The user is overly broad for production, since it grants full IAM control over your entire account. For least privilege, you'd scope it down to only the actions &lt;code&gt;eksctl&lt;/code&gt; needs.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;strong&gt;IAM role&lt;/strong&gt; (with &lt;code&gt;AmazonEKSClusterPolicy&lt;/code&gt;) that AWS's EKS control plane assumes to manage AWS resources inside your account on your behalf.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For the &lt;strong&gt;IAM User&lt;/strong&gt;, create an &lt;strong&gt;access key&lt;/strong&gt; (select Command Line Interface (CLI) as the use case), copy the &lt;strong&gt;Access key&lt;/strong&gt; and &lt;strong&gt;Secret access key&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;On the local machine, do &lt;code&gt;aws configure&lt;/code&gt; to set &lt;code&gt;AWS Access Key ID&lt;/code&gt; and &lt;code&gt;AWS Secret Access Key&lt;/code&gt; (of &lt;code&gt;home&lt;/code&gt; user), add a section to &lt;code&gt;~/.aws/config&lt;/code&gt;. Now you can use those on the local machine to configure a new profile, i.e., eks-manager:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws configure &lt;span class="nt"&gt;--profile&lt;/span&gt; eks-manager

AWS Access Key ID &lt;span class="o"&gt;[&lt;/span&gt;None]: ....
AWS Secret Access Key &lt;span class="o"&gt;[&lt;/span&gt;None]: ...
Default region name &lt;span class="o"&gt;[&lt;/span&gt;None]: us-east-1

aws configure &lt;span class="nb"&gt;set &lt;/span&gt;region us-east-1 &lt;span class="nt"&gt;--profile&lt;/span&gt; eks-manager
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You need a VPC before creating the EKS cluster, but one of the advantages of using &lt;code&gt;eksctl&lt;/code&gt; is that it automatically creates a VPC (if you do not provide one).&lt;/p&gt;

&lt;p&gt;Create &lt;code&gt;demo-eks&lt;/code&gt; cluster in &lt;code&gt;us-east-1&lt;/code&gt; running Kubernetes &lt;code&gt;1.33&lt;/code&gt;, with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a single managed node group, &lt;/li&gt;
&lt;li&gt;autoscaling enabled,&lt;/li&gt;
&lt;li&gt;OIDC configured (this enables IAM Roles for Service Accounts (IRSA), allowing individual pods to have their own IAM permissions rather than using the node's broad permissions,&lt;/li&gt;
&lt;li&gt;ALB ingress support: It attaches the necessary IAM policies to your worker nodes to enable them to interact with an Application Load Balancer. This flag alone does not install the controller.&lt;/li&gt;
&lt;li&gt;No SSH access to worker nodes.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;eksctl create cluster &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--profile&lt;/span&gt; eks-manager &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--name&lt;/span&gt; demo-eks &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--region&lt;/span&gt; us-east-1 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--version&lt;/span&gt; 1.33 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--managed&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--nodegroup-name&lt;/span&gt; ng-general &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--node-type&lt;/span&gt; t3.medium &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--nodes&lt;/span&gt; 2 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--nodes-min&lt;/span&gt; 2 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--nodes-max&lt;/span&gt; 4 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--with-oidc&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--alb-ingress-access&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--ssh-access&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
`&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F02k17cubq5hstqk4y28a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F02k17cubq5hstqk4y28a.png" alt="Cloud_formation_stacks" width="800" height="153"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the networking perspective, the following resources have been created:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A VPC in the desired region us-east-1&lt;/li&gt;
&lt;li&gt;Two subnets in each availability zone, one public subnet (for NAT GW, Internet GW, and LB) and one private (for worker nodes). &lt;/li&gt;
&lt;li&gt;InternetGateway allows inbound and outbound traffic for resources in public subnets (VPC Edge, which provides the route for external traffic to enter the VPC)&lt;/li&gt;
&lt;li&gt;NATGateway enabling egress traffic from private subnets (it translates the private IP of your worker node into its own public IP to reach the internet)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fviyst03uefa4oc0aw0la.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fviyst03uefa4oc0aw0la.png" alt="Networking_resources" width="800" height="278"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, add the cluster to your &lt;code&gt;kubeconfig&lt;/code&gt;: &lt;code&gt;aws eks update-kubeconfig --region us-east-1 --name demo-eks --profile eks-manager&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F288ir74g0ik3ex7i5c88.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F288ir74g0ik3ex7i5c88.png" alt="kubect_get_no" width="800" height="106"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>eks</category>
      <category>kubernetes</category>
      <category>devops</category>
    </item>
    <item>
      <title>k8s debug pod</title>
      <dc:creator>dejanualex</dc:creator>
      <pubDate>Tue, 20 Jan 2026 15:18:57 +0000</pubDate>
      <link>https://dev.to/aws-builders/k8s-debug-pod-57m4</link>
      <guid>https://dev.to/aws-builders/k8s-debug-pod-57m4</guid>
      <description>&lt;p&gt;At various points in an &lt;a href="https://docs.aws.amazon.com/eks/latest/userguide/what-is-eks.html" rel="noopener noreferrer"&gt;Amazon EKS cluster&lt;/a&gt;’s lifecycle, direct access to a worker node may be required. This can be done using &lt;code&gt;kubectl debug&lt;/code&gt; to open an interactive shell on the target node.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# start debug container&lt;/span&gt;
kubectl debug nodes/&amp;lt;nodename&amp;gt; &lt;span class="nt"&gt;--profile&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;sysadmin &lt;span class="nt"&gt;-it&lt;/span&gt; &lt;span class="nt"&gt;--image&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;image&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The root filesystem of the Node will be mounted at &lt;code&gt;/host&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The container runs in the host IPC, Network, and PID namespaces, although the pod isn’t privileged, so reading some process information may fail, and &lt;code&gt;chroot /host&lt;/code&gt; may fail.&lt;/li&gt;
&lt;li&gt;If you need a privileged pod, create it manually or use the &lt;code&gt;--profile=sysadmin&lt;/code&gt; flag.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The sysadmin profile typically sets up the pod with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;privileged: true&lt;/li&gt;
&lt;li&gt;hostPID: true (for node networking)&lt;/li&gt;
&lt;li&gt;hostNetwork: true (for process visibility)&lt;/li&gt;
&lt;li&gt;host filesystem mounted at &lt;code&gt;/host&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To help ensure no vulnerabilities are introduced into the cluster, an easy approach is to use something like Docker Hardened Images(since DHI repositories require authentication, I’ve mirrored Alpine in my own repository) i.e. &lt;code&gt;kubectl debug nodes/node01 --profile=sysadmin -it --image=dejanualex/alpine:3.23&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdmze8quru5lhtml5wfl7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdmze8quru5lhtml5wfl7.png" alt="debug pod" width="800" height="63"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next to “switch” from the container filesystem you need to &lt;code&gt;chroot /host&lt;/code&gt; And from there you are effectively in the node’s userland, and you can use the node’s binaries:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3rn6afyjo45jb4o9035w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3rn6afyjo45jb4o9035w.png" alt="interactive debug pod" width="800" height="165"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;kubectl debug&lt;/code&gt; creates a debug pod with a name derived from the node name, so remember to delete the pod once you’re done debugging.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdh1o0z0u6qzmnxv184cj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdh1o0z0u6qzmnxv184cj.png" alt="debug pods" width="784" height="136"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>eks</category>
      <category>devops</category>
      <category>containers</category>
    </item>
    <item>
      <title>Kubernetes operator AWS ECR ecr-creds-refresher</title>
      <dc:creator>dejanualex</dc:creator>
      <pubDate>Sun, 21 Dec 2025 19:42:27 +0000</pubDate>
      <link>https://dev.to/dejanualex/kubernetes-operator-aws-ecr-ecr-creds-refresher-43f8</link>
      <guid>https://dev.to/dejanualex/kubernetes-operator-aws-ecr-ecr-creds-refresher-43f8</guid>
      <description>&lt;p&gt;

&lt;/p&gt;
&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/aws-builders/ecr-creds-refresher-43g3" class="crayons-story__hidden-navigation-link"&gt;ECR-creds-refresher&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;
          &lt;a class="crayons-logo crayons-logo--l" href="/aws-builders"&gt;
            &lt;img alt="AWS Community Builders  logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F2794%2F88da75b6-aadd-4ea1-8083-ae2dfca8be94.png" class="crayons-logo__image"&gt;
          &lt;/a&gt;

          &lt;a href="/dejanualex" class="crayons-avatar  crayons-avatar--s absolute -right-2 -bottom-2 border-solid border-2 border-base-inverted  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F744381%2Fa6a8a13d-0b73-4418-87e7-bcf888373407.PNG" alt="dejanualex profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/dejanualex" class="crayons-story__secondary fw-medium m:hidden"&gt;
              dejanualex
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                dejanualex
                
              
              &lt;div id="story-author-preview-content-3119260" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/dejanualex" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F744381%2Fa6a8a13d-0b73-4418-87e7-bcf888373407.PNG" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;dejanualex&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

            &lt;span&gt;
              &lt;span class="crayons-story__tertiary fw-normal"&gt; for &lt;/span&gt;&lt;a href="/aws-builders" class="crayons-story__secondary fw-medium"&gt;AWS Community Builders &lt;/a&gt;
            &lt;/span&gt;
          &lt;/div&gt;
          &lt;a href="https://dev.to/aws-builders/ecr-creds-refresher-43g3" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Dec 21 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/aws-builders/ecr-creds-refresher-43g3" id="article-link-3119260"&gt;
          ECR-creds-refresher
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/aws"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;aws&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/kubernetes"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;kubernetes&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/elasticcontainerregistry"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;elasticcontainerregistry&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/containers"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;containers&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/aws-builders/ecr-creds-refresher-43g3" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;2&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/aws-builders/ecr-creds-refresher-43g3#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            2 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;




</description>
      <category>aws</category>
      <category>kubernetes</category>
      <category>elasticcontainerregistry</category>
      <category>containers</category>
    </item>
    <item>
      <title>ECR-creds-refresher</title>
      <dc:creator>dejanualex</dc:creator>
      <pubDate>Sun, 21 Dec 2025 19:40:07 +0000</pubDate>
      <link>https://dev.to/aws-builders/ecr-creds-refresher-43g3</link>
      <guid>https://dev.to/aws-builders/ecr-creds-refresher-43g3</guid>
      <description>&lt;p&gt;Generally, the following are the main methods to &lt;strong&gt;authenticate&lt;/strong&gt; to a &lt;strong&gt;private&lt;/strong&gt; &lt;strong&gt;registry&lt;/strong&gt; in order to be able to &lt;strong&gt;pull&lt;/strong&gt; images from it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Configuring the container runtime on each node, i.e. k3s checks if &lt;code&gt;/etc/rancher/k3s/registries.yaml&lt;/code&gt; file exists, to retrieve the &lt;a href="https://docs.k3s.io/installation/private-registry" rel="noopener noreferrer"&gt;registry configuration&lt;/a&gt; when generating the containerd configuration to authenticate to the private registry.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Using a kubelet credential provider plugin &lt;a href="https://kubernetes.io/docs/concepts/containers/images/#kubelet-credential-provider" rel="noopener noreferrer"&gt;to dynamically fetch&lt;/a&gt; credentials for private registries. (configure the &lt;a href="https://kubernetes.io/docs/concepts/containers/images/#configuring-nodes-to-authenticate-to-a-private-registry" rel="noopener noreferrer"&gt;kubelet to invoke a plugin binary&lt;/a&gt; to dynamically fetch registry credentials).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;In this particular case, the motivation was that I had to authenticate to &lt;a href="https://aws.amazon.com/ecr/" rel="noopener noreferrer"&gt;AWS Elastic Container Registry&lt;/a&gt; private repositories, and couldn’t modify the aforementioned cluster configurations. Therefore &lt;strong&gt;ecr-creds-refresher&lt;/strong&gt; operator was the natural workaround.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pre-requisites
&lt;/h2&gt;

&lt;p&gt;Before obtaining the ECR authentication authorization token ( &lt;code&gt;aws ecr get-login-password --region REGION | docker login --username AWS --password-stdin AWS_ACCOUNT_ID.dkr.ecr.REGION.amazonaws.com&lt;/code&gt;), ensure that you have an AWS user/role with the required ECR permissions and valid AWS credentials (such as &lt;code&gt;AWS_ACCESS_KEY_ID&lt;/code&gt; and &lt;code&gt;AWS_SECRET_ACCESS_KEY&lt;/code&gt;, or temporary credentials when assuming a role).&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;When attempting to spin up a pod based on an image from the private ECR repo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl run &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;--image&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;255656399702.dkr.ecr.us-east-1.amazonaws.com/os/alpine:latest &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;--image-pull-policy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Always &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="nb"&gt;sleep &lt;/span&gt;5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The pod will fail with &lt;code&gt;ImagePullBackOff&lt;/code&gt;:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbfy7ia9q93gxez6sgox8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbfy7ia9q93gxez6sgox8.png" alt="ImagePullBackOff" width="800" height="52"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To fix this, we need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A secret that holds the &lt;code&gt;AWS_ACCESS_KEY_ID&lt;/code&gt; and &lt;code&gt;AWS_SECRET_ACCESS_KEY&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A mechanism to obtain the authentication token. ⚠️ Important note: An authentication token is used to access any Amazon ECR registry that your IAM principal has &lt;a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html#registry-auth-token" rel="noopener noreferrer"&gt;access to and is valid for 12 hours&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The second point is exactly what the &lt;strong&gt;ecr-creds-refresher&lt;/strong&gt; will do for us, more concretely:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Upon startup, it will read the AWS credentials from the configured secret (which can be in any namespace).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Watches for &lt;code&gt;ECRPullSecret&lt;/code&gt; custom resources (CRs), on CR Creation/Update/Resume, will fetch the ECR token from AWS, update the secret that holds the token, and patch the &lt;code&gt;default&lt;/code&gt; ServiceAccount in the &lt;strong&gt;desired namespaces&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Last but not least, the operator does a periodic refresh of the ECR token and updates all secrets in the &lt;strong&gt;desired namespaces&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By &lt;strong&gt;desired namespace&lt;/strong&gt;, I mean the namespaces in which we want to run pods that use images from private ECR repositories (this is easily configurable using the operator CustomResource).&lt;/p&gt;

&lt;p&gt;🔄 Operator 👉 &lt;a href="https://www.youtube.com/watch?v=o3R-L5RVKrQ" rel="noopener noreferrer"&gt;demo&lt;/a&gt; and repo 👉 &lt;a href="https://github.com/dejanu/ecr-creds-refresher" rel="noopener noreferrer"&gt;ecr-creds-refresher&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>kubernetes</category>
      <category>elasticcontainerregistry</category>
      <category>containers</category>
    </item>
    <item>
      <title>Not All OSS Is Created Equal</title>
      <dc:creator>dejanualex</dc:creator>
      <pubDate>Wed, 08 Oct 2025 10:10:32 +0000</pubDate>
      <link>https://dev.to/dejanualex/not-all-oss-is-created-equal-5fci</link>
      <guid>https://dev.to/dejanualex/not-all-oss-is-created-equal-5fci</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Open-source software is a type of computer software in which source code is released under a license in which the copyright holder grants users the rights to study, change, and distribute the software to anyone and for any purpose."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Open source doesn't just mean public access to a codebase; it indicates how the code can be &lt;strong&gt;used&lt;/strong&gt; and &lt;strong&gt;distributed&lt;/strong&gt; afterward. It's about opening up a living project for participation from anyone who wants to get involved. One of the key reasons companies open-source projects is that they want the community to get involved.&lt;/p&gt;

&lt;p&gt;There are 3 dimensions to engaging with open-source software:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Consumers&lt;/strong&gt; who study or use the repositories of others.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Contributors&lt;/strong&gt; who are actively involved in the improvement of the repositories of others.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Producers/Maintainers&lt;/strong&gt; who build and maintain their own repositories that are open to others.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;The truth is that many projects aren't destined for open-source greatness.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;While your criteria may vary based on your company's goals and process level, here are some things to consider before open-sourcing a project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Does your project contain intellectual property that you want to protect? If so, then opening its source would give away its value. Don't open-source those kinds of projects unless you feel the benefits outweigh the risks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Is the project in a stable state with good code quality? The project doesn't have to be perfect, but potential contributors may walk away if the project is in terrible shape to begin with.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Is your project useful to people outside of your company? If not, then you probably aren't getting any participation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Are people outside your company able to contribute? They need access to all project dependencies, build processes, and whatever else is needed to run the project. If they can't run it, then they can't contribute.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Does your team have the bandwidth to support an open-source program? If you open-source a project and then don't support it, you might lose your opportunity to build a trusting community.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Can you change the code? Can you share it or sell it? Can you use it commercially?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A &lt;strong&gt;license agreement&lt;/strong&gt; comes with the source code and specifies what can and cannot be done. The license spectrum impose different obligations from &lt;strong&gt;permissive&lt;/strong&gt; to &lt;strong&gt;restrictive&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1cr7p76r3pnrtuvaqzay.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1cr7p76r3pnrtuvaqzay.png" alt="License Spectrum" width="800" height="335"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're contributing to an existing project, it's almost always easiest to continue using that project's license. To find its license, look for a file called &lt;code&gt;LICENSE&lt;/code&gt; or &lt;code&gt;COPYING&lt;/code&gt;, and skim the project's &lt;code&gt;README&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Permissive licenses:
&lt;/h2&gt;

&lt;p&gt;"Do whatever you want, just give credit"…carry  minimal restrictions, and allow practically every type of use, modification, and redistribution, the only restriction is that the original attribution to the authors remains included in the source code or as part of the downstream use of the new software.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgmy15kac8c86656xthzy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgmy15kac8c86656xthzy.png" alt="GNU all permissive License" width="682" height="245"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://opensource.org/" rel="noopener noreferrer"&gt;Open Source Initiative&lt;/a&gt; defines it as "a non-copyleft license that guarantees the freedom to use, modify, and redistribute", basically as a free software license e.g. &lt;a href="https://en.wikipedia.org/wiki/BSD_licenses" rel="noopener noreferrer"&gt;BSD-like&lt;/a&gt;, &lt;a href="https://opensource.org/license/mit" rel="noopener noreferrer"&gt;MIT&lt;/a&gt;, &lt;a href="https://www.apache.org/licenses/LICENSE-2.0" rel="noopener noreferrer"&gt;Apache&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;GitHub's &lt;a href="https://choosealicense.com/" rel="noopener noreferrer"&gt;choosealicense&lt;/a&gt; website describes the permissive &lt;a href="https://en.wikipedia.org/wiki/MIT_License" rel="noopener noreferrer"&gt;MIT license&lt;/a&gt; as &lt;em&gt;"[letting] people do anything they want with your code as long as they provide &lt;a href="https://en.wikipedia.org/wiki/Attribution_(copyright)" rel="noopener noreferrer"&gt;attribution&lt;/a&gt; back to you and don't hold you &lt;a href="https://en.wikipedia.org/wiki/Product_liability" rel="noopener noreferrer"&gt;liable&lt;/a&gt;."&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Restrictive licenses:
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;"If you modify and distribute, you must share your changes under the same license"&lt;/em&gt;… considered protective, as it grants use rights, and forbid &lt;a href="https://en.wikipedia.org/wiki/Proprietary_software" rel="noopener noreferrer"&gt;proprietization&lt;/a&gt;, requiring that all modified/extended versions also be free and released under the same terms and conditions.&lt;/p&gt;

&lt;p&gt;The Copyleft licenses are rather "viral" as it spreads to the entire project, Richard Stallman (GPL creator) prefers terms like "protective".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One GPL dependency could force to open-source the entire product&lt;/strong&gt;&lt;br&gt;
You find a MIT-licensed library, use it in your proprietary app, sell the app as closed-source, perfectly legal MIT doesn't care.&lt;br&gt;
You find a GPL-licensed library, use it in your proprietary app, want to sell the app as closed-source 🚫not allowed, your entire app must be GPL and open-source.&lt;/p&gt;

&lt;p&gt;GPL has a &lt;strong&gt;loophole&lt;/strong&gt;, running modified GPL software on your servers, results in no obligation to share, but AGPL(GNU Affero General Public License) close this loophole. If users access your software over a network, you must share the source code,&lt;/p&gt;

&lt;p&gt;That's why many companies avoid AGPL like the plague and often prefer MIT/Apache licenses.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GPL: "Distribute it, and you must share the source".&lt;/li&gt;
&lt;li&gt;AGPL: "Distribute it, or use it over a network, and you must share the source&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://opensource.org/licenses" rel="noopener noreferrer"&gt;List of OSI Approved Licenses&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffzzc3o6ozjio66wubko5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffzzc3o6ozjio66wubko5.png" alt="OSI Approved Licenses" width="800" height="642"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  S̶u̶c̶c̶e̶s̶s̶f̶u̶l̶ stories: It's all about distribution
&lt;/h3&gt;

&lt;p&gt;Keep in mind that about 80% of a software solution relies on existing components maintained outside of the project, and not all open-source licenses play nicely together.&lt;/p&gt;

&lt;p&gt;⚠️ Combining Permissive + Copyleft → Copyleft wins, everything becomes copyleft.&lt;br&gt;
📌 Derivative works, or future versions, of permissively licensed software can be released as proprietary software.&lt;br&gt;
💸 For most licenses, obligations trigger when you distribute the software (i.e. selling the SW to customers, giving away binaries, providing downloadable apps).&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hacktoberfest</category>
      <category>opensource</category>
      <category>beginners</category>
    </item>
    <item>
      <title>AWS Spot Instances: Business Case Essentials</title>
      <dc:creator>dejanualex</dc:creator>
      <pubDate>Wed, 16 Jul 2025 11:11:39 +0000</pubDate>
      <link>https://dev.to/aws-builders/aws-spot-instances-business-case-essentials-51jk</link>
      <guid>https://dev.to/aws-builders/aws-spot-instances-business-case-essentials-51jk</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; Convince your client, organization to migrate to spot instances.&lt;/p&gt;

&lt;p&gt;Assuming that you don't have access to tools like AWS Cost Explorer, AWS Cost and Usage Reports, or AWS Cloud Intelligence Dashboard to examine your workloads and to retrieve estimated cost and usage information. &lt;/p&gt;

&lt;p&gt;Don't forget costs are driven by 3 factors: &lt;strong&gt;compute&lt;/strong&gt;, &lt;strong&gt;storage&lt;/strong&gt;, and &lt;strong&gt;networking&lt;/strong&gt; (ingress is often free or at very low cost). You're going to focus on the compute side of things as being a cost driver.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt; Ask for a bill or estimated bill summary.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt; Identify the pricing plan (Free Tier, On-Demand, Reserved Instances, or Savings Plans). Rule of thumb use on-demand (pay-as-you-go) for flexibility, reserved instances for predictable workloads, and free tier for eligible services. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcwo4ktop35skwp6dikb7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcwo4ktop35skwp6dikb7.png" alt="PricingPlans" width="800" height="354"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt; Do a cost estimation using &lt;a href="https://calculator.aws/#/estimate" rel="noopener noreferrer"&gt;AWS Pricing calculator&lt;/a&gt; to better understand the bill. AWS Pricing Calculator does not include any taxes and the prices for AWS services vary between Regions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1akexb53vkhuky1zbrni.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1akexb53vkhuky1zbrni.png" alt="EC2_pricing" width="800" height="277"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4&lt;/strong&gt; Examine the compute usage and identify suitable services and workloads. Services like &lt;a href="https://aws.amazon.com/eks/" rel="noopener noreferrer"&gt;EKS&lt;/a&gt;, &lt;a href="https://aws.amazon.com/opensearch-service/" rel="noopener noreferrer"&gt;OpenSearch&lt;/a&gt;, CloudWatch, &lt;a href="https://aws.amazon.com/kinesis/" rel="noopener noreferrer"&gt;Kinesis&lt;/a&gt;, and &lt;a href="https://aws.amazon.com/firehose/" rel="noopener noreferrer"&gt;Firehose&lt;/a&gt; suggest stateless/fault-tolerant/bath-oriented workloads suitable for Spot Instances. Therefore EKS worker nodes, data processing jobs, CI/CD workloads or OpenSearch indexing tasks can be migrated to Spot.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5&lt;/strong&gt; Why Spot Instances? Spot Instances enable access to unused EC2 capacity at discounts of &lt;em&gt;up to 90%&lt;/em&gt; compared to On-Demand pricing. To improve application availability on Spot be as diverse as possible in your instance type and Availability Zone selection.&lt;/p&gt;

&lt;p&gt;Show &lt;strong&gt;potential&lt;/strong&gt; savings i.e. average interruption frequency and savings over on-demand rates over last 30 days for &lt;code&gt;m6i.xlarge&lt;/code&gt; instances.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6xrptkv0hhwtr1oc1wrr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6xrptkv0hhwtr1oc1wrr.png" alt="Potential_saving" width="800" height="274"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Important note, prepare for &lt;strong&gt;Spot Instance Interruption&lt;/strong&gt;. When Amazon EC2 interrupts (reclaims) a Spot Instance by default it will terminate the instance, unless you specify a different interruption behaviour, such as stop or hibernate.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6&lt;/strong&gt; End you business case with confidence:&lt;br&gt;
&lt;em&gt;"Preliminary analysis indicates that the solution could benefit from Spot Instances as a substantial opportunity for cost optimization...The absence of Spot usage reflects untapped savings potential"&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Related read 👉 &lt;a href="https://dev.to/aws-builders/the-art-of-guesstimating-3ne4"&gt;The art of guesstimating&lt;/a&gt; for estimation tips.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloud</category>
      <category>devops</category>
      <category>cloudpractitioner</category>
    </item>
    <item>
      <title>The art of guesstimating</title>
      <dc:creator>dejanualex</dc:creator>
      <pubDate>Thu, 10 Jul 2025 22:40:01 +0000</pubDate>
      <link>https://dev.to/aws-builders/the-art-of-guesstimating-3ne4</link>
      <guid>https://dev.to/aws-builders/the-art-of-guesstimating-3ne4</guid>
      <description>&lt;p&gt;⚠️ Disclaimer: The following post may contain biased opinions. &lt;/p&gt;

&lt;p&gt;At some point in your career, you may be required to provide an estimate related either to cost or capacity, without having the complete view of the solution's architecture and/or infrastructure.&lt;/p&gt;

&lt;p&gt;My simple approach to guestimates relies on the four elements:&lt;/p&gt;

&lt;p&gt;1) &lt;strong&gt;Do not be afraid to make assumptions...or educated guesses&lt;/strong&gt;&lt;br&gt;
Rarely is the sweet spot (costs vs. capacity) hit; as a result, architectures tend to be overprovisioned (most of the time) or underprovisioned (typically reveals itself through system instability).&lt;/p&gt;

&lt;p&gt;2) &lt;strong&gt;Pick your battle&lt;/strong&gt;&lt;br&gt;
Costs are driven by 3 factors: storage, networking (ingress is often free or at very low cost), and compute. Choose one and try to address it as best as you can.&lt;/p&gt;

&lt;p&gt;3) &lt;strong&gt;Scaling is the solution&lt;/strong&gt;&lt;br&gt;
Whether using HPA, VPA, or &lt;a href="https://docs.aws.amazon.com/eks/latest/best-practices/cas.html" rel="noopener noreferrer"&gt;Cluster Autoscaler&lt;/a&gt;, the objective is to scale down when resource utilization drops. &lt;/p&gt;

&lt;p&gt;4) &lt;strong&gt;Follow the money&lt;/strong&gt;&lt;br&gt;
There’s often a tendency to overcommit (exceed allocatable resources), resulting in excessive reservations, underutilized capacity, and ultimately, cost overruns. Make use of tools whenever necessary:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.fairwinds.com/blog/introducing-goldilocks-a-tool-for-recommending-resource-requests" rel="noopener noreferrer"&gt;Goldilocks&lt;/a&gt;: Provides recommendations for workload's resource requests and limits.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://opencost.io/" rel="noopener noreferrer"&gt;OpenCost&lt;/a&gt;: Vendor-neutral project that helps reduce cost overruns by monitoring cloud infrastructure and container costs in real time.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://karpenter.sh/" rel="noopener noreferrer"&gt;Karpenter&lt;/a&gt;: Open-source node lifecycle management project that automates provisioning and deprovisioning of nodes based on the specific scheduling needs of pods.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://keda.sh/" rel="noopener noreferrer"&gt;Keda&lt;/a&gt;: Scaling workloads based on events (message queues, databases, or APIs).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://kube-green.dev/" rel="noopener noreferrer"&gt;KubeGreen&lt;/a&gt;: Simple Kubernetes addon that automatically shuts down (some of) your resources when you don't need them.&lt;/p&gt;

&lt;p&gt;💡 As a final thought, remember:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Overcommitment is not a bad thing in itself, but it works on the assumption that not all the pods will claim all of their usable resources at the same time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Horizontal scaling is best suited for stateless workloads, and vertical scaling for stateful workloads.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;HPA requires at least 1 Pod to be running at all times, so that it can collect the metrics used to inform future scale-up decisions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Memory resource units  &lt;code&gt;Mi&lt;/code&gt; is &lt;strong&gt;mebibytes&lt;/strong&gt; and &lt;code&gt;M&lt;/code&gt; is &lt;strong&gt;megabytes&lt;/strong&gt; (computers use the binary system, therefore Mi usage is preferred).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;CPU limits&lt;/code&gt; are enforced by CPU throttling, and &lt;code&gt;memory limits&lt;/code&gt; are enforced by the kernel with OOM kills.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Allocatable resources hold greater significance than capacity when it comes to workload placement.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>kubernetes</category>
      <category>cloud</category>
      <category>architecture</category>
    </item>
    <item>
      <title>TL;DR YAML anchors</title>
      <dc:creator>dejanualex</dc:creator>
      <pubDate>Wed, 09 Jul 2025 09:03:56 +0000</pubDate>
      <link>https://dev.to/dejanualex/tldr-yaml-anchors-39gn</link>
      <guid>https://dev.to/dejanualex/tldr-yaml-anchors-39gn</guid>
      <description>&lt;p&gt;Two main components: &lt;strong&gt;Anchor&lt;/strong&gt; &lt;code&gt;&amp;amp;&lt;/code&gt; which defines a chunk of configuration and &lt;strong&gt;Alias&lt;/strong&gt; &lt;code&gt;*&lt;/code&gt; used to refer to that chunk elsewhere. &lt;/p&gt;

&lt;p&gt;Simple example, create &lt;code&gt;dwarfs.yaml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;&amp;gt;dwarfs.yaml
- &amp;amp;dwarf Gimli
- Dain
- Thorin
- *dwarf 
- Balin
- *dwarf 
&lt;/span&gt;&lt;span class="no"&gt;EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When an YAML parser reads &lt;code&gt;dwarfs.yaml&lt;/code&gt; the &lt;strong&gt;alias will render the value identified by the anchor&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnfzmk3xcoc6qhxoe42yc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnfzmk3xcoc6qhxoe42yc.png" alt=" " width="386" height="138"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;An anchor can be referenced by multiple aliases, and also we can &lt;strong&gt;merge maps&lt;/strong&gt; (to add more values, or override existing ones) i.e.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;&amp;gt;dwarfs.yaml
# anchor
Gloin: &amp;amp;dwarf_basics
  role: Member
  hood_color: white
  skills: &amp;amp;skills_base
    - battle
    - mining

# alias and merge map
Oin:
  &amp;lt;&amp;lt;: *dwarf_basics
  role: Leader
&lt;/span&gt;&lt;span class="no"&gt;EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In &lt;code&gt;dwarfs.yaml&lt;/code&gt; file, &lt;code&gt;Gloin&lt;/code&gt; is being used as base definition. &lt;code&gt;Oin&lt;/code&gt; uses &lt;code&gt;&amp;lt;&amp;lt;&lt;/code&gt; as key, which indicates that key-values from another mapping should be merged. Important note &lt;code&gt;role&lt;/code&gt; value will be override in &lt;code&gt;Oin&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6r1ziiwqgeynwkis3o6m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6r1ziiwqgeynwkis3o6m.png" alt=" " width="392" height="561"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>devops</category>
      <category>productivity</category>
      <category>beginners</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>dejanualex</dc:creator>
      <pubDate>Sun, 16 Feb 2025 19:53:46 +0000</pubDate>
      <link>https://dev.to/dejanualex/-4f61</link>
      <guid>https://dev.to/dejanualex/-4f61</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/aws-builders" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__org__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F2794%2F88da75b6-aadd-4ea1-8083-ae2dfca8be94.png" alt="AWS Community Builders " width="350" height="350"&gt;
      &lt;div class="ltag__link__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F744381%2Fa6a8a13d-0b73-4418-87e7-bcf888373407.PNG" alt="" width="138" height="179"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/aws-builders/the-scoop-on-opensearch-sizing-1c9e" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;The Scoop On OpenSearch sizing&lt;/h2&gt;
      &lt;h3&gt;dejanualex for AWS Community Builders  ・ Sep 2 '24&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#aws&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#opensearch&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#tutorial&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#elasticsearch&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>aws</category>
      <category>opensearch</category>
      <category>tutorial</category>
      <category>elasticsearch</category>
    </item>
    <item>
      <title>AWS Academy by PartyRock</title>
      <dc:creator>dejanualex</dc:creator>
      <pubDate>Fri, 14 Feb 2025 23:54:05 +0000</pubDate>
      <link>https://dev.to/aws-builders/aws-academy-by-partyrock-2mie</link>
      <guid>https://dev.to/aws-builders/aws-academy-by-partyrock-2mie</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: &lt;a href="https://partyrock.aws/" rel="noopener noreferrer"&gt;PartyRock &lt;/a&gt;is &lt;a href="https://aws.amazon.com/bedrock/" rel="noopener noreferrer"&gt;Amazon Bedrock's&lt;/a&gt; playground where anyone can create generative AI-powered applications simply by describing the app they want to build, without needing to write any code. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpzvn959c88ifwgqoxx3w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpzvn959c88ifwgqoxx3w.png" alt="partyrock login" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One of the announcement from re:Invent 2024 was PartyRock's Free daily usage. Previously, PartyRock offered a free trial period for a &lt;strong&gt;limited time&lt;/strong&gt;. Starting in 2025, all users will have a recurring &lt;strong&gt;free daily usage&lt;/strong&gt; granted, &lt;strong&gt;with no credit card required&lt;/strong&gt;.&lt;/p&gt;




&lt;p&gt;For both newcomers or even experienced users, the vast array of services and offerings in AWS can feel overwhelming. I’ve always sought a quick entry point that provides a top-down approach to understanding and learning a new service or cloud concept.&lt;/p&gt;

&lt;p&gt;So, why not use PartyRock to fulfil this goal? 🤔...One prompt, 4 widgets🔥🔥🔥🔥&lt;/p&gt;

&lt;p&gt;Want to learn about EKS, its prerequisites, and installation methods? Just check app 👉 &lt;a href="https://partyrock.aws/u/dejanualex/kSBZywSFf/AWS-Academy" rel="noopener noreferrer"&gt;AWS-Academy&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>ai</category>
      <category>tutorial</category>
      <category>cloud</category>
    </item>
    <item>
      <title>The Scoop On OpenSearch sizing</title>
      <dc:creator>dejanualex</dc:creator>
      <pubDate>Mon, 02 Sep 2024 19:15:15 +0000</pubDate>
      <link>https://dev.to/aws-builders/the-scoop-on-opensearch-sizing-1c9e</link>
      <guid>https://dev.to/aws-builders/the-scoop-on-opensearch-sizing-1c9e</guid>
      <description>&lt;p&gt;Search and analytics means you can search and analyze your data once it has been ingested into OpenSearch.&lt;/p&gt;

&lt;p&gt;Getting acquainted with the terminology is mandatory when working with OpenSearch, therefore you should check &lt;a href="https://dev.to/aws-builders/opensearch-for-humans-344j"&gt;OpenSearch for Humans - a friendly guide&lt;/a&gt;. Additionally, a simple yet concrete &lt;a href="https://dejanu.github.io/oscalculator.html" rel="noopener noreferrer"&gt;OpenSearch Calculator&lt;/a&gt; implementation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Index size? Number of shards per index?
&lt;/h3&gt;

&lt;p&gt;OpenSearch splits &lt;strong&gt;indices&lt;/strong&gt; into &lt;strong&gt;shards&lt;/strong&gt;. Each shard stores a subset of all documents in an index. A shard can be either &lt;strong&gt;primary&lt;/strong&gt; (used for WRITE operations e.g. index, re-index, delete) or &lt;strong&gt;replica&lt;/strong&gt; (used for HA and READ operations e.g. searches). OpenSearch defaults to one primary and one replica shard, for a total of two shards per index.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgbaflxbwphcwybc0clm0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgbaflxbwphcwybc0clm0.png" alt="Index,shard,document" width="693" height="274"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;⚠️ Primary shards cannot be on the same node as the replica.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;shard&lt;/strong&gt; is a piece of an OpenSearch index, each shard is a full Lucene Index, and each &lt;strong&gt;instance&lt;/strong&gt; of &lt;strong&gt;Lucene&lt;/strong&gt; is a running process that &lt;strong&gt;consumes&lt;/strong&gt; &lt;strong&gt;CPU&lt;/strong&gt; and &lt;strong&gt;Memory&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Avoid Oversharding and Node hot spotting
&lt;/h3&gt;

&lt;p&gt;When a &lt;strong&gt;shard&lt;/strong&gt; is involved in an &lt;strong&gt;indexing&lt;/strong&gt; or &lt;strong&gt;search&lt;/strong&gt; request, it uses the CPU to process the request. Each shard you add to an index distributes the processing of requests for that index across an additional CPU. The number of active shards that your domain can support depends on the number of CPUs in the cluster.&lt;/p&gt;

&lt;p&gt;Node hot spotting occurs when resource utilizations are unevenly distributed across nodes, e.g. uneven JVM heap size usage. To quickly detect node hot spotting use OpenSearch API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;GET _cat/nodes?v&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;&amp;amp;h&lt;span class="o"&gt;=&lt;/span&gt;name,heap.current,heap.percent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As a rule of thumb, the allocated &lt;strong&gt;heap&lt;/strong&gt; &lt;strong&gt;size&lt;/strong&gt; should be based on the &lt;strong&gt;available&lt;/strong&gt; &lt;strong&gt;RAM&lt;/strong&gt;: set &lt;code&gt;Xms&lt;/code&gt; and &lt;code&gt;Xmx&lt;/code&gt; to the same value, and no more than 50% of your total memory. A &lt;strong&gt;larger&lt;/strong&gt; Java &lt;strong&gt;heap&lt;/strong&gt; size is useful for &lt;strong&gt;indexing&lt;/strong&gt;, but as memory usage increases, garbage collection becomes more frequent and takes longer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Shard Count
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Shard&lt;/strong&gt; &lt;strong&gt;count&lt;/strong&gt; is &lt;strong&gt;secondary&lt;/strong&gt; to &lt;strong&gt;shard&lt;/strong&gt; &lt;strong&gt;size&lt;/strong&gt;. Shard &lt;strong&gt;size&lt;/strong&gt; &lt;strong&gt;matters&lt;/strong&gt; because it &lt;strong&gt;impacts&lt;/strong&gt; both search &lt;strong&gt;latency&lt;/strong&gt; and &lt;strong&gt;write&lt;/strong&gt; &lt;strong&gt;performance&lt;/strong&gt;. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A small set of &lt;strong&gt;large&lt;/strong&gt; &lt;strong&gt;shards&lt;/strong&gt; uses &lt;strong&gt;fewer&lt;/strong&gt; &lt;strong&gt;resources&lt;/strong&gt; than many small shards (too &lt;strong&gt;many&lt;/strong&gt; &lt;strong&gt;small&lt;/strong&gt; &lt;strong&gt;shards&lt;/strong&gt; will &lt;strong&gt;exhaust&lt;/strong&gt; the &lt;strong&gt;memory&lt;/strong&gt; - JVM Heap), however, on the other side, too few large shards prevent OpenSearch from properly distributing requests.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For &lt;strong&gt;fast&lt;/strong&gt; &lt;strong&gt;indexing&lt;/strong&gt; (ingestion), you need as &lt;strong&gt;many&lt;/strong&gt; &lt;strong&gt;shards&lt;/strong&gt; as possible; for &lt;strong&gt;fast&lt;/strong&gt; &lt;strong&gt;searching&lt;/strong&gt;, it is better to have as &lt;strong&gt;few&lt;/strong&gt; &lt;strong&gt;shards&lt;/strong&gt; as possible&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy1offs8kzkgmmggeplf3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy1offs8kzkgmmggeplf3.png" alt="no of shards" width="667" height="227"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When an index is created, the number of shards must be specified and cannot be changed later without reindexing the data. The number of shards you set for an index should correspond to the size of an index, e.g. looking at the two indices &lt;code&gt;store.sizes&lt;/code&gt; (one which has replicas set to 0 and the other has replicas set to 1) we can observe that each replica is a full copy of a primary shard.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2a2tty35rsgre9gq0xva.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2a2tty35rsgre9gq0xva.png" alt="replicas for indices" width="800" height="51"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;store.size&lt;/code&gt; is the store size taken by primary and replica shards.&lt;br&gt;
&lt;code&gt;pri.store.size&lt;/code&gt; is the store size taken only by primary shards.&lt;/p&gt;

&lt;h3&gt;
  
  
  Total number of shards
&lt;/h3&gt;

&lt;p&gt;First, try to estimate the total size of the data you plan to store in the index and the &lt;strong&gt;retention&lt;/strong&gt; &lt;strong&gt;period&lt;/strong&gt;, and then you can calculate the total number of shards using the formula:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F06caojqwelqrxow63yh3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F06caojqwelqrxow63yh3.png" alt="total no of shards" width="556" height="52"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;⚠️ Ideally, shard sizes should be between &lt;strong&gt;10GB&lt;/strong&gt; and &lt;strong&gt;50GB&lt;/strong&gt; per shard, 10–30 GB for workloads that prioritize low latency (e.g., search workloads), or 30–50 GB (e.g. logging workloads).&lt;/p&gt;

&lt;h3&gt;
  
  
  Number of shards per index
&lt;/h3&gt;

&lt;p&gt;To prevent hot nodes, OpenSearch distributes shards to instances based on count, where each instance receives as nearly as possible the same number of shards. &lt;/p&gt;

&lt;p&gt;Use shard counts that are multiples of the data node count to ensure that each index is distributed evenly across data nodes. To ensure an even distribution of shards across the data nodes follow the formula:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffdm6vbi1vvwuolhpq1va.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffdm6vbi1vvwuolhpq1va.png" alt="shards per index" width="557" height="43"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;i.e. If your cluster has 4 nodes and you want to distribute the shards across all nodes evenly, your index should have 8 shards. In other words, you should have at least one shard per data node.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tunning cluster performance: Search (read) or Ingest (write)?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Search Intensive&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Try to reduce the number of shards as much as possible.&lt;/li&gt;
&lt;li&gt;Replicas improve search performance, so you might want more if you have a read-heavy workload.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Ingest Intensive&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Try to have as many shards, as possible.&lt;/li&gt;
&lt;li&gt;Each replica duplicates the indexing process (new documents are first indexed on the primary and then on any replicas) if you anticipate heavy indexing you can temporarily set the replica count value &lt;code&gt;index.number_of_replicas&lt;/code&gt; to 0.&lt;/li&gt;
&lt;li&gt;Increase Index refresh frequency: Indexing documents initially place them into a memory buffer. At this stage, the documents are not yet searchable. To make these documents searchable, a refresh operation is required. OpenSearch refreshes indexes that have received at least one search request in the last 30 seconds, every 1 second.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# GET /_cluster/settings?include_defaults=true&lt;/span&gt;
default&lt;span class="s2"&gt;": {
        "&lt;/span&gt;index&lt;span class="s2"&gt;": {
          "&lt;/span&gt;refresh_interval&lt;span class="s2"&gt;": "&lt;/span&gt;1s&lt;span class="s2"&gt;"
        }
      },
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This means that documents written to an active index should typically become searchable within 1 second of being written to OpenSearch. This setting can be adjusted on a per-index basis.&lt;/p&gt;

&lt;p&gt;Keep in mind a shorter refresh interval allows documents to become searchable more rapidly post-indexing, but it does so at the expense of increased resource utilisation.&lt;/p&gt;

&lt;p&gt;Last but not least, some key takeaways: &lt;a href="https://dev.to/aws-builders/seven-rules-for-opensearch-sizing-jo3"&gt;Seven rules for OpenSearch sizing&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Links:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/aws-builders/opensearch-for-humans-344j"&gt;OpenSearch for Humans&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@dejanualex/opensearch-do-some-stats-on-your-indices-ac9bb5670444" rel="noopener noreferrer"&gt;OpenSearch: Do Some Stats on Your Indices&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Tooling for benchmarking: &lt;a href="https://opensearch.org/docs/latest/benchmark/" rel="noopener noreferrer"&gt;OpenSearch BenchMark&lt;/a&gt; for gathering performance metrics and &lt;a href="https://github.com/elastic/rally" rel="noopener noreferrer"&gt;rally&lt;/a&gt; a framework for ElasticSearch&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dejanu.github.io/oscalculator.html" rel="noopener noreferrer"&gt;OpenSearch calculator&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/opensearch-service/" rel="noopener noreferrer"&gt;AWS OpenSearch service&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>opensearch</category>
      <category>tutorial</category>
      <category>elasticsearch</category>
    </item>
  </channel>
</rss>
