{"id":25531223,"url":"https://github.com/guessi/eks-tutorials","last_synced_at":"2025-04-11T10:08:17.358Z","repository":{"id":44354137,"uuid":"398764072","full_name":"guessi/eks-tutorials","owner":"guessi","description":"Step by step tutorial for those who have zero knowledge to Amazon EKS.","archived":false,"fork":false,"pushed_at":"2025-04-10T06:11:39.000Z","size":111,"stargazers_count":14,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T06:26:48.726Z","etag":null,"topics":["amazon-eks","eks","eksctl","kubernetes","tutorial"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guessi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-22T09:45:12.000Z","updated_at":"2025-04-10T06:11:22.000Z","dependencies_parsed_at":"2024-10-23T08:52:58.614Z","dependency_job_id":"cf1efb36-8c5f-4a64-9cad-fe9444ae3258","html_url":"https://github.com/guessi/eks-tutorials","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guessi%2Feks-tutorials","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guessi%2Feks-tutorials/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guessi%2Feks-tutorials/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guessi%2Feks-tutorials/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guessi","download_url":"https://codeload.github.com/guessi/eks-tutorials/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248372745,"owners_count":21093138,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon-eks","eks","eksctl","kubernetes","tutorial"],"created_at":"2025-02-20T00:47:51.776Z","updated_at":"2025-04-11T10:08:17.280Z","avatar_url":"https://github.com/guessi.png","language":null,"readme":"# eks-tutorials\n\nStep by step tutorial for those who have zero knowledge to Amazon EKS.\n\n### Disclaimer\n\n* The project here is for demonstration purpose only.\n\n* **_DO NOT_** blindly apply it to your production environments.\n\n* Only [Standard Support versions](https://docs.aws.amazon.com/eks/latest/userguide/kubernetes-versions.html#kubernetes-release-calendar) will be covered.\n\n## Prerequisites\n\n- [eksctl](https://eksctl.io/) - The official CLI for Amazon EKS\n- [kubectl](https://kubernetes.io/docs/tasks/tools/) - The Kubernetes command-line tool\n- [helm](https://helm.sh/) - The Kubernetes Package Manage\n\n### Assumptions\n\n- Your AWS Profile have proper permission configured.\n- All the tools required were setup properly\n- All the resources are under `us-east-1`\n- The cluster name would be `eks-auto-mode`\n\n## Guideline of the tutorial\n\n- Goal 1: Create EKS Cluster with `eksctl`\n- Goal 2: Deploy workload and make sure Auto Mode work as expeceted\n- Goal 3: Figure out why HPA and Ingress not working?\n- Goal 4: Fix the issues\n- Goal 5: Figure out why `kubectl scale ...` would failed\n- Goal 6: Try to turn ALB entry from HTTP to HTTPS\n- Goal 7: How to switch to Network Load Balancer (NLB)?\n- Goal 8: Cleanup\n\n\n### Goal 1: Create EKS Cluster with `eksctl`\n\nMake sure you have latest `eksctl` installed and you should be able to create EKS cluster with minimal setup as follow.\n\n```sh\n% eksctl create cluster -f ./cluster-config/cluster-auto.yaml\n```\n\nOR (only when `accessEntries` not empty)\n\n```sh\n% cat cluster-config/cluster-auto.yaml | \\\n    AWS_ACCOUNT_ID=$(aws sts get-caller-identity --output json --query \"Account\" | sed 's/\"//g') envsubst '${AWS_ACCOUNT_ID}' | \\\n    TARGET_ROLE_NAME=DemoRole envsubst '${TARGET_ROLE_NAME}' | eksctl create cluster -f -\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eClick here to show sample deployment output :mag:\u003c/summary\u003e\n\n```\n2025-XX-XX XX:XX:XX [ℹ]  eksctl version 0.202.0\n2025-XX-XX XX:XX:XX [ℹ]  using region us-east-1\n2025-XX-XX XX:XX:XX [ℹ]  subnets for us-east-1a - public:192.168.0.0/19 private:192.168.64.0/19\n2025-XX-XX XX:XX:XX [ℹ]  subnets for us-east-1b - public:192.168.32.0/19 private:192.168.96.0/19\n2025-XX-XX XX:XX:XX [ℹ]  using Kubernetes version 1.32\n2025-XX-XX XX:XX:XX [ℹ]  creating EKS cluster \"eks-auto-mode\" in \"us-east-1\" region with\n2025-XX-XX XX:XX:XX [ℹ]  if you encounter any issues, check CloudFormation console or try 'eksctl utils describe-stacks --region=us-east-1 --cluster=eks-auto-mode'\n2025-XX-XX XX:XX:XX [ℹ]  Kubernetes API endpoint access will use provided values {publicAccess=true, privateAccess=true} for cluster \"eks-auto-mode\" in \"us-east-1\"\n2025-XX-XX XX:XX:XX [ℹ]  configuring CloudWatch logging for cluster \"eks-auto-mode\" in \"us-east-1\" (enabled types: api, audit, authenticator, controllerManager, scheduler \u0026 no types disabled)\n2025-XX-XX XX:XX:XX [ℹ]  default addons metrics-server were not specified, will install them as EKS addons\n2025-XX-XX XX:XX:XX [ℹ]\n2 sequential tasks: { create cluster control plane \"eks-auto-mode\",\n    3 sequential sub-tasks: {\n        1 task: { create addons },\n        wait for control plane to become ready,\n        update CloudWatch log retention,\n    }\n}\n2025-XX-XX XX:XX:XX [ℹ]  building cluster stack \"eksctl-eks-auto-mode-cluster\"\n2025-XX-XX XX:XX:XX [ℹ]  deploying stack \"eksctl-eks-auto-mode-cluster\"\n2025-XX-XX XX:XX:XX [ℹ]  waiting for CloudFormation stack \"eksctl-eks-auto-mode-cluster\"\n2025-XX-XX XX:XX:XX [ℹ]  creating access entry for principal ARN \"arn:aws:iam::9876543210987:role/DemoRole\"\n2025-XX-XX XX:XX:XX [ℹ]  deploying stack \"eksctl-eks-auto-mode-accessentry-NBA57AVDVX4FK4JSRPLCBCK4FW7STRKQ\"\n2025-XX-XX XX:XX:XX [ℹ]  waiting for CloudFormation stack \"eksctl-eks-auto-mode-accessentry-NBA57AVDVX4FK4JSRPLCBCK4FW7STRKQ\"\n2025-XX-XX XX:XX:XX [ℹ]  waiting for CloudFormation stack \"eksctl-eks-auto-mode-accessentry-NBA57AVDVX4FK4JSRPLCBCK4FW7STRKQ\"\n2025-XX-XX XX:XX:XX [ℹ]  created access entry for principal ARN \"arn:aws:iam::9876543210987:role/DemoRole\"\n2025-XX-XX XX:XX:XX [ℹ]  creating addon\n2025-XX-XX XX:XX:XX [ℹ]  successfully created addon\n2025-XX-XX XX:XX:XX [ℹ]  set log retention to 90 days for CloudWatch logging\n2025-XX-XX XX:XX:XX [ℹ]  waiting for the control plane to become ready\n2025-XX-XX XX:XX:XX [✔]  saved kubeconfig as \"/Users/demoUser/.kube/config\"\n2025-XX-XX XX:XX:XX [ℹ]  no tasks\n2025-XX-XX XX:XX:XX [✔]  all EKS cluster resources for \"eks-auto-mode\" have been created\n2025-XX-XX XX:XX:XX [ℹ]  kubectl command should work with \"/Users/demoUser/.kube/config\", try 'kubectl get nodes'\n2025-XX-XX XX:XX:XX [✔]  EKS cluster \"eks-auto-mode\" in \"us-east-1\" region is ready\n```\n\u003c/details\u003e\n\nVerify there have no EKS node running initially.\n\n```sh\n% kubectl get nodes\nNo resources found # expected, since we are running Auto Mode enabled cluster.\n```\n\n***NOTE*** For eksctl version higher than [v0.201.0](https://github.com/eksctl-io/eksctl/releases/tag/v0.201.0), you should find there have 1 node created, since `metrics-server` [became default addon for eksctl created cluster](https://github.com/eksctl-io/eksctl/pull/8118).\n\n### Goal 2: Deploy workload and make sure Auto Mode work as expeceted\n\nAt this stage, you would need to have `kubectl` installed. Then you should be able to create `Deployment`, `HPA`, `Service` and `Ingress` resources.\n\n```sh\n% kubectl apply -f ./examples/simple/\ndeployment.apps/nginx-deployment created\nhorizontalpodautoscaler.autoscaling/nginx-hpa created\ningress.networking.k8s.io/nginx-ingress created\nservice/nginx-service created\n```\n\nAfter workload deployed, there should have node provisioned by Auto Node after few seconds wait.\n\n```sh\n% kubectl get nodes -L \"eks.amazonaws.com/compute-type\"\nNAME                  STATUS   ROLES    AGE   VERSION               COMPUTE-TYPE\ni-00f395d014ff8e657   Ready    \u003cnone\u003e   11s   v1.32.0-eks-2e66e76   auto\n```\n\n### Goal 3: Figure out why HPA and Ingress not working?\n\n```sh\n% kubectl get pods,deployments,hpa,service,ingress\nNAME                                    READY   STATUS    RESTARTS   AGE\npod/nginx-deployment-54697596c9-7bc4f   1/1     Running   0          22s\npod/nginx-deployment-54697596c9-gqpv5   1/1     Running   0          22s\n\nNAME                               READY   UP-TO-DATE   AVAILABLE   AGE\ndeployment.apps/nginx-deployment   2/2     2            2           22s\n\nNAME                                            REFERENCE                     TARGETS              MINPODS   MAXPODS   REPLICAS   AGE\nhorizontalpodautoscaler.autoscaling/nginx-hpa   Deployment/nginx-deployment   cpu: \u003cunknown\u003e/80%   2         10        2          22s # \u003c-------- why no metrics?\n\nNAME                    TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)        AGE\nservice/kubernetes      ClusterIP   10.100.0.1       \u003cnone\u003e        443/TCP        12m\nservice/nginx-service   NodePort    10.100.137.151   \u003cnone\u003e        80:30928/TCP   21s\n\nNAME                                      CLASS   HOSTS                ADDRESS   PORTS   AGE\ningress.networking.k8s.io/nginx-ingress   alb     entry1.example.com             80      22s # \u003c-------- no address shown, why?\n```\n\n### Goal 4: Fix the issues\n\nAfter fixing the issue, you should be able to see command output as follow,\n\n```sh\n% kubectl get ingress nginx-ingress\nNAME            CLASS   HOSTS                ADDRESS                                    PORTS   AGE\nnginx-ingress   alb     entry1.example.com   k8s-default-XXX.REGION.elb.amazonaws.com   80      60s\n```\n\nAfter fixing HPA issue, you should be able to see command output as follow,\n\n```sh\n% kubectl get hpa nginx-hpa\nNAME        REFERENCE                     TARGETS   MINPODS   MAXPODS   REPLICAS   AGE\nnginx-hpa   Deployment/nginx-deployment   2%/80%    2         10        2          2m7s\n```\n\n### Goal 5: Figure out why `kubectl scale ...` would failed\n\n```sh\n% kubectl scale --replicas 12 deployment nginx-deployment\ndeployment.apps/nginx-deployment scaled\n```\n\nWhy the Pod count not able to reach desired pod count `12` but quickly scale down back to `2`... why is that ?\n\n### Goal 6: Try to turn ALB entry from HTTP to HTTPS\n\nService with `HTTP` is clearly unsafe, how to made it safe with `HTTPS`?\n\n### Goal 7: How to switch to Network Load Balancer (NLB)?\n\nIf you solve can provision ALB then you should be able to create NLB as well. But how...? :thinking:\n\n### Goal 8: Cleanup\n\nTerminate all resources that we created earlier.\n\n```sh\n% kubectl delete -f ./examples/simple/ --ignore-not-found\n```\n\nTerminate the EKS cluster\n\n:warning: **_WARNING: all resources will be removed permanently, unrecoverable_**\n\n```sh\n% eksctl delete cluster -f ./cluster-config/cluster-auto.yaml\n```\n\n**OPTIONAL** Cleanup IAM User/Role/Policy and [Identity Provider (IdP)](https://console.aws.amazon.com/iamv2/home?#/identity_providers) with care.\n\n### Bonus\n\nThere's another repository with common used addons installation scripts:\n\n- https://github.com/guessi/eks-integrations-quick-start\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguessi%2Feks-tutorials","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguessi%2Feks-tutorials","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguessi%2Feks-tutorials/lists"}