{"id":1057,"date":"2022-07-06T10:23:58","date_gmt":"2022-07-06T10:23:58","guid":{"rendered":"https:\/\/blog.ngocha.biz\/?p=1057"},"modified":"2022-07-06T10:23:58","modified_gmt":"2022-07-06T10:23:58","slug":"eks-anywhere-cluster","status":"publish","type":"post","link":"https:\/\/blog.ngocha.biz\/?p=1057","title":{"rendered":"EKS Anywhere Cluster Tutorial [Deploy Cluster in 7 Steps]"},"content":{"rendered":"<p>In this blog, you will learn what EKS Anywhere is and how to <strong>set up an EKS Anywhere development cluster<\/strong> and register it to the AWS EKS console using the EKS connector.<\/p>\n<h2 id=\"what-is-eks-anywhere\">What is EKS Anywhere?<\/h2>\n<p><strong>EKS Anywhere is an AWS feature<\/strong> to run and manage EKS clusters in on-premises environments. It simplifies the on-premise Kubernetes management and enables a consistent Kubernetes experience in a multi-cloud Kubernetes deployment. Also, you will have full control over the control plane and the worker nodes.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-2-57.png\" class=\"kg-image\" alt=\"EKS Anywhere\" loading=\"lazy\" width=\"567\" height=\"375\"><\/figure>\n<p>EKS anywhere uses <strong><a href=\"https:\/\/github.com\/aws\/eks-distro?ref=devopscube.com\" rel=\"noreferrer noopener\">Amazon EKS Distro (EKS-D)<\/a><\/strong>, a Kubernetes distribution customized and open-sourced by AWS. It is the same distro that powers the AWS-managed EKS. This means that when you install EKS anywhere, it comes with parameters and configurations optimized for AWS.<\/p>\n<p>Also, you can register the EKS anywhere clusters to the AWS EKS console using the <strong>EKS connector. <\/strong>Once the cluster is registered, you can visualize all the anywhere cluster components in the AWS EKS console.<\/p>\n<p><a href=\"https:\/\/github.com\/aws\/amazon-eks-connector?ref=devopscube.com\" rel=\"noreferrer noopener\">EKS connector<\/a> is a Statefulset that runs the <a href=\"https:\/\/docs.aws.amazon.com\/systems-manager\/latest\/userguide\/ssm-agent.html?ref=devopscube.com\">AWS System Manager Agent<\/a> in your cluster. It is responsible for maintaining the connection between EKS anywhere cluster and AWS.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/eks-anywhere-devopscube-1.gif\" class=\"kg-image\" alt loading=\"lazy\"><\/figure>\n<p>Following the key use cases of EKS anywhere:<\/p>\n<ol>\n<li><strong>Hybrid cloud consistency:<\/strong> EKS anywhere enables operational consistency across your on-premise and cloud Kubernetes clusters.<\/li>\n<li><strong>Disconnected environment<\/strong>: You can run EKS anywhere cluster without an internet connection. At the same time, your disconnected clusters will have the same features as the cloud EKS with the EKS-D distro.<\/li>\n<li><strong>Application modernization: <\/strong>With EKS-D, the administrative overhead of patching and version upgrades is reduced. So you can focus more on the applications.<\/li>\n<\/ol>\n<h2 id=\"eks-anywhere-development-cluster-setup\">EKS Anywhere Development Cluster Setup<\/h2>\n<p>You can set up EKS anywhere development clusters using Docker on MAC or Ubuntu systems.<\/p>\n<p>Follow the steps given below to set up EKS anywhere development cluster.<\/p>\n<h3 id=\"step-1-install-docker-desktop\">Step 1: Install Docker Desktop<\/h3>\n<p>Go to <a href=\"https:\/\/docs.docker.com\/desktop\/mac\/install\/?ref=devopscube.com\" rel=\"noreferrer noopener\">Docker downloads<\/a> and install the Docker desktop on MAC. For Ubuntu use <a href=\"https:\/\/docs.docker.com\/desktop\/linux\/install\/?ref=devopscube.com\" rel=\"noreferrer noopener\">this link to download the deb package<\/a><\/p>\n<p>Mac users, open the following file and change <code>deprecatedCgroupv1<\/code> to true. And then restart the Docker desktop to apply the changes.<\/p>\n<pre><code>vi ~\/Library\/Group\\ Containers\/group.com.docker\/settings.json<\/code><\/pre>\n<p>Or else you will get the following error.<\/p>\n<pre><code>Error: failed to validate docker desktop: EKS Anywhere requires Docker desktop to be configured to use CGroups v1. Please  set `deprecatedCgroupv1:true` in your `~\/Library\/Group\\ Containers\/group.com.docker\/settings.json` file<\/code><\/pre>\n<h3 id=\"step-2-install-eksctl-anywhere\">Step 2: Install eksctl-anywhere<\/h3>\n<pre><code>brew install eks-anywhere<\/code><\/pre>\n<h3 id=\"step-3-generate-the-cluster-configuration\">Step 3: Generate the cluster configuration<\/h3>\n<p>Generate the EKS anywhere cluster configuration using the following command.<\/p>\n<pre><code>CLUSTER_NAME=dev-eks-cluster\neksctl anywhere generate clusterconfig $CLUSTER_NAME \\\n   --provider docker &gt; $CLUSTER_NAME.yaml<\/code><\/pre>\n<p>Your cluster configuration would look like the following.<\/p>\n<pre><code>apiVersion: anywhere.eks.amazonaws.com\/v1alpha1\nkind: Cluster\nmetadata:\n  name: dev-eks-cluster\nspec:\n  clusterNetwork:\n    cniConfig:\n      cilium: {}\n    pods:\n      cidrBlocks:\n      - 192.168.0.0\/16\n    services:\n      cidrBlocks:\n      - 10.96.0.0\/12\n  controlPlaneConfiguration:\n    count: 1\n  datacenterRef:\n    kind: DockerDatacenterConfig\n    name: dev-eks-cluster\n  externalEtcdConfiguration:\n    count: 1\n  kubernetesVersion: \"1.22\"\n  managementCluster:\n    name: dev-eks-cluster\n  workerNodeGroupConfigurations:\n  - count: 1\n    name: md-0\n\n---\napiVersion: anywhere.eks.amazonaws.com\/v1alpha1\nkind: DockerDatacenterConfig\nmetadata:\n  name: dev-eks-cluster\nspec: {}\n\n---<\/code><\/pre>\n<h3 id=\"step-4-deploy-the-cluster\">Step 4: Deploy the cluster<\/h3>\n<p>Deploy the cluster using <code>eksctl<\/code>. It will take a while for the cluster to be provisioned.<\/p>\n<pre><code>eksctl anywhere create cluster -f dev-eks-cluster.yaml<\/code><\/pre>\n<p>You will get the following output after a successful cluster deployment.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-4-50.png\" class=\"kg-image\" alt=\"EKS anywhere cluster deployment.\" loading=\"lazy\" width=\"566\" height=\"423\"><\/figure>\n<h3 id=\"step-5-validate-the-cluster\">Step 5: Validate the cluster<\/h3>\n<p>Once the cluster is created you can see a folder named <code>dev-eks-cluster<\/code> with the kubeconfig file. Let&#8217;s export the kubeconfig file.<\/p>\n<p>Replace <code>\/path\/to<\/code> with the absolute path of the dev-eks-cluster folder location. Or check out the<a href=\"https:\/\/devopscube.com\/kubernetes-kubeconfig-file\/\"> Kubeconfig file guide<\/a> to know more about kubeconfig file practical usage.<\/p>\n<pre><code>KUBECONFIG=\/path\/to\/dev-eks-cluster\/dev-eks-cluster-eks-a-cluster.kubeconfig<\/code><\/pre>\n<p>Now, let&#8217;s list the pods in the <code>kube-system<\/code> namespace to validate the cluster. You should see all the pods in running state as shown below.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-5-60.png\" class=\"kg-image\" alt=\"EKS anywhere cluster validation\" loading=\"lazy\"><\/figure>\n<h3 id=\"step-6-generate-deploy-eks-connector-configs\">Step 6: Generate &amp; Deploy EKS Connector Configs<\/h3>\n<p>Now that we have a running EKS anywhere development cluster, we will go ahead and register the cluster using the EKS connector.<\/p>\n<blockquote><p><strong>Note<\/strong>: Before you register the cluster, ensure you have a valid AWS cli configuration with admin privileges in your system. Refer the <a href=\"https:\/\/scriptcrunch.com\/install-aws-cli-guide\/?ref=devopscube.com\" rel=\"noreferrer noopener\">AWS CLI configuration guide<\/a> for more details.<\/p><\/blockquote>\n<p>Here is the command to generate EKS connector config YAMLs. Replace the region value if you are using a different region.<\/p>\n<pre><code>eksctl register cluster --name dev-eks-cluster --provider EKS_ANYWHERE --region us-west-2 <\/code><\/pre>\n<p>The above command creates the following three YAML files. Where <code>eks-connector.yaml<\/code> is the EKS connector agent Statefulset YAML<\/p>\n<ol>\n<li>eks-connector-clusterrole.yaml<\/li>\n<li>eks-connector-console-dashboard-full-access-group.yaml<\/li>\n<li>eks-connector.yaml<\/li>\n<\/ol>\n<p>Let&#8217;s deploy all the three YAMLs.<\/p>\n<pre><code>kubectl apply -f eks-connector-clusterrole.yaml\nkubectl apply -f eks-connector-console-dashboard-full-access-group.yaml\nkubectl apply -f eks-connector.yaml<\/code><\/pre>\n<h3 id=\"step-7-validate-eks-anywhere-cluster-registration-on-the-eks-console\">Step 7: Validate EKS Anywhere Cluster Registration On the EKS console<\/h3>\n<p>If you head over to the AWS EKS console, you should see the newly registered cluster as shown below.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-6-43.png\" class=\"kg-image\" alt=\"EKS anywhere cluster console\" loading=\"lazy\" width=\"601\" height=\"273\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-6-43.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-6-43.png 601w\"><\/figure>\n<p>If you click the cluster name, you can view all the information and objects of the EKS anywhere cluster running in your local workstation.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-7-53.png\" class=\"kg-image\" alt=\"Listing EKS anywhere cluster resources on EKS console.\" loading=\"lazy\" width=\"503\" height=\"869\"><\/figure>\n<p>Here is the EKS connector demo I have added to <a href=\"https:\/\/www.youtube.com\/c\/Devopscube?sub_confirmation=1&#038;ref=devopscube.com\" rel=\"noreferrer noopener\">DevOpsCube YouTube Channel.<\/a><\/p>\n<figure class=\"kg-card kg-embed-card\"><iframe loading=\"lazy\" width=\"160\" height=\"90\" src=\"https:\/\/www.youtube.com\/embed\/T_H65f4wDG8?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen=\"\"><\/iframe><\/figure>\n<h2 id=\"conclusion\">Conclusion<\/h2>\n<p>In this guide, we looked at EKS anywhere Kubernetes development cluster setup. It is pretty easy to get started. Do give it a try.<\/p>\n<p>Also if you are looking for light weight Kubernetes development clusters, checkout my <a href=\"https:\/\/devopscube.com\/kubernetes-minikube-tutorial\/\">minikube tutorial<\/a>.<\/p>\n<p>If you are learning Kubernetes, checkout 30+ <a href=\"https:\/\/devopscube.com\/kubernetes-tutorials-beginners\/\" rel=\"noreferrer noopener\">Kubernetes beginners tutorials.<\/a><\/p>\n<hr>\n<p><strong>Ngu\u1ed3n:<\/strong> <a href=\"https:\/\/devopscube.com\/eks-anywhere-cluster\/\" target=\"_blank\" rel=\"noopener noreferrer\">EKS Anywhere Cluster Tutorial [Deploy Cluster in 7 Steps] \u2014 DevOpsCube<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Source: https:\/\/devopscube.com\/eks-anywhere-cluster\/<\/p>\n","protected":false},"author":0,"featured_media":1058,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1057","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops"],"_links":{"self":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts\/1057","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1057"}],"version-history":[{"count":0,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts\/1057\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/media\/1058"}],"wp:attachment":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1057"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1057"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1057"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}