<?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: saifeddine Rajhi</title>
    <description>The latest articles on DEV Community by saifeddine Rajhi (@seifrajhi).</description>
    <link>https://dev.to/seifrajhi</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%2F1115294%2Fb0ef9303-7486-4357-9deb-678377c6eaec.png</url>
      <title>DEV Community: saifeddine Rajhi</title>
      <link>https://dev.to/seifrajhi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/seifrajhi"/>
    <language>en</language>
    <item>
      <title>Amazon EKS enhanced network policies: Admin and DNS-based controls explained</title>
      <dc:creator>saifeddine Rajhi</dc:creator>
      <pubDate>Mon, 05 Jan 2026 05:30:44 +0000</pubDate>
      <link>https://dev.to/aws-builders/amazon-eks-enhanced-network-policies-admin-and-dns-based-controls-explained-5cmd</link>
      <guid>https://dev.to/aws-builders/amazon-eks-enhanced-network-policies-admin-and-dns-based-controls-explained-5cmd</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;A guide to new &lt;a href="https://aws.amazon.com/blogs/containers/enhance-amazon-eks-network-security-posture-with-dns-and-admin-network-policies/" rel="noopener noreferrer"&gt;Amazon EKS Admin and DNS (FQDN) network policies released in December&lt;/a&gt;:  what they are, how they work, and how to use them with practical YAML.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Amazon EKS enhanced network policies: Admin and DNS-based controls explained
&lt;/h1&gt;

&lt;p&gt;In December, Amazon EKS introduced &lt;a href="https://aws.amazon.com/blogs/containers/amazon-eks-introduces-enhanced-network-policy-capabilities/" rel="noopener noreferrer"&gt;enhanced network policy capabilities&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Admin network policies for cluster-wide control with tiers (Admin and Baseline).&lt;/li&gt;
&lt;li&gt;Application (DNS/FQDN) network policies for domain-based egress in EKS Auto Mode.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This post explains what changed, why it matters, how policies are evaluated, and how to start using them today with simple examples.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Admin policies give platform/security teams cluster-wide, non-overridable controls (Admin tier) and default, overridable controls (Baseline tier).&lt;/li&gt;
&lt;li&gt;Application Network Policies let you allow egress to domains (FQDNs) like api.example.com or *.s3.amazonaws.com — no more IP lists.&lt;/li&gt;
&lt;li&gt;Evaluation order: Admin tier (Deny/Allow/Pass) → namespace NetworkPolicy/ApplicationNetworkPolicy → Baseline tier → default deny.&lt;/li&gt;
&lt;li&gt;Requirements: Kubernetes 1.29+, VPC CNI v1.21.1+ for Admin policies on EC2-based clusters; DNS/FQDN policies are available in EKS Auto Mode.&lt;/li&gt;
&lt;li&gt;Start with deny-by-default at the cluster level, then allow only what you need.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What’s new in EKS:
&lt;/h2&gt;

&lt;p&gt;1) Admin Network Policies (ClusterNetworkPolicy CRD)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cluster-scoped policies applied across namespaces.&lt;/li&gt;
&lt;li&gt;Two tiers:

&lt;ul&gt;
&lt;li&gt;Admin: mandatory controls, cannot be overridden.&lt;/li&gt;
&lt;li&gt;Baseline: defaults that can be overridden by namespace policies.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Use for org-wide guardrails (e.g., block IMDS, force isolation, allow monitoring).&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;2) Application Network Policies (ApplicationNetworkPolicy CRD)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Namespace-scoped, DNS/FQDN-aware egress rules.&lt;/li&gt;
&lt;li&gt;Filter traffic by domain names at L7 (e.g., *.salesforce.com, api.internal.company.com).&lt;/li&gt;
&lt;li&gt;Great for SaaS access and hybrid/on-prem connectivity without tracking changing IPs.&lt;/li&gt;
&lt;li&gt;Available in EKS Auto Mode.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Why this matters&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stable rules: domains don’t change as often as IPs.&lt;/li&gt;
&lt;li&gt;Central control: security teams set guardrails once, developers work safely within them.&lt;/li&gt;
&lt;li&gt;Less toil: fewer IP updates, simpler operations.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  How policy evaluation works (in order):
&lt;/h2&gt;

&lt;p&gt;1) Admin tier ClusterNetworkPolicy&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deny: highest precedence; blocks immediately.&lt;/li&gt;
&lt;li&gt;Allow: accepts and stops evaluation.&lt;/li&gt;
&lt;li&gt;Pass: skips remaining Admin tier, defers to namespace policies.
2) Namespace policies&lt;/li&gt;
&lt;li&gt;ApplicationNetworkPolicy (DNS/FQDN) and traditional NetworkPolicy are evaluated.&lt;/li&gt;
&lt;li&gt;Can further restrict, but cannot override an Admin Deny.
3) Baseline tier ClusterNetworkPolicy&lt;/li&gt;
&lt;li&gt;Defaults that can be overridden by namespace policies.
4) Default deny if nothing matches.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think of it as organization guardrails first, then team-level details, then safe defaults.&lt;/p&gt;




&lt;h2&gt;
  
  
  Requirements and availability
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Kubernetes: 1.29+.&lt;/li&gt;
&lt;li&gt;EKS Auto Mode: supports Admin + DNS/FQDN ApplicationNetworkPolicy.&lt;/li&gt;
&lt;li&gt;EKS on EC2: supports Admin policies via Amazon VPC CNI.

&lt;ul&gt;
&lt;li&gt;Amazon VPC CNI: v1.21.1+.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;DNS-based policies are exclusive to EKS Auto Mode-launched EC2 instances.&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  Quick start
&lt;/h2&gt;

&lt;p&gt;Enable network policy support in the VPC CNI (EC2-based clusters):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Update the VPC CNI add-on (v1.21.1+ recommended).&lt;/li&gt;
&lt;li&gt;Set configuration values to enable network policies.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example (Console → EKS → Add-ons → VPC CNI → Edit → Configuration values):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"enableNetworkPolicy"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"true"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify CNI pods:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get pods &lt;span class="nt"&gt;-n&lt;/span&gt; kube-system | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s1"&gt;'aws-node\|amazon'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ApplicationNetworkPolicy (DNS/FQDN) requires EKS Auto Mode.&lt;/li&gt;
&lt;li&gt;ClusterNetworkPolicy works on both EKS Auto Mode and EC2-based EKS with the VPC CNI requirements above.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Practical examples
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1) Admin: block EC2 Instance Metadata Service (IMDS) for all pods
&lt;/h3&gt;

&lt;p&gt;Mandatory, cluster-wide protection that can't be overridden.&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;networking.k8s.aws/v1alpha1&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;ClusterNetworkPolicy&lt;/span&gt;
&lt;span class="na"&gt;metadata&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;block-instance-metadata-service&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;tier&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Admin&lt;/span&gt;
  &lt;span class="na"&gt;priority&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;
  &lt;span class="na"&gt;subject&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;namespaces&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{}&lt;/span&gt;  &lt;span class="c1"&gt;# all namespaces&lt;/span&gt;
  &lt;span class="na"&gt;egress&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;deny-metadata-service&lt;/span&gt;
      &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deny&lt;/span&gt;
      &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;networks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;cidr&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;169.254.169.254/32"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2) Admin: isolate a sensitive namespace from the rest
&lt;/h3&gt;

&lt;p&gt;Blocks all ingress from other namespaces into a protected namespace.&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;networking.k8s.aws/v1alpha1&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;ClusterNetworkPolicy&lt;/span&gt;
&lt;span class="na"&gt;metadata&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;protect-sensitive-workload&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;tier&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Admin&lt;/span&gt;
  &lt;span class="na"&gt;priority&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20&lt;/span&gt;
  &lt;span class="na"&gt;subject&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;namespaces&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;kubernetes.io/metadata.name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;earth&lt;/span&gt;
  &lt;span class="na"&gt;ingress&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deny&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;select-all-deny-all&lt;/span&gt;
      &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;namespaces&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{}&lt;/span&gt;  &lt;span class="c1"&gt;# match all namespaces&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3) Admin: allow monitoring and DNS egress everywhere
&lt;/h3&gt;

&lt;p&gt;Enforce visibility and reliable DNS resolution cluster-wide.&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;networking.k8s.aws/v1alpha1&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;ClusterNetworkPolicy&lt;/span&gt;
&lt;span class="na"&gt;metadata&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;cluster-wide-allow-monitoring-and-dns&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;tier&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Admin&lt;/span&gt;
  &lt;span class="na"&gt;priority&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;30&lt;/span&gt;
  &lt;span class="na"&gt;subject&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;namespaces&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{}&lt;/span&gt;
  &lt;span class="na"&gt;ingress&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Accept&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;allow-monitoring-ns-ingress&lt;/span&gt;
      &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;namespaces&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;kubernetes.io/metadata.name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;monitoring&lt;/span&gt;
  &lt;span class="na"&gt;egress&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Accept&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;allow-kube-dns-egress&lt;/span&gt;
      &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;pods&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;namespaceSelector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                &lt;span class="na"&gt;kubernetes.io/metadata.name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;kube-system&lt;/span&gt;
            &lt;span class="na"&gt;podSelector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                &lt;span class="na"&gt;k8s-app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;kube-dns&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4) Application (DNS/FQDN): allow a backend to call an on-prem domain
&lt;/h3&gt;

&lt;p&gt;Namespace-scoped, for EKS Auto Mode.&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;networking.k8s.aws/v1alpha1&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;ApplicationNetworkPolicy&lt;/span&gt;
&lt;span class="na"&gt;metadata&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;moon-backend-egress&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;moon&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;podSelector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;backend&lt;/span&gt;
  &lt;span class="na"&gt;policyTypes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Egress&lt;/span&gt;
  &lt;span class="na"&gt;egress&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;allow-onprem-api&lt;/span&gt;
      &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;domainNames&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;myapp.mydomain.com"&lt;/span&gt;
      &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;protocol&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;TCP&lt;/span&gt;
          &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;8080&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5) Application (DNS/FQDN): allow access to AWS services by domain
&lt;/h3&gt;

&lt;p&gt;Great for multi-tenant setups without managing IPs.&lt;/p&gt;

&lt;p&gt;Allow pods labeled security-tier=low to use S3 from the default namespace:&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;networking.k8s.aws/v1alpha1&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;ApplicationNetworkPolicy&lt;/span&gt;
&lt;span class="na"&gt;metadata&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;access-to-s3&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;default&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;podSelector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;security-tier&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;low&lt;/span&gt;
  &lt;span class="na"&gt;policyTypes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Egress&lt;/span&gt;
  &lt;span class="na"&gt;egress&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;allow-access-to-s3&lt;/span&gt;
      &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Accept&lt;/span&gt;
      &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;domainNames&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;*.s3.us-east-1.amazonaws.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Allow one app to reach DynamoDB in another namespace:&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;networking.k8s.aws/v1alpha1&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;ApplicationNetworkPolicy&lt;/span&gt;
&lt;span class="na"&gt;metadata&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;access-to-dynamodb&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;cart-services&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;podSelector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;checkout-service&lt;/span&gt;
  &lt;span class="na"&gt;policyTypes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Egress&lt;/span&gt;
  &lt;span class="na"&gt;egress&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;allow-dynamodb-access&lt;/span&gt;
      &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Accept&lt;/span&gt;
      &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;domainNames&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;*.dynamodb.us-east-1.amazonaws.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Best practices:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Start deny-by-default: Use Admin tier Deny for high-risk destinations; then allow only what’s required.&lt;/li&gt;
&lt;li&gt;Use labels for segmentation: e.g., security-tier=high vs security-tier=low across namespaces.&lt;/li&gt;
&lt;li&gt;Prefer specific domains over wildcards: *.amazonaws.com is convenient but broad; use exact endpoints when possible.&lt;/li&gt;
&lt;li&gt;Layer policies: Combine Admin policies with namespace-level ApplicationNetworkPolicy and traditional NetworkPolicy for defense-in-depth.&lt;/li&gt;
&lt;li&gt;Keep policies small and readable: Short, focused rules are easier to review and audit.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Monitoring, audit, and Route 53 DNS Firewall:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Enable policy decision logging and forward to CloudWatch or your SIEM.&lt;/li&gt;
&lt;li&gt;Audit “denied” flows regularly to catch misconfigurations or suspicious behavior.&lt;/li&gt;
&lt;li&gt;Remember: If EKS policy allows a domain but Route 53 DNS Firewall blocks it, DNS resolution fails and the connection won’t establish. These layers complement each other.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Common gotchas:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;DNS/FQDN policies require EKS Auto Mode; they won’t work on EC2-based clusters without Auto Mode.&lt;/li&gt;
&lt;li&gt;Make sure your VPC and routing allow egress where needed (Transit Gateway, NAT, firewalls).&lt;/li&gt;
&lt;li&gt;Order matters: Admin Deny beats everything; Pass hands control to namespace level; Baseline applies last.&lt;/li&gt;
&lt;li&gt;Validate in staging first: replicate production network/DNS behavior to avoid surprises.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Quick checklist:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Kubernetes 1.29+.&lt;/li&gt;
&lt;li&gt;For EC2-based EKS clusters: VPC CNI v1.21.1+ and enable network policy support.&lt;/li&gt;
&lt;li&gt;For DNS/FQDN egress: use EKS Auto Mode.&lt;/li&gt;
&lt;li&gt;Implement Admin Deny guardrails (e.g., IMDS).&lt;/li&gt;
&lt;li&gt;Add specific ApplicationNetworkPolicy rules for allowed external domains.&lt;/li&gt;
&lt;li&gt;Monitor, audit, and iterate.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Wrap-up:
&lt;/h2&gt;

&lt;p&gt;Amazon EKS now makes it much easier to enforce strong, centralized network security while keeping developer workflows simple:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Admin policies create clear, cluster-wide guardrails.&lt;/li&gt;
&lt;li&gt;Application (DNS/FQDN) policies let teams express intent using domain names instead of IPs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Adopt a deny-by-default stance, allow only what you need, and keep auditing. Your clusters will be safer — with less operational overhead.&lt;/p&gt;

&lt;p&gt;Happy shipping!&lt;/p&gt;

&lt;h2&gt;
  
  
  References ©️
&lt;/h2&gt;

&lt;p&gt;AWS blog: &lt;a href="https://aws.amazon.com/blogs/containers/enhance-amazon-eks-network-security-posture-with-dns-and-admin-network-policies/" rel="noopener noreferrer"&gt;https://aws.amazon.com/blogs/containers/enhance-amazon-eks-network-security-posture-with-dns-and-admin-network-policies/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thank You 🖤&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;Until next time, keep innovating and securing your cloud journey!&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Thank you for reading!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Until next time, つづく 🎉&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🙌🏻😁📃 see you in the next blog.🤘  &lt;strong&gt;&lt;em&gt;Until next time 🎉&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;🚀 Thank you for sticking up till the end. If you have any questions/feedback regarding this blog feel free to connect with me:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;♻️ LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/rajhi-saif/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/rajhi-saif/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;♻️ X/Twitter:&lt;/strong&gt; &lt;a href="https://x.com/rajhisaifeddine" rel="noopener noreferrer"&gt;https://x.com/rajhisaifeddine&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The end ✌🏻&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;🔰 Keep Learning !! Keep Sharing !! 🔰&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;📅 Stay updated&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Subscribe &lt;a href="https://seifrajhi.github.io/" rel="noopener noreferrer"&gt;to our newsletter&lt;/a&gt; for more insights on AWS cloud computing and containers.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>eks</category>
      <category>kubernetes</category>
      <category>networking</category>
    </item>
    <item>
      <title>Native Amazon EKS Backups with AWS Backup</title>
      <dc:creator>saifeddine Rajhi</dc:creator>
      <pubDate>Mon, 29 Dec 2025 06:30:20 +0000</pubDate>
      <link>https://dev.to/aws-builders/native-amazon-eks-backups-with-aws-backup-2kkd</link>
      <guid>https://dev.to/aws-builders/native-amazon-eks-backups-with-aws-backup-2kkd</guid>
      <description>&lt;p&gt;TL;DR: &lt;a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/whatisbackup.html" rel="noopener noreferrer"&gt;AWS Backup&lt;/a&gt; now protects &lt;a href="https://docs.aws.amazon.com/eks/latest/userguide/what-is-eks.html" rel="noopener noreferrer"&gt;Amazon EKS&lt;/a&gt;. It backs up your cluster state and persistent data (EBS, EFS, S3) using one policy-driven workflow. You can restore a full cluster, a namespace, or specific volumes even into a brand-new EKS cluster.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/about-aws/whats-new/2025/11/aws-backup-supports-amazon-eks/" rel="noopener noreferrer"&gt;It’s been available since Nov 2025&lt;/a&gt;, and it’s now a dependable option for production teams.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters:
&lt;/h2&gt;

&lt;p&gt;Before this, many teams used scripts or tools like &lt;a href="https://velero.io/" rel="noopener noreferrer"&gt;Velero&lt;/a&gt; to back up Kubernetes. It worked, but it was hard to run at scale.&lt;/p&gt;

&lt;p&gt;Now you get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One place to manage backups for EKS and other AWS services.&lt;/li&gt;
&lt;li&gt;Policy-based schedules, retention, encryption, and immutability.&lt;/li&gt;
&lt;li&gt;A single “composite” recovery point that keeps cluster state and data in sync.&lt;/li&gt;
&lt;li&gt;Stress-free restores, including creating a new EKS cluster during restore.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What AWS Backup protects in EKS:
&lt;/h2&gt;

&lt;p&gt;AWS Backup creates a composite recovery point(cluster state + persistent storage «EBS, EFS, S3» as a single, consistent recovery point) with child recovery points:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cluster state (full backup)

&lt;ul&gt;
&lt;li&gt;Examples: cluster name and settings, IAM role, VPC and network settings, logging, encryption, add-ons, access entries, managed node groups, Fargate profiles, pod identity associations, Kubernetes manifests.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Persistent storage (incremental where supported)

&lt;ul&gt;
&lt;li&gt;Amazon EBS, Amazon EFS, Amazon S3 buckets (bucket-level snapshot backups)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is not included:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Container images in external registries (ECR, Docker, etc.)&lt;/li&gt;
&lt;li&gt;Infrastructure like VPCs and subnets&lt;/li&gt;
&lt;li&gt;Auto-generated runtime objects like nodes, auto-generated pods, events, leases, jobs&lt;/li&gt;
&lt;li&gt;Some CSI/ACK plugin scenarios (see Limits below)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to enable and create a backup (Console):
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open AWS Backup → Settings → Configure resources → opt in to Amazon EKS.&lt;/li&gt;
&lt;li&gt;Go to Protected resources → Create on-demand backup.&lt;/li&gt;
&lt;li&gt;Choose Resource type: Amazon EKS → select your cluster.&lt;/li&gt;
&lt;li&gt;Choose an IAM role with:

&lt;ul&gt;
&lt;li&gt;AWSBackupServiceRolePolicyForBackup&lt;/li&gt;
&lt;li&gt;AWSBackupServiceRolePolicyForRestores&lt;/li&gt;
&lt;li&gt;If your cluster uses S3: also add AWSBackupServiceRolePolicyForS3Backup&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Configure window, retention, and (optionally) lifecycle to cold storage for supported child recovery points.&lt;/li&gt;
&lt;li&gt;Create the on-demand backup.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Tip: Set EKS Cluster authorization mode to &lt;code&gt;API&lt;/code&gt; or &lt;code&gt;API_AND_CONFIG_MAP&lt;/code&gt; so AWS Backup can create Access Entries.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding recovery points and status:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Composite recovery point (parent): the EKS backup as a whole.&lt;/li&gt;
&lt;li&gt;Child recovery points: cluster state and each persistent store.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Statuses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Completed: everything finished; the cluster is protected.&lt;/li&gt;
&lt;li&gt;Partial: some parts completed, others failed. You can re-run failed parts and still restore the successful ones.&lt;/li&gt;
&lt;li&gt;Failed: the job did not complete; fix the issue and try again.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Restore options (Console):
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;In Protected resources, pick your EKS composite recovery point → Restore.&lt;/li&gt;
&lt;li&gt;Scope:

&lt;ul&gt;
&lt;li&gt;Full cluster&lt;/li&gt;
&lt;li&gt;Namespace (only to an existing cluster)&lt;/li&gt;
&lt;li&gt;Individual persistent volumes&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Destination:

&lt;ul&gt;
&lt;li&gt;Existing cluster (non-destructive; only the delta is applied)&lt;/li&gt;
&lt;li&gt;Original cluster&lt;/li&gt;
&lt;li&gt;New cluster (AWS Backup can provision it during restore)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Choose IAM role for restore. Review settings → Restore.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can monitor child recovery points during restore. If some parts fail, you can restore the successful ones (for example, EBS volumes) separately.&lt;/p&gt;

&lt;h2&gt;
  
  
  Copying, vaults, and immutability:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;You can copy composite recovery points across Regions/accounts (where supported).&lt;/li&gt;
&lt;li&gt;Use backup vaults for organization, access control, and immutability.&lt;/li&gt;
&lt;li&gt;Child recovery points for persistent storage support lifecycle transitions to cold storage.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Limits to know:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Persistent volumes using CSI migration, in-tree storage plugins, or ACK controllers are not supported.&lt;/li&gt;
&lt;li&gt;S3 backups: only bucket-level snapshots are supported (no prefix-level backup via CSI mount points).&lt;/li&gt;
&lt;li&gt;FSx via CSI driver: not supported.&lt;/li&gt;
&lt;li&gt;EKS on AWS Outposts: not supported.&lt;/li&gt;
&lt;li&gt;Subject to backup/restore quotas. Check the AWS Backup feature matrix for details.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Best practices:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Set EKS authorization mode to &lt;code&gt;API&lt;/code&gt; or &lt;code&gt;API_AND_CONFIG_MAP&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Use managed policies:

&lt;ul&gt;
&lt;li&gt;AWSBackupServiceRolePolicyForBackup&lt;/li&gt;
&lt;li&gt;AWSBackupServiceRolePolicyForRestores&lt;/li&gt;
&lt;li&gt;If S3 is involved: AWSBackupServiceRolePolicyForS3Backup&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Choose the right KMS key per backup vault and confirm encryption behavior for each storage type.&lt;/li&gt;

&lt;li&gt;Prefer backup plans (scheduled, policy-driven) over ad-hoc jobs.&lt;/li&gt;

&lt;li&gt;Test restores often (including restoring into a new cluster).&lt;/li&gt;

&lt;li&gt;Continue GitOps for config management—backups are your safety net, not a replacement.&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Quick-start checklist:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt; Opt in to EKS in AWS Backup Settings.&lt;/li&gt;
&lt;li&gt; Attach the correct IAM policies to your backup/restore role.&lt;/li&gt;
&lt;li&gt; Confirm EKS auth mode is &lt;code&gt;API&lt;/code&gt; or &lt;code&gt;API_AND_CONFIG_MAP&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt; Create an on-demand backup to validate end-to-end.&lt;/li&gt;
&lt;li&gt; Set a backup plan (e.g., every 6 hours, retain 30 days).&lt;/li&gt;
&lt;li&gt;[✔️] Test a full-cluster restore and a namespace-only restore.&lt;/li&gt;
&lt;li&gt;[✔️] Review costs and lifecycle/cold storage options.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Costs
&lt;/h2&gt;

&lt;p&gt;Expect charges for snapshots, storage, cross-Region/account copies, and retention. Persistent data size (EBS/EFS/S3) and frequency drive most costs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;This feature turns EKS backup from homegrown scripts into managed reliability. With composite recovery points, clear policies, and flexible restore targets, teams get predictable protection with less operational effort. For production EKS, it’s a practical way to reduce risk during upgrades, incidents, and day‑to‑day changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  References ©️
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;AWS Backup: &lt;a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/whatisbackup.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/aws-backup/latest/devguide/whatisbackup.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Amazon EKS: &lt;a href="https://docs.aws.amazon.com/eks/latest/userguide/what-is-eks.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/eks/latest/userguide/what-is-eks.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;EKS + AWS Backup: &lt;a href="https://docs.aws.amazon.com/eks/latest/userguide/integration-backup.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/eks/latest/userguide/integration-backup.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;AWS Blog: &lt;a href="https://aws.amazon.com/blogs/aws/secure-eks-clusters-with-the-new-support-for-amazon-eks-in-aws-backup/" rel="noopener noreferrer"&gt;https://aws.amazon.com/blogs/aws/secure-eks-clusters-with-the-new-support-for-amazon-eks-in-aws-backup/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Shittu Sulaimon (Barry)'s blog: &lt;a href="https://dev.to/sadebare/eks-disaster-recovery-simplified-native-backups-with-aws-backup-15g4"&gt;https://dev.to/sadebare/eks-disaster-recovery-simplified-native-backups-with-aws-backup-15g4&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Thank You 🖤&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;Until next time, keep innovating and securing your cloud journey!&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Thank you for reading!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Until next time, つづく 🎉&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🙌🏻😁📃 see you in the next blog.🤘  &lt;strong&gt;&lt;em&gt;Until next time 🎉&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;🚀 Thank you for sticking up till the end. If you have any questions/feedback regarding this blog feel free to connect with me:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;♻️ LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/rajhi-saif/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/rajhi-saif/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;♻️ X/Twitter:&lt;/strong&gt; &lt;a href="https://x.com/rajhisaifeddine" rel="noopener noreferrer"&gt;https://x.com/rajhisaifeddine&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The end ✌🏻&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;🔰 Keep Learning !! Keep Sharing !! 🔰&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;📅 Stay updated&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Subscribe &lt;a href="https://seifrajhi.github.io/" rel="noopener noreferrer"&gt;to our newsletter&lt;/a&gt; for more insights on AWS cloud computing and containers.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>eks</category>
      <category>backup</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>Introducing the AWS EKS best practices Mindmap</title>
      <dc:creator>saifeddine Rajhi</dc:creator>
      <pubDate>Sun, 05 Oct 2025 19:12:02 +0000</pubDate>
      <link>https://dev.to/aws-builders/introducing-the-aws-eks-best-practices-mindmap-30lc</link>
      <guid>https://dev.to/aws-builders/introducing-the-aws-eks-best-practices-mindmap-30lc</guid>
      <description>&lt;p&gt;&lt;strong&gt;A Visual guide to secure, scalable, and cost-optimized Kubernetes on AWS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;/b&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%2Fq50cik1wv4q29s1ezgim.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%2Fq50cik1wv4q29s1ezgim.png" alt="first photo" width="755" height="331"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Managing Kubernetes on AWS can be complex, but with the right practices, it becomes an excellent platform to run and deploy modern applications. Inspired by &lt;a href="https://www.linkedin.com/in/wquiles/" rel="noopener noreferrer"&gt;William Quiles’&lt;/a&gt; renowned &lt;a href="https://xmind.app/m/JCsbtb/" rel="noopener noreferrer"&gt;security mindmaps&lt;/a&gt;, I’ve created an &lt;a href="https://xmind.ai/share/CAIBy9XB" rel="noopener noreferrer"&gt;&lt;strong&gt;AWS EKS Best Practices Mindmap&lt;/strong&gt;&lt;/a&gt; that brings together the most useful strategies for security, scalability, networking, and cost optimization—all in one visual guide.&lt;/p&gt;

&lt;p&gt;This &lt;a href="https://en.wikipedia.org/wiki/List_of_concept-_and_mind-mapping_software" rel="noopener noreferrer"&gt;mindmap&lt;/a&gt; is designed to help engineers, architects, and platform teams &lt;em&gt;simplify EKS operations&lt;/em&gt; while maintaining security, reliability, and efficiency.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;AWS EKS best practices mindmap overview&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://xmind.ai/share/CAIBy9XB" rel="noopener noreferrer"&gt;The mindmap&lt;/a&gt; covers the following key areas:&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1. Security &amp;amp; compliance&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Protecting your EKS clusters is a must. This section focuses on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Risk assessment &amp;amp; mitigation:&lt;/strong&gt; Identify and reduce risks without compromising business value.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IAM &amp;amp; RBAC best practices:&lt;/strong&gt; Control access at every level.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data protection:&lt;/strong&gt; Encrypt data in transit and at rest.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Continuous monitoring:&lt;/strong&gt; Use AWS-native tools like GuardDuty and Security Hub.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;2. Reliability&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Reliability ensures your applications run smoothly. Best practices include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Applications:&lt;/strong&gt; Design for resilience and fault tolerance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Control plane:&lt;/strong&gt; Leverage AWS-managed control plane for stability.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data plane:&lt;/strong&gt; Keep worker nodes updated and healthy.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;3. Cluster autoscaling&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Scaling is key to cost and performance optimization. The mindmap highlights three approaches:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Karpenter:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
An open-source tool that automates node provisioning and deprovisioning based on pod requirements. It supports flexible instance types and advanced scheduling constraints.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cluster Autoscaler:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A Kubernetes-native solution that adjusts node counts by monitoring unschedulable pods and underutilized nodes. Integrated with AWS Auto Scaling Groups.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;EKS Auto mode:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A fully managed scaling solution by AWS. It provisions nodes automatically using Bottlerocket AMIs and integrates load balancer controllers, pod identity, and security features—reducing operational overhead.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;4. Networking&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Understanding Kubernetes networking is essential for cluster efficiency:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pod networking:&lt;/strong&gt; EKS uses the &lt;strong&gt;VPC CNI plugin&lt;/strong&gt; for native AWS VPC integration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Underlay mode:&lt;/strong&gt; Pods and nodes share the same network layer for consistent IP addressing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configurable options:&lt;/strong&gt; VPC CNI supports multiple operating modes and advanced configurations for scalability and security.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;5. Scalability&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Maximize the work a single EKS cluster can handle:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;strong&gt;one large cluster&lt;/strong&gt; for reduced operational overhead (with trade-offs for multi-region and isolation).&lt;/li&gt;
&lt;li&gt;Optimize resource allocation and scheduling for high performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;6. Cluster upgrades&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Keep your clusters up-to-date:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Control Plane:&lt;/strong&gt; AWS manages upgrades, but you initiate them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Plane:&lt;/strong&gt; Upgrade worker nodes (self-managed, managed node groups, Karpenter, or Fargate) to match the control plane version.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;7. Cost optimization&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Achieve business goals at the lowest cost:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Right-sizing:&lt;/strong&gt; Monitor CPU and memory usage with CloudWatch Container Insights.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flexible purchasing:&lt;/strong&gt; Use On-Demand, Spot, and Savings Plans.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Continuous optimization:&lt;/strong&gt; Regularly review workloads for efficiency.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;8. Specialized workloads&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Windows containers:&lt;/strong&gt; Secure and optimize Windows-based workloads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hybrid deployments:&lt;/strong&gt; Extend EKS to on-premises or edge environments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI/ML workloads:&lt;/strong&gt; Ensure performance and cost-efficiency for ML pipelines.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Practical benefits&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Enhanced security:&lt;/strong&gt; Strong IAM, encryption, and monitoring.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Operational efficiency:&lt;/strong&gt; Automation reduces manual effort.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost savings:&lt;/strong&gt; Intelligent scaling and resource optimization.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;AWS EKS Best Practices Mindmap&lt;/strong&gt; is your go-to visual guide for building secure, scalable, and cost-effective Kubernetes environments on AWS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thank You 🖤&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;Until next time, keep innovating and securing your cloud journey!&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Thank you for reading!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Until next time, つづく 🎉&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🙌🏻😁📃 see you in the next blog.🤘  &lt;strong&gt;&lt;em&gt;Until next time 🎉&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;🚀 Thank you for sticking up till the end. If you have any questions/feedback regarding this blog feel free to connect with me:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;♻️ LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/rajhi-saif/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/rajhi-saif/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;♻️ X/Twitter:&lt;/strong&gt; &lt;a href="https://x.com/rajhisaifeddine" rel="noopener noreferrer"&gt;https://x.com/rajhisaifeddine&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The end ✌🏻&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;🔰 Keep Learning !! Keep Sharing !! 🔰&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;📅 Stay updated&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Subscribe &lt;a href="https://seifrajhi.github.io/" rel="noopener noreferrer"&gt;to our newsletter&lt;/a&gt; for more insights on AWS cloud computing and containers.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>aws</category>
      <category>eks</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>EKS'pert Automation: Amazon EKS Auto Mode and Karpenter in action</title>
      <dc:creator>saifeddine Rajhi</dc:creator>
      <pubDate>Mon, 20 Jan 2025 08:34:48 +0000</pubDate>
      <link>https://dev.to/aws-builders/ekspert-automation-amazon-eks-auto-mode-and-karpenter-in-action-32mg</link>
      <guid>https://dev.to/aws-builders/ekspert-automation-amazon-eks-auto-mode-and-karpenter-in-action-32mg</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Automate your Amazon EKS journey with Auto Mode and Karpenter in Action&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  🚀 Introduction
&lt;/h2&gt;

&lt;p&gt;In the quest for seamless Kubernetes management, automation is key.&lt;/p&gt;

&lt;p&gt;This blog explores how &lt;a href="https://karpenter.sh/" rel="noopener noreferrer"&gt;Karpenter&lt;/a&gt; and &lt;a href="https://docs.aws.amazon.com/eks/latest/userguide/automode.html" rel="noopener noreferrer"&gt;EKS Auto Mode&lt;/a&gt; transform Amazon Kubernetes cluster management.&lt;/p&gt;

&lt;p&gt;By overcoming the limitations of traditional scaling tools, optimizing resource usage, and automating infrastructure provisioning and updates, these tools ensure your clusters are efficient and cost-effective.&lt;/p&gt;

&lt;p&gt;EKS Auto Mode further enhances deployment by managing compute, networking, and storage, dynamically scaling resources based on application needs, and maintaining security through automatic updates and health monitoring.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction to Amazon EKS and Karpenter
&lt;/h2&gt;

&lt;p&gt;Amazon Elastic Kubernetes Service EKS simplifies the deployment and management of Kubernetes (k8s) clusters.&lt;/p&gt;

&lt;p&gt;Kubernetes is a well-known container orchestration platform, but managing its control plane can be complex and resource-intensive.&lt;/p&gt;

&lt;p&gt;EKS provides a managed control plane, ensuring scalability, high availability, and security.&lt;/p&gt;

&lt;h3&gt;
  
  
  Scaling Applications with Traditional Tools
&lt;/h3&gt;

&lt;p&gt;Traditional tools like Cluster Autoscaler have several challenges:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Node Groups Management&lt;/strong&gt;: Requires creating and managing multiple node groups.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instance Family Specification&lt;/strong&gt;: Users must specify instance families and their priorities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Autoscaling Groups&lt;/strong&gt;: Each node group needs a separate autoscaling group, complicating management.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AMI Selection and Refresh&lt;/strong&gt;: Managing AMI (Amazon Machine Image) selection and updates can be cumbersome.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Karpenter: A Modern Solution for Scaling
&lt;/h3&gt;

&lt;p&gt;Karpenter is a Kubernetes-native autoscaler designed to overcome these limitations. It interacts directly with EC2 Fleet, bypassing the need for node groups and autoscaling groups, resulting in faster and more efficient instance provisioning. Karpenter uses YAML files (NodePool and EC2NodeClass) to manage its behavior, offering flexibility and control.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Insights
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;🔍 What is Karpenter?&lt;/strong&gt;&lt;br&gt;
Karpenter automatically adds or removes servers (nodes) in a Kubernetes cluster, adjusting resources dynamically to match workloads.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;⚖️ Karpenter vs. Cluster Autoscaler&lt;/strong&gt;&lt;br&gt;
Karpenter communicates directly with cloud providers (like AWS EC2) and can add new resources in seconds instead of minutes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;📊 Choosing the Right Resources Automatically&lt;/strong&gt;&lt;br&gt;
Karpenter selects the best type of server based on application needs (CPU, memory, etc.), simplifying setup and saving time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;🔄 Save Money with Resource Consolidation&lt;/strong&gt;&lt;br&gt;
Karpenter combines workloads on fewer servers, moving workloads around and shutting down idle servers to reduce costs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;⚙️ Works with Kubernetes Scheduling&lt;/strong&gt;&lt;br&gt;
Karpenter integrates seamlessly with Kubernetes, respecting all scheduling rules and supporting specialized applications.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;💡 Supports All Types of Workloads&lt;/strong&gt;&lt;br&gt;
Karpenter handles high-performance servers, GPUs, specific configurations, and works across different environments, including multi-cloud setups.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;📚 Easy to Learn and Use&lt;/strong&gt;&lt;br&gt;
This guide covers everything from understanding scaling to implementing Karpenter in real-world scenarios.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Key Features of Karpenter
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://karpenter.sh/v1.1/concepts/nodepools/" rel="noopener noreferrer"&gt;NodePool YAML&lt;/a&gt;: Specify instance families, availability zones, architecture types (x86 or ARM), and capacity types (spot and on-demand).&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://karpenter.sh/v1.1/concepts/scheduling/" rel="noopener noreferrer"&gt;Scheduling Constraints&lt;/a&gt;: Supports node selectors, node affinity, taints and tolerations, and topology spread.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User-Defined Labels&lt;/strong&gt;: Enables custom labels, taints, and annotations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost Optimization&lt;/strong&gt;: Automatically consolidates underutilized nodes.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://karpenter.sh/docs/concepts/disruption/#disruption-budgets" rel="noopener noreferrer"&gt;Disruption Budget&lt;/a&gt;: Controls when nodes can be disrupted, with configurable policies.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://karpenter.sh/docs/concepts/disruption/#drift" rel="noopener noreferrer"&gt;Drift Management&lt;/a&gt;: Ensures the desired state matches the current state by reconciling node configurations.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://karpenter.sh/v1.1/concepts/nodeclasses/" rel="noopener noreferrer"&gt;EC2NodeClass&lt;/a&gt;: Manages AMI selection, subnets, security groups, and other configurations.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Advanced AMI Management
&lt;/h3&gt;

&lt;p&gt;Karpenter supports using Amazon EKS optimized AMIs, including BottleRocket and Amazon Linux 2. Users can pin worker nodes to specific AMI versions for testing before rolling out updates. Custom AMIs are also supported, allowing selection by tag, name, owner, or ID. If multiple AMIs match the criteria, Karpenter uses the latest one.&lt;/p&gt;

&lt;h3&gt;
  
  
  New Features in Karpenter v1
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Enhanced Disruption Controls by Reason&lt;/strong&gt;&lt;br&gt;
Specify disruption budgets based on reasons like Underutilized, Empty, or Drifted.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Forceful Disruption Mode&lt;/strong&gt;&lt;br&gt;
Balance application availability against security requirements with assertive node lifecycle management.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Expanded consolidateAfter Functionality&lt;/strong&gt;&lt;br&gt;
Define how long Karpenter should wait before consolidating underutilized nodes.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Challenges and Solutions Beyond Karpenter
&lt;/h3&gt;

&lt;p&gt;While Karpenter addresses many scaling challenges, managing core cluster capabilities like networking, service discovery, and load balancing remains complex. Upgrading and securing Kubernetes clusters also require dedicated expertise and continuous time investment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction to Amazon EKS Auto Mode
&lt;/h2&gt;

&lt;p&gt;Amazon EKS Auto Mode offloads more operational responsibilities to AWS, extending AWS's responsibility from the control plane to the data plane, including compute, networking, and storage.&lt;/p&gt;

&lt;p&gt;EKS Auto Mode dynamically scales compute resources based on application needs, optimizes costs through dynamic scaling and capacity planning, and automatically updates worker nodes and applies security fixes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Benefits of EKS Auto Mode
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Simplified Deployment&lt;/strong&gt;: Reduces the steps needed to deploy applications by automating infrastructure provisioning and management.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Managed Core Capabilities&lt;/strong&gt;: Provides managed compute, network, and storage capabilities out of the box.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Health Monitoring and Auto Repair&lt;/strong&gt;: Includes health monitoring and auto-repair features.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Networking Enhancements&lt;/strong&gt;: Simplifies networking with managed VPC CNI, network policies, and in-cluster service load balancing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shared Responsibility Model&lt;/strong&gt;: Shifts more responsibility to AWS, allowing customers to focus on application innovation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Getting Started with EKS Auto Mode
&lt;/h3&gt;

&lt;p&gt;EKS Auto Mode simplifies cluster creation with a single-click setup and built-in best practices.&lt;/p&gt;

&lt;p&gt;It provides two default node pools (general purpose and system) supporting a mix of instance types and architectures (Graviton and x86). Users can also define custom node pools for specific use cases like GPU instances, spot instances, and tenant isolation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Features of EKS Auto Mode:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;General Purpose Node Pool&lt;/strong&gt;: Supports a mix of on-demand instance types, consolidation enabled by default, and a default node expiry of 14 days.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;System Node Pool&lt;/strong&gt;: Dedicated for critical add-ons, supports both AMD and ARM architectures, and includes a special taint to prevent scheduling regular workloads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User-Defined Node Pools&lt;/strong&gt;: Allows customization for specific use cases, such as GPU instances, spot instances, and tenant isolation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;EKSNodeClass&lt;/strong&gt;: Manages security groups and subnets without requiring AMI selectors, as AWS handles the lifecycle of EC2 instances.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Day Two Operations and Updates
&lt;/h3&gt;

&lt;p&gt;EKS Auto Mode handles updates for core capabilities and data plane nodes, respecting disruption budgets and ensuring minimal impact on running applications. Security updates are automatically applied, and worker nodes are updated in a rolling deployment fashion.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Automatic Updates:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Core Capabilities&lt;/strong&gt;: Automatically updates core capabilities like Karpenter, storage controllers, and network controllers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Plane Nodes&lt;/strong&gt;: Worker nodes are updated to the latest AMI versions, respecting disruption budgets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security Updates&lt;/strong&gt;: Security patches are applied automatically, ensuring a secure environment.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Amazon EKS, Karpenter, and EKS Auto Mode collectively enhance Kubernetes cluster management by simplifying scaling, optimizing costs, and automating infrastructure provisioning and updates. These tools provide robust solutions for modern cloud-based applications, allowing users to focus on innovation while AWS handles the operational complexities.&lt;/p&gt;

&lt;p&gt;This comprehensive approach ensures efficient, secure, and cost-effective Kubernetes cluster management, making it easier for users to deploy and manage their applications at scale.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thank You 🖤&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Until next time, つづく 🎉&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Thank you for Reading !! 🙌🏻😁📃, see you in the next blog.🤘  &lt;strong&gt;&lt;em&gt;Until next time 🎉&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;🚀 Thank you for sticking up till the end. If you have any questions/feedback regarding this blog feel free to connect with me:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;♻️ LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/rajhi-saif/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/rajhi-saif/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;♻️ X/Twitter:&lt;/strong&gt; &lt;a href="https://x.com/rajhisaifeddine" rel="noopener noreferrer"&gt;https://x.com/rajhisaifeddine&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The end ✌🏻&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;🔰 Keep Learning !! Keep Sharing !! 🔰&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;📅 Stay updated&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Subscribe &lt;a href="https://seifrajhi.github.io/" rel="noopener noreferrer"&gt;to our newsletter&lt;/a&gt; for more insights on AWS cloud computing and containers.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>eks</category>
      <category>aws</category>
      <category>devops</category>
    </item>
    <item>
      <title>Node Health Monitoring and Auto-Repair for Amazon EKS</title>
      <dc:creator>saifeddine Rajhi</dc:creator>
      <pubDate>Mon, 23 Dec 2024 07:21:25 +0000</pubDate>
      <link>https://dev.to/aws-builders/node-health-monitoring-and-auto-repair-for-amazon-eks-3eja</link>
      <guid>https://dev.to/aws-builders/node-health-monitoring-and-auto-repair-for-amazon-eks-3eja</guid>
      <description>&lt;h2&gt;
  
  
  ⚡ Introduction
&lt;/h2&gt;

&lt;p&gt;Amazon Elastic Kubernetes Service (Amazon EKS) continues to innovate beyond re:Invent with &lt;a href="https://aws.amazon.com/about-aws/whats-new/2024/12/node-health-monitoring-auto-repair-amazon-eks/" rel="noopener noreferrer"&gt;the introduction of Node Health Monitoring and Auto-Repair&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This groundbreaking feature is designed to automatically monitor and repair EC2 instances (nodes) in your Kubernetes clusters, ensuring your infrastructure remains at peak performance.&lt;/p&gt;

&lt;p&gt;This is particularly beneficial for workloads using accelerated instances for machine learning.&lt;/p&gt;

&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;Managing the health of nodes in a Kubernetes cluster can be a daunting task, often requiring significant operational effort to ensure resilience and performance. Amazon EKS now simplifies this process with Node Health Monitoring and Auto-Repair, which continuously monitors the health of nodes and takes automatic corrective actions when issues are detected.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Features
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Node Monitoring Agent
&lt;/h3&gt;

&lt;p&gt;The Node Monitoring Agent is a powerful tool that continuously reads node logs to detect a variety of health issues specific to Kubernetes environments. This agent identifies problems such as storage and networking issues and applies dedicated NodeConditions to worker nodes. These conditions are then surfaced in the observability dashboard, providing detailed insights into the health of your nodes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Automatic Detection&lt;/strong&gt;: The agent parses node logs to detect failures and surface status information.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NodeConditions&lt;/strong&gt;: Specific conditions are applied for detected issues, such as KernelReady, NetworkingReady, and StorageReady.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Observability Dashboard&lt;/strong&gt;: Detailed descriptions of detected health issues are available for monitoring.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Node Auto Repair
&lt;/h3&gt;

&lt;p&gt;Node Auto Repair works in tandem with the Node Monitoring Agent to ensure that any detected issues are promptly addressed, thereby maintaining the overall health and availability of your cluster.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Continuous Monitoring&lt;/strong&gt;: The feature continuously monitors node health and reacts to detected problems.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automatic Replacement&lt;/strong&gt;: Nodes with issues are automatically cordoned and replaced to maintain cluster health.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enhanced Reliability&lt;/strong&gt;: Addresses intermittent node issues, such as unresponsive kubelets and increased device errors.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;p&gt;When the Node Monitoring Agent detects a health issue, it applies a specific NodeCondition to the affected node. If Node Auto Repair is enabled, it will automatically take corrective actions based on the type of issue detected. For example, if a node is experiencing networking issues, it may be cordoned and replaced to prevent disruption to your workloads.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enabling Node Health Monitoring and Auto-Repair
&lt;/h2&gt;

&lt;p&gt;To enable these features, you need to install the EKS node monitoring agent add-on and enable node auto-repair in the EKS managed node group APIs or AWS Console. EKS Auto Mode comes with both features enabled by default.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AWS Console&lt;/strong&gt;: Activate the "Enable node auto repair" checkbox for the managed node group.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AWS CLI&lt;/strong&gt;: Use the &lt;code&gt;--node-repair-config enabled=true&lt;/code&gt; option with the &lt;code&gt;eks create nodegroup&lt;/code&gt; or &lt;code&gt;eks update-nodegroup-config&lt;/code&gt; command.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Availability
&lt;/h2&gt;

&lt;p&gt;Node Health Monitoring and Auto-Repair is available at no additional cost in all AWS Regions, except AWS GovCloud (US) and China Regions. This ensures that you can leverage these powerful features to maintain the health of your Kubernetes clusters without incurring extra costs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Improved Cluster Availability
&lt;/h3&gt;

&lt;p&gt;By automatically detecting and addressing node health issues, these features help ensure that your Kubernetes clusters remain highly available. This is particularly important for applications that require high availability and minimal downtime.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reduced Operational Overhead
&lt;/h3&gt;

&lt;p&gt;Managing node health manually can be time-consuming and complex. With Node Health Monitoring and Auto-Repair, much of this work is automated, freeing up your team to focus on other critical tasks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enhanced Performance for Machine Learning Workloads
&lt;/h3&gt;

&lt;p&gt;For workloads that use accelerated instances, such as those for machine learning, maintaining node health is crucial. These features help ensure that your nodes are always in optimal condition, which is essential for performance-intensive applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Detailed Node Health Issues
&lt;/h2&gt;

&lt;p&gt;The Node Monitoring Agent can detect a wide range of health issues, categorized into conditions and events. Conditions are terminal issues that warrant remediation actions like instance replacement or reboot, while events are temporary issues or sub-optimal configurations that do not trigger auto-repair actions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Kernel Node Health Issues
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ForkFailedOutOfPID&lt;/strong&gt;: A fork or exec call has failed due to the system being out of process IDs or memory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AppBlocked&lt;/strong&gt;: A task has been blocked for a long period, usually due to input/output blocking.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AppCrash&lt;/strong&gt;: An application on the node has crashed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ApproachingKernelPidMax&lt;/strong&gt;: The number of processes is nearing the maximum allowed by the kernel.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ConntrackExceededKernel&lt;/strong&gt;: Connection tracking exceeded the maximum for the kernel, leading to packet loss.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Networking Node Health Issues
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;InterfaceNotRunning&lt;/strong&gt;: The network interface is not running or there are network issues.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IPAMDNotReady&lt;/strong&gt;: IPAMD fails to connect to the API server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;BandwidthInExceeded&lt;/strong&gt;: Inbound bandwidth exceeded the maximum for the instance, causing packet loss.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ConntrackExceeded&lt;/strong&gt;: Connection tracking exceeded the maximum for the instance, leading to packet loss.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  NVIDIA Node Health Issues
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;NvidiaDoubleBitError&lt;/strong&gt;: A double bit error was produced by the GPU driver, requiring node replacement.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NvidiaXID13Error&lt;/strong&gt;: A graphics engine exception, requiring node reboot.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NvidiaXID79Error&lt;/strong&gt;: The GPU driver found the GPU inaccessible over PCI Express, requiring node replacement.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The introduction of Node Health Monitoring and Auto-Repair for Amazon EKS is a significant advancement in maintaining the health and performance of your Kubernetes clusters. By automating the detection and remediation of node health issues, these features help ensure that your clusters remain resilient and operational with minimal manual intervention.&lt;/p&gt;

&lt;p&gt;For more information, visit the Amazon EKS documentation.&lt;/p&gt;



&lt;blockquote&gt;
&lt;p&gt;💡 Thank you for Reading !! 🙌🏻😁📃, see you in the next blog.🤘  &lt;strong&gt;&lt;em&gt;Until next time 🎉&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;🚀 Thank you for sticking up till the end. If you have any questions/feedback regarding this blog feel free to connect with me:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;♻️ LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/rajhi-saif/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/rajhi-saif/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;♻️ X/Twitter:&lt;/strong&gt; &lt;a href="https://x.com/rajhisaifeddine" rel="noopener noreferrer"&gt;https://x.com/rajhisaifeddine&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The end ✌🏻&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;🔰 Keep Learning !! Keep Sharing !! 🔰&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;📻🧡 Resources&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/eks/latest/userguide/eks-node-health.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/eks/latest/userguide/eks-node-health.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/about-aws/whats-new/2024/12/node-health-monitoring-auto-repair-amazon-eks/" rel="noopener noreferrer"&gt;https://aws.amazon.com/about-aws/whats-new/2024/12/node-health-monitoring-auto-repair-amazon-eks/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;📅 Stay updated&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Subscribe to &lt;a href="https://seifrajhi.github.io/" rel="noopener noreferrer"&gt;our newsletter&lt;/a&gt; for more insights on AWS cloud computing and containers.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>AWS Skill Builder: Build Cloud Skills with Amazon Web Services</title>
      <dc:creator>saifeddine Rajhi</dc:creator>
      <pubDate>Mon, 16 Dec 2024 07:39:37 +0000</pubDate>
      <link>https://dev.to/seifrajhi/aws-skill-builder-build-cloud-skills-with-amazon-web-services-1a70</link>
      <guid>https://dev.to/seifrajhi/aws-skill-builder-build-cloud-skills-with-amazon-web-services-1a70</guid>
      <description>&lt;h2&gt;
  
  
  Overview of AWS Skill Builder
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://skillbuilder.aws/" rel="noopener noreferrer"&gt;AWS Skill Builder&lt;/a&gt; is an online learning center designed to help individuals and organizations build in-demand cloud skills. It offers a wide range of training resources, including over 600 free courses, certification exam preparation, hands-on labs, and more.&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%2Fzksz8v5hmxx1oh6hyvnb.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%2Fzksz8v5hmxx1oh6hyvnb.png" alt="Image description" width="800" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Features
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Free Learning Content&lt;/strong&gt;: AWS Skill Builder provides access to over 600 free courses and learning plans. These cover various topics, from basic cloud concepts to advanced AWS services.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;AWS Exam Prep&lt;/strong&gt;: The platform offers comprehensive exam preparation resources, including official question sets, practice exams, and pretests. This helps learners gain confidence and be well-prepared for AWS certification exams.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;AWS Builder Labs&lt;/strong&gt;: These labs provide guided instructions to help users develop practical skills in a sandbox environment. This allows learners to practice building without the risk of incurring unexpected costs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;AWS Digital Classroom&lt;/strong&gt;: Available with the annual subscription, this feature includes expert-led videos, hands-on labs, knowledge checks, and course assessments. It offers a structured learning experience similar to traditional classroom training.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Game-Based Learning&lt;/strong&gt;: AWS Skill Builder includes interactive learning experiences like AWS Cloud Quest and AWS Jam. These game-based simulations and challenges make learning engaging and fun.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Community and Networking&lt;/strong&gt;: Users can connect with a large community of AWS professionals to share knowledge, ask questions, and network. This community aspect enhances the learning experience by providing support and collaboration opportunities.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Subscription Options
&lt;/h3&gt;

&lt;p&gt;AWS Skill Builder offers several subscription plans to cater to different needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Free Account&lt;/strong&gt;: Access to 600+ on-demand courses, standard exam prep courses, and digital badges.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Individual Monthly Subscription&lt;/strong&gt;: Priced at $29 per month, it includes enhanced exam prep courses, hands-on labs, and more.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Individual Annual Subscription&lt;/strong&gt;: Priced at $299 per year, it offers everything in the monthly subscription plus access to the AWS Digital Classroom.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Team Subscription&lt;/strong&gt;: Designed for organizations, this plan costs $449 per learner per year and includes additional features like administrator dashboards, comprehensive reporting, and SSO support.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Specialized Learning Paths
&lt;/h3&gt;

&lt;p&gt;AWS Skill Builder offers tailored learning paths for different roles and industries. These paths help learners focus on the skills most relevant to their career goals.&lt;/p&gt;

&lt;p&gt;For example, there are specific tracks for cloud practitioners, solutions architects, developers, DevOps, serverless, containers and more.&lt;/p&gt;

&lt;h3&gt;
  
  
  Practical Experience
&lt;/h3&gt;

&lt;p&gt;The platform emphasizes hands-on learning through its extensive lab offerings. With over 1,000 lab experiences, learners can apply their knowledge in real-world scenarios. This practical approach ensures that users not only understand theoretical concepts but also know how to implement them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Continuous Updates
&lt;/h3&gt;

&lt;p&gt;AWS Skill Builder is regularly updated to reflect the latest AWS services and best practices. This ensures that learners are always getting the most current and relevant information.&lt;/p&gt;

&lt;h3&gt;
  
  
  Additional Features
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Login to skills Builder&lt;/strong&gt;: Users can log in using their Builder ID, AWS Partner Network credentials, Organization SSO, or Amazon employee single sign-on, making access seamless and secure.&lt;/li&gt;
&lt;/ol&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%2Fxvmrk8fs9k4h5hei4kyg.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%2Fxvmrk8fs9k4h5hei4kyg.png" alt="Image description" width="800" height="729"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Generative AI-Powered Simulations&lt;/strong&gt;: The platform includes AI-powered simulations that provide a dynamic and interactive learning experience, helping users understand complex concepts through practical application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Instructor-Driven Digital Courses&lt;/strong&gt;: These courses offer a blend of video instruction, hands-on labs, and assessments, providing a comprehensive learning experience.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Jam Journey Challenges&lt;/strong&gt;: These challenges present real-world, open-ended problems in an AWS Console environment, enhancing problem-solving skills and preparing users for professional scenarios.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ramp-Up Guides&lt;/strong&gt;: Downloadable guides are available for further study, allowing users to delve deeper into specific roles or solutions within the AWS ecosystem.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Activities Board&lt;/strong&gt;: This feature helps users track their course progress, completions, and test scores, providing insights into their learning journey and keeping them motivated.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;AWS Skill Builder is an excellent training platform that caters to a wide range of learning needs. Whether you're new to the cloud or an experienced professional, it offers the resources and support needed to build and validate your AWS skills. The combination of free and paid content, practical labs, and community support makes it a valuable tool for anyone looking to advance their career in cloud computing.&lt;/p&gt;

&lt;p&gt;If you're looking for alternatives, DataScientest offers AWS training courses that teach you how to use cloud services to make your infrastructure scalable, identify migration procedures, and design solutions integrating security, authentication, and access functions with AWS. Their training is delivered entirely remotely, and they are recognized by the French government, making their courses eligible for funding under the Compte Personnel de Formation scheme.&lt;/p&gt;



&lt;blockquote&gt;
&lt;p&gt;💡 Thank you for Reading !! 🙌🏻😁📃, see you in the next blog.🤘  &lt;em&gt;&lt;strong&gt;Until next time 🎉&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;🚀 Thank you for sticking up till the end. If you have any questions/feedback regarding this blog feel free to connect with me:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;♻️ LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/rajhi-saif/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/rajhi-saif/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;♻️ X/Twitter:&lt;/strong&gt; &lt;a href="https://x.com/rajhisaifeddine" rel="noopener noreferrer"&gt;https://x.com/rajhisaifeddine&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The end ✌🏻&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;🔰 Keep Learning !! Keep Sharing !! 🔰&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;📻🧡 Resources&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://support.hashicorp.com/hc/en-us/articles/4406026108435-Known-issues-with-default-tags-in-the-Terraform-AWS-Provider-3-38-0-4-67-0" rel="noopener noreferrer"&gt;https://support.hashicorp.com/hc/en-us/articles/4406026108435-Known-issues-with-default-tags-in-the-Terraform-AWS-Provider-3-38-0-4-67-0&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@leslie.alldridge/how-to-tag-aws-resources-in-terraform-effectively-f4f12bc2416b" rel="noopener noreferrer"&gt;https://medium.com/@leslie.alldridge/how-to-tag-aws-resources-in-terraform-effectively-f4f12bc2416b&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://engineering.deptagency.com/best-practices-for-terraform-aws-tags" rel="noopener noreferrer"&gt;https://engineering.deptagency.com/best-practices-for-terraform-aws-tags&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;📅 Stay updated&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Subscribe to &lt;a href="https://seifrajhi.github.io/blog/" rel="noopener noreferrer"&gt;our newsletter&lt;/a&gt; for more insights on AWS cloud computing and containers.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>kubernetes</category>
      <category>serverless</category>
      <category>eks</category>
    </item>
    <item>
      <title>AWS re:Invent 2024: Key Announcements on Containers and Serverless</title>
      <dc:creator>saifeddine Rajhi</dc:creator>
      <pubDate>Mon, 09 Dec 2024 07:05:43 +0000</pubDate>
      <link>https://dev.to/aws-builders/aws-reinvent-2024-key-announcements-on-containers-and-serverless-4fop</link>
      <guid>https://dev.to/aws-builders/aws-reinvent-2024-key-announcements-on-containers-and-serverless-4fop</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;AWS re:Invent 2024: Key Announcements on Containers and Serverless&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  🔖  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;During re:Invent 2024, AWS made several significant announcements regarding their container and serverless offerings. Here's what you need to know.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Amazon EKS Auto Mode
&lt;/h2&gt;

&lt;p&gt;AWS introduced &lt;a href="https://aws.amazon.com/about-aws/whats-new/2024/12/amazon-eks-auto-mode/" rel="noopener noreferrer"&gt;Amazon Elastic Kubernetes Service (Amazon EKS) Auto Mode&lt;/a&gt;, a new capability designed to streamline Kubernetes cluster management. With EKS Auto Mode, you can manage compute, storage, and networking from provisioning to ongoing maintenance with a single click. This feature enhances agility, performance, and cost-efficiency by automating cluster management tasks, allowing you to focus on building innovative applications instead of managing infrastructure.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Amazon EKS Hybrid Nodes
&lt;/h2&gt;

&lt;p&gt;Another major announcement was the general availability of &lt;a href="https://aws.amazon.com/about-aws/whats-new/2024/12/amazon-eks-hybrid-nodes/" rel="noopener noreferrer"&gt;Amazon EKS Hybrid Nodes&lt;/a&gt;. This feature allows you to attach your on-premises and edge infrastructure as nodes to EKS clusters in the cloud. By unifying Kubernetes management across cloud and on-premises environments, EKS Hybrid Nodes enable you to leverage the scalability and availability of Amazon EKS while using your existing hardware. This integration supports consistent operational practices and tooling across your environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Amazon Aurora Serverless v2
&lt;/h2&gt;

&lt;p&gt;AWS also announced that &lt;a href="https://aws.amazon.com/about-aws/whats-new/2024/11/amazon-aurora-serverless-v2-scaling-zero-capacity/" rel="noopener noreferrer"&gt;Amazon Aurora Serverless v2&lt;/a&gt; now supports scaling to zero capacity. This feature allows databases to scale down to zero, with resume times typically around 15 seconds. It's particularly useful for low-usage databases, such as those in development or user acceptance testing (UAT) environments, offering significant cost savings for small and medium-sized businesses (SMBs).&lt;/p&gt;

&lt;h2&gt;
  
  
  🔚 Conclusion
&lt;/h2&gt;

&lt;p&gt;These announcements underscore AWS's commitment to providing flexible, efficient, and cost-effective solutions for managing container and serverless environments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Until next time, つづく 🎉&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Thank you for Reading !! 🙌🏻😁📃, see you in the next blog.🤘  &lt;em&gt;&lt;strong&gt;Until next time 🎉&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;🚀 Thank you for sticking up till the end. If you have any questions/feedback regarding this blog feel free to connect with me:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;♻️ LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/rajhi-saif/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/rajhi-saif/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;♻️ X/Twitter:&lt;/strong&gt; &lt;a href="https://x.com/rajhisaifeddine" rel="noopener noreferrer"&gt;https://x.com/rajhisaifeddine&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The end ✌🏻&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;🔰 Keep Learning !! Keep Sharing !! 🔰&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;📅 Stay updated&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Subscribe to our newsletter for more insights on AWS cloud computing and containers.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>kubernetes</category>
      <category>eks</category>
      <category>reinvent</category>
    </item>
    <item>
      <title>Enhanced Observability for Amazon EKS with CloudWatch Container Insights</title>
      <dc:creator>saifeddine Rajhi</dc:creator>
      <pubDate>Mon, 02 Dec 2024 11:19:58 +0000</pubDate>
      <link>https://dev.to/aws-builders/enhanced-observability-for-amazon-eks-with-cloudwatch-container-insights-550b</link>
      <guid>https://dev.to/aws-builders/enhanced-observability-for-amazon-eks-with-cloudwatch-container-insights-550b</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;CloudWatch Boosts EKS Observability&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;AWS recently announced that Amazon CloudWatch Container Insights now offers enhanced observability for Amazon EKS on EC2, providing deeper insights into your Kubernetes clusters. This update includes additional telemetry from Kubernetes control plane components and detailed health and performance metrics at the container level.&lt;/p&gt;

&lt;p&gt;Amazon CloudWatch Container Insights is a fully managed monitoring and observability service that provides engineers with out-of-the-box visibility into their containerized applications and microservice environments.&lt;/p&gt;

&lt;p&gt;With Amazon CloudWatch Container Insights, you can monitor, isolate, and diagnose issues in your Kubernetes clusters with minimal effort. It delivers infrastructure telemetry like CPU, memory, network, and disk usage for your clusters, services, and pods in the form of metrics and logs that can be easily visualized in the CloudWatch console.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔍 Key Features
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Comprehensive Metrics and Logs
&lt;/h3&gt;

&lt;p&gt;With enhanced observability, you can monitor CPU, memory, network, and disk usage for your clusters, services, and pods. The new features also include detailed metrics from the Kubernetes API server and etcd, helping you isolate and diagnose issues more effectively. Customers also have the capability to add CloudWatch alarms to get notified of anomalies for proactive actions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Kube-State Metrics
&lt;/h3&gt;

&lt;p&gt;With &lt;a href="https://github.com/kubernetes/kube-state-metrics" rel="noopener noreferrer"&gt;Kube-State metrics&lt;/a&gt;, you get a complete view of the core components and overall health of your Kubernetes clusters. You can monitor the real-time state and quickly identify any issues or bottlenecks. Detailed container-level metrics allow you to visually navigate through different layers of your cluster, making it easier to spot problems like memory leaks in individual containers. This helps you resolve issues faster and more efficiently.&lt;/p&gt;

&lt;h3&gt;
  
  
  Proactive Risk Management
&lt;/h3&gt;

&lt;p&gt;Identify risks and take proactive actions even without pre-set alarms. Set alarms on unmonitored components or allocate more resources to mitigate risks preemptively, ensuring a smooth end-user experience. The enhanced observability feature facilitates early risk identification and proactive mitigation without relying on customer actions, helping prevent issues that could negatively impact the end-user experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  🛠️ How to Enable Enhanced Observability
&lt;/h2&gt;

&lt;p&gt;To enable enhanced observability for your Amazon EKS cluster, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Set Up IAM Permissions:&lt;/strong&gt;
Ensure your worker nodes have the necessary IAM permissions by attaching the CloudWatchAgentServerPolicy to your IAM role:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws iam attach-role-policy &lt;span class="nt"&gt;--role-name&lt;/span&gt; my-worker-node-role &lt;span class="nt"&gt;--policy-arn&lt;/span&gt; arn:aws:iam::aws:policy/CloudWatchAgentServerPolicy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install the EKS Add-on:&lt;/strong&gt;
The Amazon EKS add-on simplifies the process of enabling enhanced observability. It installs the CloudWatch agent and Fluent Bit, providing infrastructure and container log insights. Run the following command, replacing &lt;code&gt;my-cluster-name&lt;/code&gt; with the name of your cluster:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws eks create-addon &lt;span class="nt"&gt;--cluster-name&lt;/span&gt; my-cluster-name &lt;span class="nt"&gt;--addon-name&lt;/span&gt; amazon-cloudwatch-observability
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fldh438ki6tm07ti88vy2.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%2Fldh438ki6tm07ti88vy2.png" alt="Image description" width="784" height="966"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;View Enhanced Metrics and Logs:&lt;/strong&gt;
Access the CloudWatch console to start seeing enhanced metrics and logs for your EKS clusters.&lt;/li&gt;
&lt;/ol&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%2F43vzk7tdrxddy7vjuswf.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%2F43vzk7tdrxddy7vjuswf.png" alt="Image description" width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/blogs/mt/new-container-insights-with-enhanced-observability-for-amazon-eks/" rel="noopener noreferrer"&gt;Source&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  📊 Enhanced Dashboards
&lt;/h2&gt;

&lt;p&gt;The enhanced Container Insights dashboards provide various views to analyze performance, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cluster-wide Performance Dashboard:&lt;/strong&gt; Overview of resource utilization across the entire cluster.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Node Performance View:&lt;/strong&gt; Metrics at the individual node level.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pod Performance View:&lt;/strong&gt; Focus on pod-level metrics for CPU, memory, network, etc.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Container Performance View:&lt;/strong&gt; Drill down into utilization metrics for individual containers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These dashboards allow you to quickly identify and address performance issues at different levels of your Kubernetes environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  🌟 Conclusion
&lt;/h2&gt;

&lt;p&gt;With the new enhanced observability features in Amazon CloudWatch Container Insights, you can monitor and troubleshoot your Amazon EKS clusters more effectively. Enable these features today to gain deeper insights and ensure optimal performance for your Kubernetes workloads.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/blogs/mt/new-container-insights-with-enhanced-observability-for-amazon-eks/" rel="noopener noreferrer"&gt;https://aws.amazon.com/blogs/mt/new-container-insights-with-enhanced-observability-for-amazon-eks/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;Until next time, つづく 🎉&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Thank you for Reading !! 🙌🏻😁📃, see you in the next blog.🤘  &lt;strong&gt;&lt;em&gt;Until next time 🎉&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;🚀 Thank you for sticking up till the end. If you have any questions/feedback regarding this blog feel free to connect with me:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;♻️ LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/rajhi-saif/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/rajhi-saif/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;♻️ X/Twitter:&lt;/strong&gt; &lt;a href="https://x.com/rajhisaifeddine" rel="noopener noreferrer"&gt;https://x.com/rajhisaifeddine&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The end ✌🏻&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;🔰 Keep Learning !! Keep Sharing !! 🔰&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;📅 Stay updated&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Subscribe to &lt;a href="https://seifrajhi.github.io/" rel="noopener noreferrer"&gt;our newsletter&lt;/a&gt; for more insights on AWS cloud computing and containers.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>kubernetes</category>
      <category>eks</category>
      <category>platformengineering</category>
    </item>
    <item>
      <title>Simplify Authorization Management with Cedar by AWS</title>
      <dc:creator>saifeddine Rajhi</dc:creator>
      <pubDate>Mon, 25 Nov 2024 11:59:41 +0000</pubDate>
      <link>https://dev.to/aws-builders/simplify-authorization-management-with-cedar-by-aws-ee0</link>
      <guid>https://dev.to/aws-builders/simplify-authorization-management-with-cedar-by-aws-ee0</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Simplify Authorization Management with Cedar by AWS&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  ⚡ Introduction
&lt;/h2&gt;

&lt;p&gt;AWS recently introduced Cedar that simplifies managing authorization policies. Cedar allows you to define and manage complex authorization rules as reusable components, making your life easier and your applications more secure.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Cedar?
&lt;/h2&gt;

&lt;p&gt;Cedar is an open-source project by AWS that helps you create and manage fine-grained authorization policies. By defining these policies separately from your application code, you can update, analyze, and audit them independently.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does Cedar work?
&lt;/h2&gt;

&lt;p&gt;Cedar uses a simple yet expressive language to define authorization policies. When you apply a policy, Cedar:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Validates the policy against a schema.&lt;/li&gt;
&lt;li&gt;Evaluates access requests in real-time.&lt;/li&gt;
&lt;li&gt;Provides detailed analysis and optimization tools.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Cedar Policies
&lt;/h2&gt;

&lt;p&gt;A Cedar policy specifies who can do what with which resources. It supports common authorization models like Role-Based Access Control (RBAC) and Attribute-Based Access Control (ABAC).&lt;/p&gt;

&lt;h3&gt;
  
  
  Example Cedar Policy
&lt;/h3&gt;

&lt;p&gt;Here's an example of a Cedar policy that allows a user named "alice" to view photos in the "jane_vacation" album:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;permit &lt;span class="o"&gt;(&lt;/span&gt;
  principal &lt;span class="o"&gt;==&lt;/span&gt; User::&lt;span class="s2"&gt;"alice"&lt;/span&gt;,
  action &lt;span class="o"&gt;==&lt;/span&gt; Action::&lt;span class="s2"&gt;"view"&lt;/span&gt;,
  resource &lt;span class="k"&gt;in &lt;/span&gt;Album::&lt;span class="s2"&gt;"jane_vacation"&lt;/span&gt;
&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example Entities
&lt;/h3&gt;

&lt;p&gt;Cedar represents principals, resources, and actions as entities. Here's an example of entities in JSON format:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"uid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"User"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"alice"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"attrs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"age"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"parents"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"uid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Photo"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"VacationPhoto94.jpg"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"attrs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"parents"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Album"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"jane_vacation"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Getting Started with Cedar
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;p&gt;To use Cedar in your application, add the &lt;code&gt;cedar-policy&lt;/code&gt; crate as a dependency:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo add cedar-policy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Testing Your Policy
&lt;/h3&gt;

&lt;p&gt;You can test your policy using the Cedar CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo run authorize &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--policies&lt;/span&gt; policy.cedar &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--entities&lt;/span&gt; entities.json &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--principal&lt;/span&gt; &lt;span class="s1"&gt;'User::"alice"'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--action&lt;/span&gt; &lt;span class="s1"&gt;'Action::"view"'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--resource&lt;/span&gt; &lt;span class="s1"&gt;'Photo::"VacationPhoto94.jpg"'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CLI output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ALLOW
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This request is allowed because "VacationPhoto94.jpg" belongs to "jane_vacation", and "alice" can view photos in that album.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cedar for Kubernetes
&lt;/h2&gt;

&lt;p&gt;Cedar for Kubernetes allows users to enforce access control on Kubernetes API requests using Cedar policies. Users can dynamically create authorization policies for Kubernetes that support features like request or user attribute-based rules, label-based access controls, conditions, and enforce denial policies. Users can also create admission policies in the same file as authorization policy, giving policy authors a single language to write and reason about.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cedar Access Controls for Kubernetes
&lt;/h3&gt;

&lt;p&gt;AWS has announced a new open-source project, Cedar access controls for Kubernetes. This project brings the power of Cedar to Kubernetes authorization and admission validation, enabling cluster administrators to use a unified access control language for principals making API calls. With Cedar access controls for Kubernetes, administrators can dynamically create authorization policies that support features like request or user attribute-based rules, label-based access controls, conditions, and denial policies.&lt;/p&gt;

&lt;h3&gt;
  
  
  Background: Kubernetes Authorization and Admission
&lt;/h3&gt;

&lt;p&gt;Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications. Central to Kubernetes is an API server that supports multiple extension points, and Cedar integrates into two of these steps: the authorization and validating admission phase. After a request is authenticated, Kubernetes performs authorization for nodes, a pluggable authorization to an external webhook (powered by Cedar in this case), and the built-in Role-Based Access Control (RBAC). &lt;/p&gt;

&lt;p&gt;Authorization in Kubernetes is intended to be fast, so the body of the requested action is not serialized or evaluated: just the authentication information, the verb, and the contents of the URL are evaluated. In a Kubernetes request, the URL contains data like the API group, what resource type is being acted on ("pods", "secrets", "nodes", etc.), a possible namespace, or the specific resource's name. If a request passes authorization, it proceeds through several phases and then reaches the validating admission step. Admission validation allows administrators to allow or deny mutating requests (create/update/delete) with the requested object included, and Cedar policies can also be evaluated in this step.&lt;/p&gt;

&lt;h3&gt;
  
  
  Demonstration
&lt;/h3&gt;

&lt;p&gt;Let's walk through an example of capabilities that Cedar enables. As a Kubernetes administrator, you want to allow some users to create and manage Kubernetes ConfigMaps to store configuration data, but you only want those users to view and modify ConfigMaps they own. Enforcing this kind of control is possible today in Kubernetes, but requires you to use RBAC and a validating admission webhook with a separate policy language.&lt;/p&gt;

&lt;p&gt;First, we'll write an authorization policy permitting users to view and manage ConfigMaps.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;permit &lt;span class="o"&gt;(&lt;/span&gt;
    principal &lt;span class="k"&gt;in &lt;/span&gt;k8s::Group::&lt;span class="s2"&gt;"requires-labels"&lt;/span&gt;,
    action &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;
        k8s::Action::&lt;span class="s2"&gt;"create"&lt;/span&gt;,
        k8s::Action::&lt;span class="s2"&gt;"update"&lt;/span&gt;,
        k8s::Action::&lt;span class="s2"&gt;"patch"&lt;/span&gt;,
        k8s::Action::&lt;span class="s2"&gt;"delete"&lt;/span&gt;,
        k8s::Action::&lt;span class="s2"&gt;"list"&lt;/span&gt;,
        k8s::Action::&lt;span class="s2"&gt;"watch"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;,
    resource is k8s::Resource
&lt;span class="o"&gt;)&lt;/span&gt; when &lt;span class="o"&gt;{&lt;/span&gt;
    resource.apiGroup &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; // &lt;span class="s2"&gt;""&lt;/span&gt; is the core Kubernetes API group
    resource.resource &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"configmaps"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This policy grants users in the group "requires-labels" the ability to create, update, patch, delete, list, and watch ConfigMap objects. So far, this is comparable to an RBAC policy in Kubernetes. Now, let's add a policy to prevent users from listing or watching for ConfigMaps they do not own.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;forbid &lt;span class="o"&gt;(&lt;/span&gt;
    principal is k8s::User &lt;span class="k"&gt;in &lt;/span&gt;k8s::Group::&lt;span class="s2"&gt;"requires-labels"&lt;/span&gt;,
    action &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;k8s::Action::&lt;span class="s2"&gt;"list"&lt;/span&gt;, k8s::Action::&lt;span class="s2"&gt;"watch"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;,
    resource is k8s::Resource
&lt;span class="o"&gt;)&lt;/span&gt; unless &lt;span class="o"&gt;{&lt;/span&gt;
    resource has labelSelector &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;
    resource.labelSelector.contains&lt;span class="o"&gt;({&lt;/span&gt;
        &lt;span class="s2"&gt;"key"&lt;/span&gt;: &lt;span class="s2"&gt;"owner"&lt;/span&gt;,
        &lt;span class="s2"&gt;"operator"&lt;/span&gt;: &lt;span class="s2"&gt;"="&lt;/span&gt;,
        &lt;span class="s2"&gt;"values"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;principal.name]
    &lt;span class="o"&gt;})&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unlike RBAC, we can define explicit denials in authorization. This policy forbids users in the group "requires-labels" from making list or watch requests against any resource unless they include a label selector in their request. This policy leverages a new alpha-level feature gate AuthorizeWithSelectors in Kubernetes v1.31 that allows the Cedar authorizer to make decisions on field and label selectors included in a request. Now let's restrict what the users can create or update.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;forbid &lt;span class="o"&gt;(&lt;/span&gt;
    principal is k8s::User &lt;span class="k"&gt;in &lt;/span&gt;k8s::Group::&lt;span class="s2"&gt;"requires-labels"&lt;/span&gt;,
    action &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;
        k8s::admission::Action::&lt;span class="s2"&gt;"create"&lt;/span&gt;,
        k8s::admission::Action::&lt;span class="s2"&gt;"update"&lt;/span&gt;,
        k8s::admission::Action::&lt;span class="s2"&gt;"delete"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;,
    resource
&lt;span class="o"&gt;)&lt;/span&gt; unless &lt;span class="o"&gt;{&lt;/span&gt;
    resource has metadata &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;
    resource.metadata has labels &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;
    resource.metadata.labels.contains&lt;span class="o"&gt;({&lt;/span&gt;&lt;span class="s2"&gt;"key"&lt;/span&gt;: &lt;span class="s2"&gt;"owner"&lt;/span&gt;, &lt;span class="s2"&gt;"value"&lt;/span&gt;: principal.name&lt;span class="o"&gt;})&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You may notice that the action in this policy has a different prefix than the authorization policies. Because Kubernetes does not include the content of the resource in authorization but does in admission validations, we use actions in separate Cedar namespaces for authorization and admission. Authorization actions apply to k8s::Resource types and admission actions apply to Kubernetes types. Finally, we need one more admission policy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;forbid &lt;span class="o"&gt;(&lt;/span&gt;
    principal is k8s::User &lt;span class="k"&gt;in &lt;/span&gt;k8s::Group::&lt;span class="s2"&gt;"requires-labels"&lt;/span&gt;,
    action &lt;span class="o"&gt;==&lt;/span&gt; k8s::admission::Action::&lt;span class="s2"&gt;"update"&lt;/span&gt;,
    resource
&lt;span class="o"&gt;)&lt;/span&gt; unless &lt;span class="o"&gt;{&lt;/span&gt;
    resource has oldObject &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;
    resource.oldObject has metadata &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;
    resource.oldObject.metadata has labels &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;
    resource.oldObject.metadata.labels.contains&lt;span class="o"&gt;(&lt;/span&gt;
        &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"key"&lt;/span&gt;: &lt;span class="s2"&gt;"owner"&lt;/span&gt;, &lt;span class="s2"&gt;"value"&lt;/span&gt;: principal.name&lt;span class="o"&gt;})&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Similar to the first admission policy, we write a policy that applies to update operations. When a user makes an update request, the validating admission request not only includes the updated object, but also includes the object before it was modified. This enables us to prevent principals from overwriting the owner label on a resource that doesn't belong to the principal.&lt;/p&gt;

&lt;p&gt;Now we can try this policy out! We have created a local Kubernetes cluster in a VM using Kind, and applied the above policy. We have created a kubeconfig for a user named "sample-user", and included them in the group "requires-labels" (the GitHub project has full setup instructions for you to try this out).&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;# set our KUBECONFIG file to a sample user in our Kind cluster&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;KUBECONFIG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;./mount/sample-user-kubeconfig.yaml
&lt;span class="nv"&gt;$ &lt;/span&gt;kubectl auth &lt;span class="nb"&gt;whoami
&lt;/span&gt;ATTRIBUTE   VALUE
Username    sample-user
Groups      &lt;span class="o"&gt;[&lt;/span&gt;sample-group requires-labels system:authenticated]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, let's see what that user can do. First, we'll try to see what ConfigMaps exist, and create a new one.&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;kubectl get configmap
Error from server &lt;span class="o"&gt;(&lt;/span&gt;Forbidden&lt;span class="o"&gt;)&lt;/span&gt;: configmaps is forbidden: &lt;span class="se"&gt;\&lt;/span&gt;
  User &lt;span class="s2"&gt;"sample-user"&lt;/span&gt; cannot list resource &lt;span class="s2"&gt;"configmaps"&lt;/span&gt; &lt;span class="k"&gt;in &lt;/span&gt;API group &lt;span class="s2"&gt;""&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="k"&gt;in &lt;/span&gt;the namespace &lt;span class="s2"&gt;"default"&lt;/span&gt;: &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"reasons"&lt;/span&gt;:[&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"policy"&lt;/span&gt;:&lt;span class="s2"&gt;"label-enforcement-policy1"&lt;/span&gt;,&lt;span class="s2"&gt;"position"&lt;/span&gt;:&lt;span class="o"&gt;{&lt;/span&gt;
      &lt;span class="s2"&gt;"filename"&lt;/span&gt;:&lt;span class="s2"&gt;"label-enforcement-policy"&lt;/span&gt;,&lt;span class="s2"&gt;"offset"&lt;/span&gt;:671,&lt;span class="s2"&gt;"line"&lt;/span&gt;:21,&lt;span class="s2"&gt;"column"&lt;/span&gt;:1&lt;span class="o"&gt;}}]}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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;kubectl create configmap sample-config &lt;span class="nt"&gt;--from-literal&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;k1&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;v1
error: failed to create configmap: &lt;span class="se"&gt;\&lt;/span&gt;
    admission webhook &lt;span class="s2"&gt;"vpolicy.cedar.k8s.aws"&lt;/span&gt; denied the request: &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;[{&lt;/span&gt;&lt;span class="s2"&gt;"policy"&lt;/span&gt;:&lt;span class="s2"&gt;"label-enforcement-policy2"&lt;/span&gt;,&lt;span class="s2"&gt;"position"&lt;/span&gt;:&lt;span class="o"&gt;{&lt;/span&gt;
         &lt;span class="s2"&gt;"filename"&lt;/span&gt;:&lt;span class="s2"&gt;"label-enforcement-policy"&lt;/span&gt;,&lt;span class="s2"&gt;"offset"&lt;/span&gt;:1226,&lt;span class="s2"&gt;"line"&lt;/span&gt;:36,&lt;span class="s2"&gt;"column"&lt;/span&gt;:1&lt;span class="o"&gt;}}]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the first request, our kubectl get request resulted in a list operation. This was permitted in the first policy, but denied in the second policy (the zero-indexed "label-enforcement-policy1") that forbids list/watch resource requests without a label selector. The second request was similarly permitted in the first authorization policy, but denied in admission policy "label-enforcement-policy2".&lt;/p&gt;

&lt;p&gt;Next, let's try to make requests that use ownership labels.&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;kubectl get configmap &lt;span class="nt"&gt;--selector&lt;/span&gt; &lt;span class="nv"&gt;owner&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;sample-user &lt;span class="nt"&gt;--show-labels&lt;/span&gt;
No resources found &lt;span class="k"&gt;in &lt;/span&gt;default namespace.

&lt;span class="c"&gt;# Construct a configmap with the proper owner label&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&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; sample-config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: sample-config
  labels:
    owner: sample-user
data:
  stage: test
&lt;/span&gt;&lt;span class="no"&gt;EOF

&lt;/span&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;kubectl create &lt;span class="nt"&gt;-f&lt;/span&gt; ./sample-config.yaml
configmap/sample-config created

&lt;span class="nv"&gt;$ &lt;/span&gt;kubectl get configmap &lt;span class="nt"&gt;--selector&lt;/span&gt; &lt;span class="nv"&gt;owner&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;sample-user &lt;span class="nt"&gt;--show-labels&lt;/span&gt;
NAME            DATA   AGE   LABELS
sample-config   1      19s   &lt;span class="nv"&gt;owner&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;sample-user
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And they all succeeded! When we made list or create requests using the owner labels, they were permitted because each forbid statement's unless clause was satisfied.&lt;/p&gt;

&lt;h3&gt;
  
  
  Additional Features
&lt;/h3&gt;

&lt;p&gt;Beyond the ability to enforce Cedar-based permissions in Kubernetes, the project provides a few other features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Custom Resource Definition (CRD) for storing Cedar policies in a Kubernetes cluster.&lt;/li&gt;
&lt;li&gt;A converter that works with any RBAC bindings and policies to rewrite them in Cedar. RBAC policies continue to work in clusters with Cedar enabled, they are only evaluated when no Cedar rules explicitly allow or forbid a request.&lt;/li&gt;
&lt;li&gt;Support for authorizing Kubernetes impersonation on UIDs, usernames, and groups.&lt;/li&gt;
&lt;li&gt;A Cedar schema generator for Kubernetes built-in types and CRDs, so policies can be validated before creation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Limitations
&lt;/h3&gt;

&lt;p&gt;This project is a public experiment for how Cedar policies can be used to enforce authorization in Kubernetes. We think this project holds a lot of possibilities for enabling more secure policies in Kubernetes, but there are limitations and tradeoffs to be aware of. One worth mentioning here is that Cedar doesn't work well with optional nested fields on sets of structures. While Cedar has operators that can test set membership or set overlap, it does not have a way to map a general operation on a set of objects. This is by design: It ensures that Cedar policies are efficiently and precisely analyzable, in the sense that they can be represented in formal logic for purposes of automating policy reasoning. As a result, Cedar is not able to enforce common Kubernetes policies like ensuring all container images on a pod are from a specific container registry, or that all containers have CPU and memory limits set. If this is an issue for you, Cedar is still a great upgrade for the authorization component, but other tooling like Open Policy Agent Gatekeeper or Kyverno may be a better fit for those policies. For a full list of features, limitations, and a walkthrough to try this out for yourself in a Kind cluster, see the GitHub repository. We can't wait to see what kind of policies you write!&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I use Cedar for Kubernetes policy enforcement?
&lt;/h3&gt;

&lt;p&gt;While Cedar offers powerful authorization guarantees, there are policy enforcement requirements common to Kubernetes that are not formally analyzable. For example, enforcing that all containers in all pods have a maximum memory limit set. Cedar is powered by automated reasoning, including an SMT solver, which does not implement loops or map functions. Rather than viewing Cedar as a replacement for tools like Open Policy Agent/Gatekeeper or Kyverno, it is best seen as an additional tool for access control enforcement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Cedar by AWS offers a powerful and flexible way to manage authorization policies. By separating policy management from application code, you can ensure your security model is robust and adaptable. For more details, check out the Cedar documentation.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;📻🧡 For more information, check out the &lt;a href="https://docs.cedarpolicy.com" rel="noopener noreferrer"&gt;Cedar documentation&lt;/a&gt; and explore the &lt;a href="https://github.com/cedar-policy/cedar-examples" rel="noopener noreferrer"&gt;Cedar examples repository&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;



&lt;blockquote&gt;
&lt;p&gt;💡 Thank you for Reading !! 🙌🏻😁📃, see you in the next blog.🤘  &lt;strong&gt;&lt;em&gt;Until next time 🎉&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;🚀 Thank you for sticking up till the end. If you have any questions/feedback regarding this blog feel free to connect with me:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;♻️ LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/rajhi-saif/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/rajhi-saif/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;♻️ X/Twitter:&lt;/strong&gt; &lt;a href="https://x.com/rajhisaifeddine" rel="noopener noreferrer"&gt;https://x.com/rajhisaifeddine&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The end ✌🏻&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;🔰 Keep Learning !! Keep Sharing !! 🔰&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;📅 Stay updated&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Subscribe to our newsletter for more insights on AWS cloud computing and containers.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>kubernetes</category>
      <category>devops</category>
      <category>platformengineering</category>
    </item>
    <item>
      <title>Simplify Kubernetes Resource Management with KRO by AWS</title>
      <dc:creator>saifeddine Rajhi</dc:creator>
      <pubDate>Mon, 18 Nov 2024 12:27:30 +0000</pubDate>
      <link>https://dev.to/aws-builders/simplify-kubernetes-resource-management-with-kro-by-aws-3egk</link>
      <guid>https://dev.to/aws-builders/simplify-kubernetes-resource-management-with-kro-by-aws-3egk</guid>
      <description>&lt;h2&gt;
  
  
  ⚡ Introduction
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/blogs/opensource/introducing-open-source-kro-kube-resource-orchestrator/" rel="noopener noreferrer"&gt;AWS recently introduced Kube Resource Orchestrator (kro)&lt;/a&gt; that simplifies managing Kubernetes resources. kro allows you to define and manage complex Kubernetes resources as reusable components, making your life easier and your deployments more efficient.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is kro?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://kro.run/" rel="noopener noreferrer"&gt;Kube Resource Orchestrator (kro)&lt;/a&gt; is an open-source project by AWS that helps you create and manage custom groups of Kubernetes resources. By defining these groups as ResourceGroups, you can deploy multiple resources together in a consistent and controlled way.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does kro work?
&lt;/h2&gt;

&lt;p&gt;kro uses core Kubernetes primitives to simplify resource grouping and dependency management. When you apply a ResourceGroup to your cluster, kro:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Verifies the ResourceGroup specification.&lt;/li&gt;
&lt;li&gt;Creates a new Custom Resource Definition (CRD).&lt;/li&gt;
&lt;li&gt;Deploys a dedicated controller to manage the lifecycle of the resources.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  ResourceGroups
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://kro.run/docs/concepts/resource-groups" rel="noopener noreferrer"&gt;A ResourceGroup&lt;/a&gt; is the fundamental building block in kro. It allows you to define, organize, and manage sets of related Kubernetes resources as a single, reusable unit. A ResourceGroup acts as a blueprint, defining:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Schema&lt;/strong&gt;: What users can configure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resources&lt;/strong&gt;: What resources to create.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dependencies&lt;/strong&gt;: How resources reference each other.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Conditions&lt;/strong&gt;: When resources should be included.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Status&lt;/strong&gt;: What status to expose.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Anatomy of a ResourceGroup
&lt;/h3&gt;

&lt;p&gt;A ResourceGroup consists of three main parts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Metadata&lt;/strong&gt;: Includes name, namespace, labels, etc.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spec&lt;/strong&gt;: Defines the structure and properties of the ResourceGroup.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Status&lt;/strong&gt;: Reflects the current state of the ResourceGroup.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The &lt;code&gt;spec&lt;/code&gt; section contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Schema&lt;/strong&gt;: Defines the API structure, including fields users can configure and status information.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resources&lt;/strong&gt;: Specifies the Kubernetes resources to create, their templates, dependencies, conditions for inclusion, and readiness criteria.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example ResourceGroup
&lt;/h3&gt;

&lt;p&gt;Here's an example of a ResourceGroup that includes a Deployment, Service, and Ingress:&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;kro.run/v1alpha1&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;ResourceGroup&lt;/span&gt;
&lt;span class="na"&gt;metadata&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;my-application&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;schema&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1alpha1&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;Application&lt;/span&gt;
    &lt;span class="na"&gt;spec&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;string&lt;/span&gt;
      &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string | default="nginx"&lt;/span&gt;
      &lt;span class="na"&gt;ingress&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;boolean | default=false&lt;/span&gt;
    &lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;deploymentConditions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${deployment.status.conditions}&lt;/span&gt;
      &lt;span class="na"&gt;availableReplicas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${deployment.status.availableReplicas}&lt;/span&gt;
  &lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;deployment&lt;/span&gt;
      &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;apps/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;Deployment&lt;/span&gt;
        &lt;span class="na"&gt;metadata&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;${schema.spec.name}&lt;/span&gt;
        &lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;replicas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;
          &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${schema.spec.name}&lt;/span&gt;
          &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${schema.spec.name}&lt;/span&gt;
            &lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;containers&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;${schema.spec.name}&lt;/span&gt;
                  &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${schema.spec.image}&lt;/span&gt;
                  &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;containerPort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;service&lt;/span&gt;
      &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&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;Service&lt;/span&gt;
        &lt;span class="na"&gt;metadata&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;${schema.spec.name}-service&lt;/span&gt;
        &lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${deployment.spec.selector.matchLabels}&lt;/span&gt;
          &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;protocol&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;TCP&lt;/span&gt;
              &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;
              &lt;span class="na"&gt;targetPort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ingress&lt;/span&gt;
      &lt;span class="na"&gt;includeWhen&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;${schema.spec.ingress.enabled}&lt;/span&gt;
      &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;networking.k8s.io/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;Ingress&lt;/span&gt;
        &lt;span class="na"&gt;metadata&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;${schema.spec.name}-ingress&lt;/span&gt;
          &lt;span class="na"&gt;annotations&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;kubernetes.io/ingress.class&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;alb&lt;/span&gt;
            &lt;span class="na"&gt;alb.ingress.kubernetes.io/scheme&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;internet-facing&lt;/span&gt;
            &lt;span class="na"&gt;alb.ingress.kubernetes.io/target-type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ip&lt;/span&gt;
            &lt;span class="na"&gt;alb.ingress.kubernetes.io/healthcheck-path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/health&lt;/span&gt;
            &lt;span class="na"&gt;alb.ingress.kubernetes.io/listen-ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;[{"HTTP":&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;80}]'&lt;/span&gt;
            &lt;span class="na"&gt;alb.ingress.kubernetes.io/target-group-attributes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;stickiness.enabled=true,stickiness.lb_cookie.duration_seconds=60&lt;/span&gt;
        &lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;rules&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;http&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/"&lt;/span&gt;
                    &lt;span class="na"&gt;pathType&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Prefix&lt;/span&gt;
                    &lt;span class="na"&gt;backend&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                      &lt;span class="na"&gt;service&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;${service.metadata.name}&lt;/span&gt;
                        &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                          &lt;span class="na"&gt;number&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  ResourceGroup Instances
&lt;/h2&gt;

&lt;p&gt;Once kro processes your ResourceGroup, it creates a new API in your cluster. Users can then create &lt;a href="https://kro.run/docs/concepts/instances" rel="noopener noreferrer"&gt;instances&lt;/a&gt; of this API to deploy resources in a consistent, controlled way. An instance represents your deployed application and contains your configuration values, serving as the single source of truth for your application's desired state.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example ResourceGroup Instance
&lt;/h3&gt;

&lt;p&gt;Here's an example of how an instance for the SimpleWebApp might look:&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;kro.run/v1alpha1&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;SimpleWebApp&lt;/span&gt;
&lt;span class="na"&gt;metadata&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;my-web-app&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;appName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;awesome-app&lt;/span&gt;
  &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx:latest&lt;/span&gt;
  &lt;span class="na"&gt;replicas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Getting Started with kro
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;p&gt;To install kro, you need Helm and kubectl configured for your Kubernetes cluster. Follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Fetch the latest release version:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;KRO_VERSION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;curl &lt;span class="nt"&gt;-sL&lt;/span&gt; https://api.github.com/repos/awslabs/kro/releases/latest | jq &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="s1"&gt;'.tag_name | ltrimstr("v")'&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Install kro using Helm:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;helm &lt;span class="nb"&gt;install &lt;/span&gt;kro oci://public.ecr.aws/kro/kro &lt;span class="nt"&gt;--namespace&lt;/span&gt; kro &lt;span class="nt"&gt;--create-namespace&lt;/span&gt; &lt;span class="nt"&gt;--version&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;KRO_VERSION&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Verify the installation:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;helm &lt;span class="nt"&gt;-n&lt;/span&gt; kro list
kubectl get pods &lt;span class="nt"&gt;-n&lt;/span&gt; kro
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Creating Your First ResourceGroup
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Define a ResourceGroup:&lt;/strong&gt;&lt;br&gt;
Save the following as &lt;code&gt;resourcegroup.yaml&lt;/code&gt;:&lt;br&gt;
&lt;/p&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;kro.run/v1alpha1&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;ResourceGroup&lt;/span&gt;
&lt;span class="na"&gt;metadata&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;my-application&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;schema&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1alpha1&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;Application&lt;/span&gt;
    &lt;span class="na"&gt;spec&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;string&lt;/span&gt;
      &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string | default="nginx"&lt;/span&gt;
      &lt;span class="na"&gt;ingress&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;boolean | default=false&lt;/span&gt;
    &lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;deploymentConditions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${deployment.status.conditions}&lt;/span&gt;
      &lt;span class="na"&gt;availableReplicas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${deployment.status.availableReplicas}&lt;/span&gt;
  &lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;deployment&lt;/span&gt;
      &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;apps/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;Deployment&lt;/span&gt;
        &lt;span class="na"&gt;metadata&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;${schema.spec.name}&lt;/span&gt;
        &lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;replicas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;
          &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${schema.spec.name}&lt;/span&gt;
          &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${schema.spec.name}&lt;/span&gt;
            &lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;containers&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;${schema.spec.name}&lt;/span&gt;
                  &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${schema.spec.image}&lt;/span&gt;
                  &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;containerPort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;service&lt;/span&gt;
      &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&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;Service&lt;/span&gt;
        &lt;span class="na"&gt;metadata&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;${schema.spec.name}-service&lt;/span&gt;
        &lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${deployment.spec.selector.matchLabels}&lt;/span&gt;
          &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;protocol&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;TCP&lt;/span&gt;
              &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;
              &lt;span class="na"&gt;targetPort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ingress&lt;/span&gt;
      &lt;span class="na"&gt;includeWhen&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;${schema.spec.ingress.enabled}&lt;/span&gt;
      &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;networking.k8s.io/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;Ingress&lt;/span&gt;
        &lt;span class="na"&gt;metadata&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;${schema.spec.name}-ingress&lt;/span&gt;
          &lt;span class="na"&gt;annotations&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;kubernetes.io/ingress.class&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;alb&lt;/span&gt;
            &lt;span class="na"&gt;alb.ingress.kubernetes.io/scheme&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;internet-facing&lt;/span&gt;
            &lt;span class="na"&gt;alb.ingress.kubernetes.io/target-type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ip&lt;/span&gt;
            &lt;span class="na"&gt;alb.ingress.kubernetes.io/healthcheck-path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/health&lt;/span&gt;
            &lt;span class="na"&gt;alb.ingress.kubernetes.io/listen-ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;[{"HTTP":&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;80}]'&lt;/span&gt;
            &lt;span class="na"&gt;alb.ingress.kubernetes.io/target-group-attributes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;stickiness.enabled=true,stickiness.lb_cookie.duration_seconds=60&lt;/span&gt;
        &lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;rules&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;http&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/"&lt;/span&gt;
                    &lt;span class="na"&gt;pathType&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Prefix&lt;/span&gt;
                    &lt;span class="na"&gt;backend&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                      &lt;span class="na"&gt;service&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;${service.metadata.name}&lt;/span&gt;
                        &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                          &lt;span class="na"&gt;number&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Apply the ResourceGroup:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; resourcegroup.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Inspect the ResourceGroup:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get rg my-application &lt;span class="nt"&gt;-o&lt;/span&gt; wide
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Creating an Application Instance
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Define an Application instance:&lt;/strong&gt;&lt;br&gt;
Save the following as &lt;code&gt;instance.yaml&lt;/code&gt;:&lt;br&gt;
&lt;/p&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;kro.run/v1alpha1&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;Application&lt;/span&gt;
&lt;span class="na"&gt;metadata&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;my-application-instance&lt;/span&gt;
&lt;span class="na"&gt;spec&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;my-awesome-app&lt;/span&gt;
  &lt;span class="na"&gt;ingress&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Apply the Application instance:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; instance.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Inspect the Application instance:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get applications
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Inspect the resources:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get deployments,services,ingresses
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Deleting the Application Instance
&lt;/h3&gt;

&lt;p&gt;To clean up resources, delete the Application instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl delete application my-application-instance
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🌟 Conclusion
&lt;/h2&gt;

&lt;p&gt;kro by AWS simplifies Kubernetes resource management by allowing you to define and manage complex resource configurations as reusable components. Whether you're deploying simple applications or complex multi-service architectures, kro can help streamline your Kubernetes operations.&lt;/p&gt;

&lt;h2&gt;
  
  
  🌐 Community Participation
&lt;/h2&gt;

&lt;p&gt;Development and discussion are coordinated in the &lt;a href="https://communityinviter.com/apps/kubernetes/community" rel="noopener noreferrer"&gt;Kubernetes Slack (invite link)&lt;/a&gt; channel &lt;a href="https://kubernetes.slack.com/archives/XXX-TBD" rel="noopener noreferrer"&gt;#kro&lt;/a&gt; channel.&lt;/p&gt;

&lt;p&gt;We welcome questions, suggestions, and contributions from the community! To get involved, check out our contributing guide. For bugs or feature requests, feel free to submit an issue. You’re also invited to join our community.&lt;/p&gt;

&lt;h2&gt;
  
  
  📚 Documentation
&lt;/h2&gt;

&lt;p&gt;For more detailed information, check out the following resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://kro.run/docs/overview" rel="noopener noreferrer"&gt;kro Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kro.run/docs/getting-started/Installation" rel="noopener noreferrer"&gt;kro Installation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kro.run/docs/getting-started/deploy-a-resource-group" rel="noopener noreferrer"&gt;kro Getting Started&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kro.run/docs/concepts/resource-groups/" rel="noopener noreferrer"&gt;kro Concepts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kro.run/examples/" rel="noopener noreferrer"&gt;kro Examples&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;Until next time, つづく 🎉&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Thank you for Reading !! 🙌🏻😁📃, see you in the next blog.🤘  &lt;strong&gt;&lt;em&gt;Until next time 🎉&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;🚀 Thank you for sticking up till the end. If you have any questions/feedback regarding this blog feel free to connect with me:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;♻️ LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/rajhi-saif/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/rajhi-saif/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;♻️ X/Twitter:&lt;/strong&gt; &lt;a href="https://x.com/rajhisaifeddine" rel="noopener noreferrer"&gt;https://x.com/rajhisaifeddine&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The end ✌🏻&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;🔰 Keep Learning !! Keep Sharing !! 🔰&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;📅 Stay updated&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Subscribe to &lt;a href="https://seifrajhi.github.io/blog/" rel="noopener noreferrer"&gt;our newsletter&lt;/a&gt; for more insights on AWS cloud computing and containers.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>kubernetes</category>
      <category>platformengineering</category>
      <category>devops</category>
    </item>
    <item>
      <title>HardenEKS: The Easy Way to keep your AWS EKS clusters secure and compliant</title>
      <dc:creator>saifeddine Rajhi</dc:creator>
      <pubDate>Mon, 11 Nov 2024 07:08:55 +0000</pubDate>
      <link>https://dev.to/aws-builders/hardeneks-the-easy-way-to-keep-your-aws-eks-clusters-secure-and-compliant-58o9</link>
      <guid>https://dev.to/aws-builders/hardeneks-the-easy-way-to-keep-your-aws-eks-clusters-secure-and-compliant-58o9</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Guide to automating Amazon EKS best practices compliance&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  🚀 Introduction
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/eks/" rel="noopener noreferrer"&gt;Amazon Elastic Kubernetes Service (EKS)&lt;/a&gt; is a managed Kubernetes service that makes it easy to run Kubernetes on AWS. However, ensuring that your EKS clusters are secure and compliant with best practices can be a daunting task. That's where HardenEKS comes in.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/aws-samples/hardeneks" rel="noopener noreferrer"&gt;HardenEKS&lt;/a&gt; is an open source Python CLI that helps you programmatically validate if your EKS clusters follow best practices defined in the &lt;a href="https://aws.github.io/aws-eks-best-practices/" rel="noopener noreferrer"&gt;AWS EKS Best Practices Guide EBPG&lt;/a&gt;. The EBPG covers security, reliability, autoscaling, networking, and scalability. HardenEKS has incorporated and codified the pillars of the EBPG into a set of rules.&lt;/p&gt;

&lt;p&gt;HardenEKS is easy to use. Simply install it, run it against your EKS cluster, and it will generate a report of any violations. You can then use this report to fix the violations and ensure that your clusters are secure and compliant.&lt;/p&gt;

&lt;p&gt;HardenEKS is a valuable tool for any EKS administrator who wants to keep their clusters secure and compliant. It's easy to use, it's open source, and it's backed by the AWS community.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This blog post is for anyone who wants to learn how to secure their Kubernetes clusters. 🕵‍♂️&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Enjoy! 💪&lt;/em&gt;&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%2Fqm3slw04p4dlpz0a3qfg.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%2Fqm3slw04p4dlpz0a3qfg.png" alt="Image description" width="780" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  📣 Introducing HardenEKS 📣
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;HardenEKS&lt;/strong&gt; is a potent Python-based Command Line Interface (CLI), capable of systematically assessing whether &lt;a href="https://aws.amazon.com/eks/" rel="noopener noreferrer"&gt;Amazon Elastic Kubernetes Service (Amazon EKS)&lt;/a&gt; clusters comply with the strict guidelines laid out in the &lt;a href="https://aws.github.io/aws-eks-best-practices/" rel="noopener noreferrer"&gt;AWS EKS Best Practices Guide (EBPG)&lt;/a&gt;. This comprehensive guide covers six fundamental pillars of best practices for Amazon EKS clusters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Security&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reliability&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Autoscaling&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Networking&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scalability&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Windows Containers&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;HardenEKS, a technical marvel in its own right, primarily focuses on these rules derived from the EBPG that can be executed automatically. With a robust set of over 40 carefully designed automated rules already available and more on the way, HardenEKS ensures that your Amazon EKS cluster's adherence to best practices is nothing short of outstanding.&lt;/p&gt;

&lt;p&gt;What's impressive is that you don't need to install HardenEKS within the cluster you're validating. Instead, it conducts its validation of all rules from an external standpoint, ensuring a non-invasive and secure assessment of best practices. This accessibility, regardless of your level of experience, makes HardenEKS an indispensable tool for all.&lt;/p&gt;

&lt;p&gt;Here's a sneak peek at what you can expect to learn from the article:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Getting and installing HardenEKS.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Running the validation against your operational Amazon EKS cluster.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Creating a comprehensive report with the results.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Exploring the structure and details of this generated report.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Diving into an illustrative best practice scenario, explaining how fixing the best practice issues brings significant benefits.&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  🕸️ Prerequisites
&lt;/h2&gt;

&lt;p&gt;As a prerequisite for running the tool, you must already have access to a Kubernetes cluster configured through the &lt;code&gt;kubeconfig&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;To run the tool on an EKS cluster, some minimum permissions must be met, both within AWS (IAM Policy) and within the EKS cluster (RBAC).&lt;/p&gt;

&lt;p&gt;Below are the minimum required permissions for the IAM Policy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"eks:ListClusters"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"*"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"eks:DescribeCluster"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"*"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ecr:DescribeRepositories"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"*"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"inspector2:BatchGetAccountStatus"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"*"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ec2:DescribeFlowLogs"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"*"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ec2:DescribeInstances"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"*"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For more details on configuring IAM policies, refer to the &lt;a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html" rel="noopener noreferrer"&gt;AWS IAM Documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Below ClusterRole that must be created in the cluster:&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;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ClusterRole&lt;/span&gt;
&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;rbac.authorization.k8s.io/v1&lt;/span&gt;
&lt;span class="na"&gt;metadata&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;hardeneks-runner&lt;/span&gt;
&lt;span class="na"&gt;rules&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;apiGroups&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;namespaces"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;resourcequotas"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;persistentvolumes"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;pods"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;services"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;verbs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;list"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;apiGroups&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;rbac.authorization.k8s.io"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;clusterroles"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;clusterrolebindings"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;roles"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;rolebindings"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;verbs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;list"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;apiGroups&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;networking.k8s.io"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;networkpolicies"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;verbs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;list"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;apiGroups&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;storage.k8s.io"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;storageclasses"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;verbs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;list"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;apiGroups&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;apps"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;deployments"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;daemonsets"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;statefulsets"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;verbs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;list"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;get"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;apiGroups&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;autoscaling"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;horizontalpodautoscalers"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;verbs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;list"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Hands-on
&lt;/h2&gt;

&lt;p&gt;HardenEKS, I suppose it is a great Shift-Left Testing tool that can add value to your hardening practices.&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%2F43sotrypye2wk9flpe83.gif" 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%2F43sotrypye2wk9flpe83.gif" alt="Image description" width="800" height="446"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Moreover, it can easily be implemented in your GitOps approach by adding it to the pipeline.&lt;/p&gt;

&lt;p&gt;You can run HardenEKS with just a few commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; venv /tmp/.venv
&lt;span class="nb"&gt;source&lt;/span&gt; /tmp/.venv/bin/activate
pip &lt;span class="nb"&gt;install &lt;/span&gt;hardeneks
hardeneks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The previous command generates an HTML file that highlights the rules that have been violated. Below is a snapshot of the report that HardenEKS provides.&lt;/p&gt;

&lt;p&gt;HardenEKS systematically checks each section of the EBPG against your cluster. If a rule is found to be violated, HardenEKS not only identifies the specific configuration that caused the violation, but it also provides relevant information about the corresponding EKS Best Practice.&lt;/p&gt;

&lt;p&gt;Each result in the report is accompanied by a link that takes you to detailed information about the best practices related to that particular violation. These results can be used to help you assess and address any issues in your cluster that need attention.&lt;/p&gt;

&lt;p&gt;For example, if the report shows that the "Pod Security Policy" rule has been violated, the link will take you to the documentation for the &lt;a href="https://aws.github.io/aws-eks-best-practices/security/docs/pod-security-policy/" rel="noopener noreferrer"&gt;Pod Security Policy best practice&lt;/a&gt;. This documentation will provide you with information about how to configure your cluster to comply with this best practice.&lt;/p&gt;

&lt;p&gt;The results in the HardenEKS report can be a valuable resource for helping you keep your cluster secure and compliant with best practices. By understanding the results of the report, you can identify and address any issues in your cluster that need to be fixed.&lt;/p&gt;

&lt;p&gt;To use the tool, just run the command below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;hardeneks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Below are some prints of the tool's outputs:&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%2F9wxj1bhp37nv5sldq2qg.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%2F9wxj1bhp37nv5sldq2qg.png" alt="Image description" width="800" height="423"&gt;&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%2Fg007i8pihe6si0edtyr5.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%2Fg007i8pihe6si0edtyr5.png" alt="Image description" width="800" height="426"&gt;&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%2F5p3ogzw6h2srfwprrl0g.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%2F5p3ogzw6h2srfwprrl0g.png" alt="Image description" width="800" height="424"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At the end of each check that the tool performs, it provides a link to the best practices guide.&lt;/p&gt;

&lt;h2&gt;
  
  
  🛠️ Using HardenEKS for Cluster Configuration Validation and Drift Detection
&lt;/h2&gt;

&lt;p&gt;HardenEKS isn't just a one-time validation tool; it's a dynamic solution that can continually monitor your cluster's configuration. Here's how it works:&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ Baseline Configuration
&lt;/h3&gt;

&lt;p&gt;Before and after making significant changes to your cluster, HardenEKS captures a snapshot of your cluster's configuration status. This baseline serves as a reference point.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ Continuous Monitoring
&lt;/h3&gt;

&lt;p&gt;Once changes are implemented, you can create a new baseline to reflect the updated configuration. This process can be automated and scheduled at regular intervals. It ensures that your cluster remains aligned with best practices automatically.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ Detecting Configuration Drift
&lt;/h3&gt;

&lt;p&gt;Comparing these baselines allows you to detect drift—any unintended variations between configurations. Identifying drift is crucial for maintaining the integrity of your Amazon EKS clusters and ensuring that unexpected changes do not compromise their stability.&lt;/p&gt;

&lt;p&gt;HardenEKS facilitates this ongoing validation process and supports JSON output, which is highly beneficial. Here's an example of how to export data as JSON and use it for automated validation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;hardeneks &lt;span class="nt"&gt;--export-json&lt;/span&gt; hardeneks_report.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;HardenEKS facilitates this ongoing validation process and supports JSON output, which is highly beneficial. Here's an example of how to export data as JSON and use it for automated validation:&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;# write StorageClass.yaml with encryption parameter false&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; StorageClass.yaml &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;
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: ebs-sc
provisioner: ebs.csi.aws.com
parameters:
  csi.storage.k8s.io/fstype: xfs
  type: io1
  iopsPerGB: "50"
  encrypted: "false"
&lt;/span&gt;&lt;span class="no"&gt;EOF

&lt;/span&gt;kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; StorageClass.yaml
hardeneks &lt;span class="nt"&gt;--export-json&lt;/span&gt; report.json
kubectl delete &lt;span class="nt"&gt;-f&lt;/span&gt; StorageClass.yaml

&lt;span class="c"&gt;# write StorageClass.yaml with encryption parameter true&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; StorageClass.yaml &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;
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: ebs-sc
provisioner: ebs.csi.aws.com
parameters:
  csi.storage.k8s.io/fstype: xfs
  type: io1
  iopsPerGB: "50"
  encrypted: "true"
&lt;/span&gt;&lt;span class="no"&gt;EOF

&lt;/span&gt;kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; StorageClass.yaml
hardeneks &lt;span class="nt"&gt;--export-json&lt;/span&gt; report2.json

&lt;span class="c"&gt;# Shows the difference in the reports before and after the StorageClass change was made&lt;/span&gt;
&lt;span class="nb"&gt;cat &lt;/span&gt;report.json | jq &lt;span class="nt"&gt;--raw-output&lt;/span&gt;  &lt;span class="s1"&gt;'.cluster_wide.security.encryption_secrets."EBS Storage Classes should have encryption parameter.".status'&lt;/span&gt;
&lt;span class="nb"&gt;false
cat &lt;/span&gt;report2.json | jq &lt;span class="nt"&gt;--raw-output&lt;/span&gt;  &lt;span class="s1"&gt;'.cluster_wide.security.encryption_secrets."EBS Storage Classes should have encryption parameter.".status'&lt;/span&gt;
&lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  ❇️ Advanced configuration customizablerRules
&lt;/h2&gt;

&lt;p&gt;There is the possibility to inform the &lt;a href="https://github.com/aws-samples/hardeneks/blob/main/hardeneks/config.yaml" rel="noopener noreferrer"&gt;hardeneks configuration file&lt;/a&gt; with this it is possible to disable some checks of the tool.&lt;br&gt;
Below is a configuration file where some checks can be disabled:&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="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;ignore-namespaces&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;kube-node-lease&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;kube-public&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;kube-system&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;kube-apiserver&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;karpenter&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;kubecost&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;external-dns&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;argocd&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;aws-for-fluent-bit&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;amazon-cloudwatch&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;vpa&lt;/span&gt;
&lt;span class="na"&gt;rules&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; 
  &lt;span class="na"&gt;cluster_wide&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;security&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;iam&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;disable_anonymous_access_for_cluster_roles&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;check_endpoint_public_access&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;check_aws_node_daemonset_service_account&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;check_access_to_instance_profile&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;restrict_wildcard_for_cluster_roles&lt;/span&gt;
      &lt;span class="na"&gt;multi_tenancy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;ensure_namespace_quotas_exist&lt;/span&gt;
      &lt;span class="na"&gt;detective_controls&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;check_logs_are_enabled&lt;/span&gt;
      &lt;span class="na"&gt;network_security&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;check_vpc_flow_logs&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;check_awspca_exists&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;check_default_deny_policy_exists&lt;/span&gt;
      &lt;span class="na"&gt;encryption_secrets&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;use_encryption_with_ebs&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;use_encryption_with_efs&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;use_efs_access_points&lt;/span&gt;
      &lt;span class="na"&gt;infrastructure_security&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;deploy_workers_onto_private_subnets&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;make_sure_inspector_is_enabled&lt;/span&gt;
      &lt;span class="na"&gt;pod_security&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;ensure_namespace_psa_exist&lt;/span&gt;
      &lt;span class="na"&gt;image_security&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;use_immutable_tags_with_ecr&lt;/span&gt;
    &lt;span class="na"&gt;reliability&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;applications&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;check_metrics_server_is_running&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;check_vertical_pod_autoscaler_exists&lt;/span&gt;
  &lt;span class="na"&gt;namespace_based&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;security&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; 
      &lt;span class="na"&gt;iam&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;disable_anonymous_access_for_roles&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;restrict_wildcard_for_roles&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;disable_service_account_token_mounts&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;disable_run_as_root_user&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;use_dedicated_service_accounts_for_each_deployment&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;use_dedicated_service_accounts_for_each_stateful_set&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;use_dedicated_service_accounts_for_each_daemon_set&lt;/span&gt;
      &lt;span class="na"&gt;pod_security&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;disallow_container_socket_mount&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;disallow_host_path_or_make_it_read_only&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;set_requests_limits_for_containers&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;disallow_privilege_escalation&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;check_read_only_root_file_system&lt;/span&gt;
      &lt;span class="na"&gt;network_security&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;use_encryption_with_aws_load_balancers&lt;/span&gt;
      &lt;span class="na"&gt;encryption_secrets&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;disallow_secrets_from_env_vars&lt;/span&gt;    
      &lt;span class="na"&gt;runtime_security&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;disallow_linux_capabilities&lt;/span&gt;
    &lt;span class="na"&gt;reliability&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;applications&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;check_horizontal_pod_autoscaling_exists&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;schedule_replicas_across_nodes&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;run_multiple_replicas&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;avoid_running_singleton_pods&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🔧 Additional options
&lt;/h2&gt;

&lt;p&gt;HardenEKS offers several additional options to tailor the checks to your specific needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Namespace-Specific Checks:&lt;/strong&gt; Perform the check in a given namespace.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Region-Specific Checks:&lt;/strong&gt; Run the check in a given region.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context or Cluster Name Checks:&lt;/strong&gt; Perform the check in a given context or by cluster name.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Report Export:&lt;/strong&gt; Export the report to HTML or TXT format.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The commitment is to achieve comprehensive coverage of the &lt;a href="https://aws.github.io/aws-eks-best-practices/" rel="noopener noreferrer"&gt;AWS EKS Best Practices Guide (EBPG)&lt;/a&gt;. We aim to incorporate as many EBPG rules as possible into HardenEKS, ensuring that it remains a robust tool for best practices validation.&lt;/p&gt;

&lt;h3&gt;
  
  
  🤝 Contributions welcome
&lt;/h3&gt;

&lt;p&gt;If you're interested in contributing to HardenEKS, we invite you to review our &lt;a href="https://github.com/aws-samples/hardeneks/blob/main/CONTRIBUTING.md" rel="noopener noreferrer"&gt;contribution guidelines&lt;/a&gt;. We value the collaboration of both contributors and collaborators who play a pivotal role in shaping the future versions of HardenEKS.&lt;/p&gt;

&lt;h3&gt;
  
  
  🛤️ Roadmap ahead
&lt;/h3&gt;

&lt;p&gt;HardenEKS maintains a &lt;a href="https://github.com/aws-samples/hardeneks/wiki" rel="noopener noreferrer"&gt;publicly accessible roadmap&lt;/a&gt; outlining the planned features for upcoming versions. We encourage users to actively participate by creating GitHub issues, thus influencing the direction and priorities of HardenEKS's development journey.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔚 Conclusion
&lt;/h2&gt;

&lt;p&gt;The idea of ​​this post was to demonstrate the use of the hardeneks tool to carry out a check of good practices in the use of kubernetes.&lt;br&gt;
Also, we've demonstrated how Amazon EKS operators can leverage programmable validation to assess the compliance of their Amazon EKS clusters with the EBPG.&lt;/p&gt;

&lt;p&gt;It's always a rewarding endeavor to explore innovative methods for assisting customers in optimizing their Day 2 Operations with Amazon EKS.&lt;/p&gt;

&lt;p&gt;We hope that you have found this blog post helpful. If you have any other tips or tricks that you would like to share, please leave a comment below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://giphy.com/gifs/Everdale-supercell-everdale-bigs-the-builder-BDGZ5LdDUkHCS8kS8R" rel="noopener noreferrer"&gt;https://giphy.com/gifs/Everdale-supercell-everdale-bigs-the-builder-BDGZ5LdDUkHCS8kS8R&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;Until next time, つづく 🎉&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Thank you for Reading !! 🙌🏻😁📃, see you in the next blog.🤘  &lt;strong&gt;&lt;em&gt;Until next time 🎉&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;🚀 Thank you for sticking up till the end. If you have any questions/feedback regarding this blog feel free to connect with me:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;♻️ LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/rajhi-saif/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/rajhi-saif/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;♻️ X/Twitter:&lt;/strong&gt; &lt;a href="https://x.com/rajhisaifeddine" rel="noopener noreferrer"&gt;https://x.com/rajhisaifeddine&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The end ✌🏻&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;🔰 Keep Learning !! Keep Sharing !! 🔰&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;📅 Stay updated&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Subscribe to the &lt;a href="https://seifrajhi.github.io/" rel="noopener noreferrer"&gt;newsletter&lt;/a&gt; for more insights on AWS cloud computing and containers.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>eks</category>
      <category>kubernetes</category>
      <category>security</category>
    </item>
    <item>
      <title>Speed Up Microservices Development with Dapr on AWS EKS</title>
      <dc:creator>saifeddine Rajhi</dc:creator>
      <pubDate>Mon, 04 Nov 2024 08:42:32 +0000</pubDate>
      <link>https://dev.to/aws-builders/speed-up-microservices-development-with-dapr-on-aws-ek-85l</link>
      <guid>https://dev.to/aws-builders/speed-up-microservices-development-with-dapr-on-aws-ek-85l</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Use Dapr to Build Distributed Applications Easily on Kubernetes 🎩&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  🐳 Introduction
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Distributed_computing" rel="noopener noreferrer"&gt;Building distributed&lt;/a&gt; applications means creating software that runs on multiple computers within a network, working together to achieve a common goal. This involves coordinating various components or modules that might be spread across different infrastructures.&lt;/p&gt;

&lt;p&gt;Organizations often opt for distributed applications for two main reasons. First, they allow multiple development teams to work independently while contributing to a larger system. Second, they enable the integration of components built with different programming languages, enhancing interoperability.&lt;/p&gt;

&lt;p&gt;This flexibility is important in today's diverse tech landscape, where different teams might prefer different tools and languages.&lt;/p&gt;

&lt;p&gt;However, developing distributed applications comes with several challenges. Ensuring that numerous components work together fluently requires careful attention to resiliency (the ability to recover from failures), &lt;a href="https://en.wikipedia.org/wiki/Observability_(software)" rel="noopener noreferrer"&gt;observability&lt;/a&gt; (monitoring the system's health), security, and scalability across various services and runtimes.&lt;/p&gt;

&lt;p&gt;Additionally, these applications often interact with &lt;a href="https://en.wikipedia.org/wiki/Message_broker" rel="noopener noreferrer"&gt;message brokers&lt;/a&gt; (like &lt;a href="https://kafka.apache.org/" rel="noopener noreferrer"&gt;Kafka&lt;/a&gt; or &lt;a href="https://www.rabbitmq.com/" rel="noopener noreferrer"&gt;RabbitMQ&lt;/a&gt;), &lt;a href="https://en.wikipedia.org/wiki/Data_store" rel="noopener noreferrer"&gt;data stores&lt;/a&gt; (like databases), and external services (like third-party APIs), necessitating a thorough understanding of specific APIs and SDKs, which adds to the complexity. The need for robust error handling, efficient load balancing, and seamless service discovery further complicates the development process.&lt;/p&gt;

&lt;p&gt;In this blog, we will explore how the open-source &lt;a href="https://dapr.io/" rel="noopener noreferrer"&gt;Dapr&lt;/a&gt; (Distributed Application Runtime) can assist us in building reliable and secure distributed applications. Dapr provides a set of building blocks for common microservice patterns, such as service invocation (calling services), state management (handling data), and &lt;a href="https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern" rel="noopener noreferrer"&gt;pub/sub messaging&lt;/a&gt; (publish/subscribe communication), which can significantly reduce the development effort.&lt;/p&gt;

&lt;p&gt;By using Dapr’s built-in best practices and patterns, we will also highlight common use cases for Dapr on &lt;a href="https://aws.amazon.com/eks/" rel="noopener noreferrer"&gt;AWS EKS&lt;/a&gt; (Elastic Kubernetes Service), demonstrating how it can simplify and enhance your microservices architecture. This approach not only speeds up development but also ensures that your applications are scalable and maintainable.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;For more on Dapr, &lt;a href="https://seifrajhi.github.io/blog/dapr-kubernetes-event-driven-runtime-part1/" rel="noopener noreferrer"&gt;check out Part 1 of our series&lt;/a&gt;. You can also learn more about &lt;a href="https://kubernetes.io/" rel="noopener noreferrer"&gt;Kubernetes&lt;/a&gt;, &lt;a href="https://docs.aws.amazon.com/eks/latest/userguide/what-is-eks.html" rel="noopener noreferrer"&gt;AWS EKS&lt;/a&gt;, and &lt;a href="https://martinfowler.com/articles/microservices.html" rel="noopener noreferrer"&gt;microservices architecture&lt;/a&gt; to deepen your understanding of the concepts discussed in this post.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  🚀 What is Dapr and Why Do We Need It?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://dapr.io/" rel="noopener noreferrer"&gt;Dapr&lt;/a&gt; (Distributed Application Runtime) is an open-source project designed to simplify the development of microservices. It provides a set of building blocks that address common challenges in building distributed applications, such as service-to-service communication, state management, and pub/sub messaging.&lt;/p&gt;

&lt;h3&gt;
  
  
  🌟 Main Features of Dapr
&lt;/h3&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%2F15zqawh757dds4yhyco3.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%2F15zqawh757dds4yhyco3.png" alt="Image description" width="800" height="694"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Service Invocation&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dapr makes it easy for microservices to communicate with each other. Instead of writing custom code to handle HTTP or gRPC calls, you can use Dapr's &lt;a href="https://docs.dapr.io/developing-applications/building-blocks/service-invocation/" rel="noopener noreferrer"&gt;Service Invocation&lt;/a&gt; API. This API abstracts the complexity and provides built-in retries, timeouts, and error handling. The &lt;a href="https://docs.dapr.io/concepts/components-concept/#middleware" rel="noopener noreferrer"&gt;middleware components&lt;/a&gt; are used with the service invocation building block.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;State Management&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Managing state in a distributed system can be complex. Dapr provides a &lt;a href="https://docs.dapr.io/developing-applications/building-blocks/state-management/" rel="noopener noreferrer"&gt;State Management API&lt;/a&gt; that allows you to store and retrieve state across different services. This API supports various state stores like Redis, DynamoDB, and Cosmos DB, making it flexible and easy to use.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Publish/Subscribe Messaging&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For event-driven architectures, Dapr offers a &lt;a href="https://docs.dapr.io/developing-applications/building-blocks/pubsub/" rel="noopener noreferrer"&gt;Pub/Sub API&lt;/a&gt;. This allows services to publish events and other services to subscribe to them, enabling asynchronous communication. You can integrate with message brokers like AWS SNS, SQS, and Kafka without changing your application code.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Bindings&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dapr supports input and output bindings to interact with external systems. This means you can easily connect to databases, message queues, and other services using Dapr's &lt;a href="https://docs.dapr.io/developing-applications/building-blocks/bindings/" rel="noopener noreferrer"&gt;Binding API&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Workflow&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dapr provides a built-in &lt;a href="https://docs.dapr.io/developing-applications/building-blocks/workflow/" rel="noopener noreferrer"&gt;workflow&lt;/a&gt; feature to orchestrate logic across various microservices.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Actors&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dapr supports the actor model, allowing you to encapsulate code and data in reusable actor objects, which is a common microservices design pattern.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Secrets Management&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Security is a critical aspect of any distributed system. Dapr includes features like mutual TLS (mTLS) for secure service-to-service communication and &lt;a href="https://docs.dapr.io/developing-applications/building-blocks/secrets/" rel="noopener noreferrer"&gt;secret management&lt;/a&gt; to handle sensitive information like API keys and database credentials.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Configuration&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dapr provides a &lt;a href="https://docs.dapr.io/developing-applications/building-blocks/configuration/" rel="noopener noreferrer"&gt;Configuration API&lt;/a&gt; to manage and be notified of application configuration changes.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Distributed Lock&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dapr offers a &lt;a href="https://docs.dapr.io/developing-applications/building-blocks/distributed-lock/" rel="noopener noreferrer"&gt;Distributed Lock API&lt;/a&gt; to provide mutually exclusive access to shared resources from an application.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Cryptography&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dapr includes a &lt;a href="https://docs.dapr.io/developing-applications/building-blocks/cryptography/" rel="noopener noreferrer"&gt;Cryptography API&lt;/a&gt; to perform cryptographic operations without exposing keys to your application.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Jobs&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dapr provides a &lt;a href="https://docs.dapr.io/developing-applications/building-blocks/jobs/" rel="noopener noreferrer"&gt;Jobs API&lt;/a&gt; to manage the scheduling and orchestration of jobs.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By leveraging these features, Dapr simplifies the development of distributed applications, allowing developers to focus on writing business logic rather than dealing with the complexities of distributed systems. This leads to faster development cycles, more reliable applications, and easier maintenance.&lt;/p&gt;

&lt;h3&gt;
  
  
  ❓ Why Do We Need Dapr?
&lt;/h3&gt;

&lt;p&gt;Developing distributed applications involves several challenges:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Complex Communication&lt;/strong&gt;: Ensuring reliable communication between services can be difficult, especially when dealing with different protocols and error handling.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;State Management&lt;/strong&gt;: Keeping track of state across multiple services requires a consistent and reliable approach.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Event-Driven Architecture&lt;/strong&gt;: Implementing pub/sub messaging patterns can be complex and requires integration with various message brokers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;External Integrations&lt;/strong&gt;: Connecting to external systems like databases and third-party APIs often involves writing boilerplate code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Observability&lt;/strong&gt;: Monitoring and diagnosing issues in a distributed system requires comprehensive logging, metrics, and tracing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security&lt;/strong&gt;: Ensuring secure communication and managing secrets are essential for protecting your application.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Isolation&lt;/strong&gt;: Dapr namespacing provides isolation and multi-tenancy across many capabilities, giving greater security. Typically applications and components are deployed to namespaces to provide isolation in a given environment, such as Kubernetes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Dapr addresses these challenges by providing a set of standardized APIs and components that simplify the development process. By using Dapr, developers can focus on writing business logic instead of dealing with the complexities of distributed systems. This leads to faster development cycles, more reliable applications, and easier maintenance.&lt;/p&gt;

&lt;p&gt;For more details, &lt;a href="https://docs.dapr.io/concepts/overview/" rel="noopener noreferrer"&gt;check the official documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  🛠️ How-To: Invoke Services Using Middleware Component
&lt;/h2&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%2F9pvu32a44t0hzq7c5pf0.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%2F9pvu32a44t0hzq7c5pf0.png" alt="Image description" width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this section, we'll demonstrate how to deploy services with unique application IDs, allowing other services to discover and call endpoints using Dapr's service invocation over HTTP.&lt;/p&gt;

&lt;h3&gt;
  
  
  🆔 Step 1: Choose an ID for Your Service
&lt;/h3&gt;

&lt;p&gt;Dapr allows you to assign a global, unique ID for your app. This ID encapsulates the state for your application, regardless of the number of instances it may have.&lt;/p&gt;

&lt;h3&gt;
  
  
  🛠️ Step 2: Set an App-ID When Deploying to Kubernetes
&lt;/h3&gt;

&lt;p&gt;In Kubernetes, set the &lt;code&gt;dapr.io/app-id&lt;/code&gt; annotation on your pod:&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;apps/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;Deployment&lt;/span&gt;
&lt;span class="na"&gt;metadata&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;my-app&lt;/span&gt;
    &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;default&lt;/span&gt;
    &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-app&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;replicas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;
    &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-app&lt;/span&gt;
    &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-app&lt;/span&gt;
            &lt;span class="na"&gt;annotations&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                &lt;span class="na"&gt;dapr.io/enabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;true"&lt;/span&gt;
                &lt;span class="na"&gt;dapr.io/app-id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;order-processor"&lt;/span&gt;
                &lt;span class="na"&gt;dapr.io/app-port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;6001"&lt;/span&gt;
                &lt;span class="na"&gt;dapr.io/app-protocol&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;http"&lt;/span&gt;  &lt;span class="c1"&gt;# Use "https" if your app uses TLS&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  📡 Step 3: Invoke the Service
&lt;/h3&gt;

&lt;p&gt;To invoke an application using Dapr, you can use the invoke API on any Dapr instance. The sidecar programming model encourages each application to interact with its own instance of Dapr. The Dapr sidecars discover and communicate with one another.&lt;/p&gt;

&lt;p&gt;Below is an example in Python that leverages Dapr SDKs for service invocation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;sleep&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;logging&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;

&lt;span class="n"&gt;base_url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;http://localhost:3500/v1.0/invoke/order-processor/method&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;headers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Content-Type&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;application/json&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;basicConfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;INFO&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;randrange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;order_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;randint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;order&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;orderId&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;item&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;laptop&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;quantity&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="c1"&gt;# Invoke a service
&lt;/span&gt;        &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/orders&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Order requested: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Result: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🌐 Additional URL Formats
&lt;/h3&gt;

&lt;p&gt;To invoke a &lt;code&gt;GET&lt;/code&gt; endpoint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl http://localhost:3500/v1.0/invoke/order-processor/method/orders/100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Dapr provides multiple ways to call the service invocation API:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Change the address in the URL to &lt;code&gt;localhost:&amp;lt;dapr-http-port&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Add a &lt;code&gt;dapr-app-id&lt;/code&gt; header to specify the ID of the target service, or alternatively pass the ID via HTTP Basic Auth: &lt;code&gt;http://dapr-app-id:&amp;lt;service-id&amp;gt;@localhost:3500/path&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl http://localhost:3500/v1.0/invoke/order-processor/method/orders/100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;is equivalent to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s1"&gt;'dapr-app-id: order-processor'&lt;/span&gt; &lt;span class="s1"&gt;'http://localhost:3500/orders/100'&lt;/span&gt; &lt;span class="nt"&gt;-X&lt;/span&gt; GET
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="s1"&gt;'http://dapr-app-id:order-processor@localhost:3500/orders/100'&lt;/span&gt; &lt;span class="nt"&gt;-X&lt;/span&gt; GET
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dapr invoke &lt;span class="nt"&gt;--app-id&lt;/span&gt; order-processor &lt;span class="nt"&gt;--method&lt;/span&gt; orders/100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🔍 Including a Query String in the URL
&lt;/h3&gt;

&lt;p&gt;You can append a query string or a fragment to the end of the URL, and Dapr will pass it through unchanged. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="s1"&gt;'http://dapr-app-id:order-processor@localhost:3500/orders/100?basket=1234&amp;amp;key=abc'&lt;/span&gt; &lt;span class="nt"&gt;-X&lt;/span&gt; GET
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🏷️ Using Namespaces
&lt;/h3&gt;

&lt;p&gt;When running on namespace-supported platforms, include the namespace of the target app in the app ID. For example, use &lt;code&gt;order-processor.production&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Invoking the service with a namespace would look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl http://localhost:3500/v1.0/invoke/order-processor.production/method/orders/100 &lt;span class="nt"&gt;-X&lt;/span&gt; GET
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This example demonstrates how to use Dapr's service invocation to call services securely and efficiently within a Kubernetes environment. For more details, check the &lt;a href="https://docs.dapr.io/developing-applications/building-blocks/service-invocation/" rel="noopener noreferrer"&gt;official Dapr documentation&lt;/a&gt;. Let me know if you need any further details or adjustments!&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo: Set Up an AWS EKS Cluster and App test
&lt;/h2&gt;

&lt;p&gt;In this section, we'll walk you through setting up an Elastic Kubernetes Service (EKS) cluster and deploying a sample application to test Dapr integration.&lt;/p&gt;

&lt;h3&gt;
  
  
  📋 Prerequisites
&lt;/h3&gt;

&lt;p&gt;Before you begin, ensure you have the following installed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;kubectl&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;AWS CLI&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;eksctl&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;An existing VPC and subnets&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🔐 Authenticating to AWS
&lt;/h3&gt;

&lt;p&gt;To interact with AWS services like DynamoDB from your EKS pods, you need to ensure that your pods have the necessary permissions. This can be achieved using IAM Roles for Service Accounts (IRSA) or a pod identity agent.&lt;/p&gt;

&lt;h4&gt;
  
  
  Using IAM Roles for Service Accounts (IRSA)
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Create an IAM Role&lt;/strong&gt;: Create an IAM role with the necessary permissions for accessing AWS services. Attach the required policies to this role.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws iam create-role &lt;span class="nt"&gt;--role-name&lt;/span&gt; EKS-DynamoDB-Role &lt;span class="nt"&gt;--assume-role-policy-document&lt;/span&gt; file://trust-policy.json
aws iam attach-role-policy &lt;span class="nt"&gt;--role-name&lt;/span&gt; EKS-DynamoDB-Role &lt;span class="nt"&gt;--policy-arn&lt;/span&gt; arn:aws:iam::aws:policy/AmazonDynamoDBFullAccess
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;The &lt;code&gt;trust-policy.json&lt;/code&gt; should contain the trust relationship allowing EKS to assume this role:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Principal"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"Service"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"eks.amazonaws.com"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sts:AssumeRole"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Associate the IAM Role with a Kubernetes Service Account&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;eksctl create iamserviceaccount &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--name&lt;/span&gt; my-service-account &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--namespace&lt;/span&gt; default &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--cluster&lt;/span&gt; my-cluster &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--attach-role-arn&lt;/span&gt; arn:aws:iam::&amp;lt;AWS_ACCOUNT_ID&amp;gt;:role/EKS-DynamoDB-Role &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--approve&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Update Your Pod Specification&lt;/strong&gt;: Update your pod specification to use the service account:&lt;br&gt;
&lt;/p&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;Pod&lt;/span&gt;
&lt;span class="na"&gt;metadata&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;my-pod&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;serviceAccountName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-service-account&lt;/span&gt;
  &lt;span class="na"&gt;containers&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;my-container&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-image&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Using a Pod Identity Agent
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Deploy the Pod Identity Agent&lt;/strong&gt;: Follow the installation instructions to deploy the agent to your EKS cluster.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Annotate Your Pods&lt;/strong&gt;: Annotate your pods with the IAM role to be assumed:&lt;br&gt;
&lt;/p&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;Pod&lt;/span&gt;
&lt;span class="na"&gt;metadata&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;my-pod&lt;/span&gt;
  &lt;span class="na"&gt;annotations&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;iam.amazonaws.com/role&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;EKS-DynamoDB-Role&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;containers&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;my-container&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-image&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By following these steps, you can ensure that your EKS pods have the necessary permissions to interact with AWS services securely.&lt;/p&gt;

&lt;h3&gt;
  
  
  🛠️ Step 1: Deploy an EKS Cluster
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Log into AWS&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws configure
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Create an EKS Cluster&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;To create an EKS cluster, use the following command. You can specify a specific version of Kubernetes using the &lt;code&gt;--version&lt;/code&gt; flag (1.13.x or newer version required).&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;eksctl create cluster &lt;span class="nt"&gt;--name&lt;/span&gt; dapre-eks-demo &lt;span class="nt"&gt;--region&lt;/span&gt; eu-west-1 &lt;span class="nt"&gt;--version&lt;/span&gt; 1.30 &lt;span class="nt"&gt;--vpc-private-subnets&lt;/span&gt; subnet-12345,subnet-67890 &lt;span class="nt"&gt;--without-nodegroup&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Adjust the &lt;code&gt;--vpc-private-subnets&lt;/code&gt; values to meet your requirements. You can also specify public subnets by changing &lt;code&gt;--vpc-private-subnets&lt;/code&gt; to &lt;code&gt;--vpc-public-subnets&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Verify &lt;code&gt;kubectl&lt;/code&gt; Context&lt;/strong&gt;:&lt;br&gt;
Ensure your &lt;code&gt;kubectl&lt;/code&gt; context is set to the new EKS cluster.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl config current-context
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Update Security Group Rules&lt;/strong&gt;:&lt;br&gt;
Allow the EKS cluster to communicate with the Dapr sidecar by creating an inbound rule for port &lt;code&gt;4000&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ec2 authorize-security-group-ingress &lt;span class="nt"&gt;--region&lt;/span&gt; eu-west-1 &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;--group-id&lt;/span&gt; sg-0123456789abcdef0 &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;--protocol&lt;/span&gt; tcp &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;--port&lt;/span&gt; 4000 &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;--source-group&lt;/span&gt; sg-0123456789abcdef0
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 2: Deploy Sample Applications
&lt;/h3&gt;

&lt;p&gt;First, we need to clone the repo that has the code snippet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/dapr/quickstarts.git
&lt;span class="nb"&gt;cd &lt;/span&gt;quickstarts/tutorials/hello-kubernetes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, we need to set up Dapr dev mode on our Kubernetes cluster.&lt;/p&gt;

&lt;p&gt;Follow the steps below to deploy Dapr to Kubernetes using the &lt;code&gt;--dev&lt;/code&gt; flag.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Any previous Dapr installations in the Kubernetes cluster need to be uninstalled first. You can use &lt;code&gt;dapr uninstall -k&lt;/code&gt; to remove Dapr.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;With the &lt;code&gt;dapr init -k --dev&lt;/code&gt; command, the CLI will also install the &lt;code&gt;Redis&lt;/code&gt; and &lt;code&gt;Zipkin&lt;/code&gt; containers &lt;code&gt;dapr-dev-redis&lt;/code&gt; and &lt;code&gt;dapr-dev-zipkin&lt;/code&gt; in the &lt;code&gt;default&lt;/code&gt; namespace apart from the Dapr control plane in the &lt;code&gt;dapr-system&lt;/code&gt; namespace.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;statestore&lt;/code&gt;, &lt;code&gt;pubsub&lt;/code&gt;, and &lt;code&gt;appconfig&lt;/code&gt; default components and configuration are applied in the default Kubernetes namespace if they do not exist.&lt;/p&gt;

&lt;p&gt;You can use &lt;code&gt;dapr components -k&lt;/code&gt; and &lt;code&gt;dapr configurations -k&lt;/code&gt; to see these.&lt;/p&gt;

&lt;p&gt;For more details, check the &lt;a href="https://docs.dapr.io/getting-started/" rel="noopener noreferrer"&gt;official Dapr documentation&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dapr init &lt;span class="nt"&gt;-k&lt;/span&gt; &lt;span class="nt"&gt;--dev&lt;/span&gt;
Expected output &lt;span class="k"&gt;in &lt;/span&gt;a fresh Kubernetes cluster without Dapr installed:

⌛  Making the jump to hyperspace...
ℹ️  Note: To &lt;span class="nb"&gt;install &lt;/span&gt;Dapr using Helm, see here: https://docs.dapr.io/getting-started/install-dapr-kubernetes/#install-with-helm-advanced

ℹ️  Container images will be pulled from Docker Hub
✅  Deploying the Dapr control plane with latest version to your cluster...
✅  Deploying the Dapr dashboard with latest version to your cluster...
✅  Deploying the Dapr Redis with 17.14.5 version to your cluster...
✅  Deploying the Dapr Zipkin with latest version to your cluster...
ℹ️  Applying &lt;span class="s2"&gt;"statestore"&lt;/span&gt; component to Kubernetes &lt;span class="s2"&gt;"default"&lt;/span&gt; namespace.
ℹ️  Applying &lt;span class="s2"&gt;"pubsub"&lt;/span&gt; component to Kubernetes &lt;span class="s2"&gt;"default"&lt;/span&gt; namespace.
ℹ️  Applying &lt;span class="s2"&gt;"appconfig"&lt;/span&gt; zipkin configuration to Kubernetes &lt;span class="s2"&gt;"default"&lt;/span&gt; namespace.
✅  Success! Dapr has been installed to namespace dapr-system. To verify, run &lt;span class="sb"&gt;`&lt;/span&gt;dapr status &lt;span class="nt"&gt;-k&lt;/span&gt;&lt;span class="s1"&gt;' in your terminal. To get started, go here: https://aka.ms/dapr-getting-started
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🐍 Deploy the Python App&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Next, we deploy the Python app. This is a basic Python app that posts JSON messages to &lt;code&gt;localhost:3500&lt;/code&gt;, the default listening port for Dapr. You can invoke the Node.js application's &lt;code&gt;neworder&lt;/code&gt; endpoint by posting to &lt;code&gt;v1.0/invoke/nodeapp/method/neworder&lt;/code&gt;. The message contains some data with an &lt;code&gt;orderId&lt;/code&gt; that increments once per second:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;

&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="n"&gt;dapr_url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;http://localhost:3500/v1.0/invoke/nodeapp/method/neworder&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;data&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;orderId&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;}}&lt;/span&gt;

    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dapr_url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To deploy the Python app to the Kubernetes cluster:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; ./deploy/python.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🟢 Deploy the Node.js App&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To deploy the Node.js app to Kubernetes, use the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; ./deploy/node.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will deploy the Node.js app to Kubernetes. The Dapr control plane will automatically inject the Dapr sidecar to the Pod. If you take a look at the &lt;code&gt;node.yaml&lt;/code&gt; file, you will see how Dapr is enabled for that deployment:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;dapr.io/enabled: true&lt;/code&gt; - This tells the Dapr control plane to inject a sidecar to this deployment.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dapr.io/app-id: nodeapp&lt;/code&gt; - This assigns a unique ID or name to the Dapr application, so it can be sent messages to and communicated with by other Dapr apps.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dapr.io/enable-api-logging: "true"&lt;/code&gt; - This is added to &lt;code&gt;node.yaml&lt;/code&gt; file by default to see the API logs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You'll also see the container image that you're deploying. If you want to update the code and deploy a new image, see the &lt;strong&gt;Next Steps&lt;/strong&gt; section.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔄 Accessing the Kubernetes Service&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are several different ways to access a Kubernetes service depending on which platform you are using. Port forwarding is one consistent way to access a service, whether it is hosted locally or on a cloud Kubernetes provider like AKS.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl port-forward service/nodeapp 8080:80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will make your service available on &lt;code&gt;http://localhost:8080&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Configure the Redis Statestore Component&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Apply the &lt;code&gt;redis.yaml&lt;/code&gt; file and observe that your state store was successfully configured!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; ./deploy/redis.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;📜 Viewing Logs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now that the Node.js and Python applications are deployed, watch messages come through:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Node.js App Logs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Get the logs of the Node.js app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl logs &lt;span class="nt"&gt;--selector&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;app&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;node &lt;span class="nt"&gt;-c&lt;/span&gt; node &lt;span class="nt"&gt;--tail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nt"&gt;-1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If all went well, you should see logs like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Got a new order! Order ID: 1
Successfully persisted state &lt;span class="k"&gt;for &lt;/span&gt;Order ID: 1
Got a new order! Order ID: 2
Successfully persisted state &lt;span class="k"&gt;for &lt;/span&gt;Order ID: 2
Got a new order! Order ID: 3
Successfully persisted state &lt;span class="k"&gt;for &lt;/span&gt;Order ID: 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;API Call Logs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Observe API call logs:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Node.js App API Logs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Get the API call logs of the Node.js app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl logs &lt;span class="nt"&gt;--selector&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;app&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;node &lt;span class="nt"&gt;-c&lt;/span&gt; daprd &lt;span class="nt"&gt;--tail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nt"&gt;-1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When save state API calls are made, you should see logs similar to this:&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;time&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"2024-11-02T22:46:09.82121774Z"&lt;/span&gt; &lt;span class="nv"&gt;level&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;info &lt;span class="nv"&gt;method&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"POST /v1.0/state/statestore"&lt;/span&gt; &lt;span class="nv"&gt;app_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;nodeapp &lt;span class="nv"&gt;instance&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;nodeapp-7dd6648dd4-7hpmh &lt;span class="nv"&gt;scope&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;dapr.runtime.http-info &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;log &lt;span class="nv"&gt;ver&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1.7.2
&lt;span class="nb"&gt;time&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"2024-11-02T22:46:10.828764787Z"&lt;/span&gt; &lt;span class="nv"&gt;level&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;info &lt;span class="nv"&gt;method&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"POST /v1.0/state/statestore"&lt;/span&gt; &lt;span class="nv"&gt;app_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;nodeapp &lt;span class="nv"&gt;instance&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;nodeapp-7dd6648dd4-7hpmh &lt;span class="nv"&gt;scope&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;dapr.runtime.http-info &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;log &lt;span class="nv"&gt;ver&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1.7.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Python App API Logs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Get the API call logs of the Python app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl logs &lt;span class="nt"&gt;--selector&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;app&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;python &lt;span class="nt"&gt;-c&lt;/span&gt; daprd &lt;span class="nt"&gt;--tail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nt"&gt;-1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;time&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"2024-11-02T02:47:49.972688145Z"&lt;/span&gt; &lt;span class="nv"&gt;level&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;info &lt;span class="nv"&gt;method&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"POST /neworder"&lt;/span&gt; &lt;span class="nv"&gt;app_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;pythonapp &lt;span class="nv"&gt;instance&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;pythonapp-545df48d55-jvj52 &lt;span class="nv"&gt;scope&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;dapr.runtime.http-info &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;log &lt;span class="nv"&gt;ver&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1.7.2
&lt;span class="nb"&gt;time&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"2024-11-02T02:47:50.984994545Z"&lt;/span&gt; &lt;span class="nv"&gt;level&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;info &lt;span class="nv"&gt;method&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"POST /neworder"&lt;/span&gt; &lt;span class="nv"&gt;app_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;pythonapp &lt;span class="nv"&gt;instance&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;pythonapp-545df48d55-jvj52 &lt;span class="nv"&gt;scope&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;dapr.runtime.http-info &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;log &lt;span class="nv"&gt;ver&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1.7.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✅ Confirm Successful Persistence&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Call the Node.js app's order endpoint to get the latest order. Grab the external IP address that you saved before, append &lt;code&gt;/order&lt;/code&gt;, and perform a GET request against it (enter it into your browser, use Postman, or curl it!):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nv"&gt;$NODE_APP&lt;/span&gt;/order
&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"orderID"&lt;/span&gt;:&lt;span class="s2"&gt;"42"&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see the latest JSON in response!&lt;/p&gt;

&lt;p&gt;This will spin down each resource defined by the &lt;code&gt;.yaml&lt;/code&gt; files in the &lt;code&gt;deploy&lt;/code&gt; directory, including the state component.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: This will also delete the state store component. If the &lt;code&gt;--dev&lt;/code&gt; flag was used for Dapr init, and you want to use the &lt;code&gt;dapr-dev-redis&lt;/code&gt; deployment as state store, replace the &lt;code&gt;redisHost&lt;/code&gt; value inside &lt;code&gt;./deploy/redis.yaml&lt;/code&gt; with &lt;code&gt;dapr-dev-redis-master:6379&lt;/code&gt; and also the &lt;code&gt;secretKeyRef&lt;/code&gt;, &lt;code&gt;name&lt;/code&gt; with &lt;code&gt;dapr-dev-redis&lt;/code&gt;. Then run the command &lt;code&gt;kubectl apply -f ./deploy/redis.yaml&lt;/code&gt;, to apply the file again. This will create a &lt;code&gt;statestore&lt;/code&gt; Dapr component pointing to &lt;code&gt;dapr-dev-redis&lt;/code&gt; deployment.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For more details, check the &lt;a href="https://docs.dapr.io/getting-started/" rel="noopener noreferrer"&gt;official Dapr documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  🏁 Conclusion
&lt;/h2&gt;

&lt;p&gt;In this blog post, we explored how Dapr can significantly simplify the development and management of distributed applications on AWS EKS. By leveraging Dapr's building blocks, such as service invocation, state management, and pub/sub messaging, developers can focus more on business logic and less on the complexities of distributed systems.&lt;/p&gt;

&lt;p&gt;We demonstrated how to set up an AWS EKS cluster, deploy sample applications, and integrate Dapr to enhance microservices architecture. This approach not only accelerates development but also ensures that your applications are scalable, secure, and maintainable.&lt;/p&gt;

&lt;p&gt;Dapr's open-source nature and extensive documentation make it an excellent choice for organizations looking to streamline their microservices development on Kubernetes. Whether you are just starting with microservices or looking to optimize your existing architecture, Dapr provides the tools and best practices to help you succeed.&lt;/p&gt;

&lt;p&gt;For more information and detailed guides, be sure to check out the &lt;a href="https://docs.dapr.io/" rel="noopener noreferrer"&gt;official Dapr documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Happy coding! 🚀&lt;/p&gt;



&lt;blockquote&gt;
&lt;p&gt;💡 Thank you for Reading !! 🙌🏻😁📃, see you in the next blog.🤘  &lt;strong&gt;&lt;em&gt;Until next time 🎉&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;🚀 Thank you for sticking up till the end. If you have any questions/feedback regarding this blog feel free to connect with me:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;♻️ LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/rajhi-saif/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/rajhi-saif/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;♻️ X/Twitter:&lt;/strong&gt; &lt;a href="https://x.com/rajhisaifeddine" rel="noopener noreferrer"&gt;https://x.com/rajhisaifeddine&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The end ✌🏻&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;🔰 Keep Learning !! Keep Sharing !! 🔰&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;📅 Stay updated&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Subscribe to our newsletter for more insights on AWS cloud computing and containers.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>eks</category>
      <category>dapr</category>
      <category>kubernetes</category>
    </item>
  </channel>
</rss>
