Git Product home page Git Product logo

acloudguru-resources / course_practical_guide_eks Goto Github PK

View Code? Open in Web Editor NEW
68.0 7.0 313.0 1.5 MB

Assets for the course "A Practical Guide to Amazon EKS", by A Cloud Guru

License: MIT License

Shell 2.67% C# 2.79% Dockerfile 0.48% TypeScript 14.81% JavaScript 2.41% HTML 33.11% CSS 3.78% Ruby 7.55% Python 1.21% Smarty 0.28% SCSS 25.66% Mustache 5.25%
kubernetes aws eks devops cicd networking cost-optimization well-architected

course_practical_guide_eks's Introduction

Important Notice‼️

This course has been retired! There's an updated version of the same course in Pluralsight/A Cloud Guru here: https://www.pluralsight.com/cloud-guru/courses/hands-on-with-amazon-eks

A Practical Guide to EKS

In this repository you will find all the assets required for the course A Practical Guide to Amazon EKS, by A Cloud Guru.

Bookstore application

This solution has been built for for explaining all the concepts in this course. It is complete enough for covering a real case of microservices running on EKS and integrating with other AWS Services.

You can find in here the documentation of the APIs.

course_practical_guide_eks's People

Contributors

andreibanarutakeda avatar dependabot[bot] avatar dianeacloudguru avatar mariomerco avatar mrcsmonteiro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

course_practical_guide_eks's Issues

resources-api not starting up in docker-compose

Hi,

I have tried to start up the site with docker-compose and always hit this same error message regarding the resources-api container:

course_practical_guide_eks-resources-api-1 | [2022-02-20 12:40:03 +0000] [1] [INFO] Starting gunicorn 20.0.0
course_practical_guide_eks-resources-api-1 | [2022-02-20 12:40:03 +0000] [1] [INFO] Listening at: http://0.0.0.0:5000 (1)
course_practical_guide_eks-resources-api-1 | [2022-02-20 12:40:03 +0000] [1] [INFO] Using worker: sync
course_practical_guide_eks-resources-api-1 | [2022-02-20 12:40:03 +0000] [8] [INFO] Booting worker with pid: 8
course_practical_guide_eks-resources-api-1 | [2022-02-20 12:40:04 +0000] [8] [ERROR] Exception in worker process
course_practical_guide_eks-resources-api-1 | Traceback (most recent call last):
course_practical_guide_eks-resources-api-1 | File "/usr/local/lib/python3.10/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
course_practical_guide_eks-resources-api-1 | worker.init_process()
course_practical_guide_eks-resources-api-1 | File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/base.py", line 133, in init_process
course_practical_guide_eks-resources-api-1 | self.load_wsgi()
course_practical_guide_eks-resources-api-1 | File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/base.py", line 142, in load_wsgi
course_practical_guide_eks-resources-api-1 | self.wsgi = self.app.wsgi()
course_practical_guide_eks-resources-api-1 | File "/usr/local/lib/python3.10/site-packages/gunicorn/app/base.py", line 67, in wsgi
course_practical_guide_eks-resources-api-1 | self.callable = self.load()
course_practical_guide_eks-resources-api-1 | File "/usr/local/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
course_practical_guide_eks-resources-api-1 | return self.load_wsgiapp()
course_practical_guide_eks-resources-api-1 | File "/usr/local/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
course_practical_guide_eks-resources-api-1 | return util.import_app(self.app_uri)
course_practical_guide_eks-resources-api-1 | File "/usr/local/lib/python3.10/site-packages/gunicorn/util.py", line 331, in import_app
course_practical_guide_eks-resources-api-1 | mod = importlib.import_module(module)
course_practical_guide_eks-resources-api-1 | File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module
course_practical_guide_eks-resources-api-1 | return _bootstrap._gcd_import(name[level:], package, level)
course_practical_guide_eks-resources-api-1 | File "", line 1050, in _gcd_import
course_practical_guide_eks-resources-api-1 | File "", line 1027, in _find_and_load
course_practical_guide_eks-resources-api-1 | File "", line 1006, in _find_and_load_unlocked
course_practical_guide_eks-resources-api-1 | File "", line 688, in _load_unlocked
course_practical_guide_eks-resources-api-1 | File "", line 883, in exec_module
course_practical_guide_eks-resources-api-1 | File "", line 241, in _call_with_frames_removed
course_practical_guide_eks-resources-api-1 | File "/wsgi.py", line 1, in
course_practical_guide_eks-resources-api-1 | from main import app
course_practical_guide_eks-resources-api-1 | File "/main.py", line 2, in
course_practical_guide_eks-resources-api-1 | from flask import request
course_practical_guide_eks-resources-api-1 | File "/usr/local/lib/python3.10/site-packages/flask/init.py", line 19, in
course_practical_guide_eks-resources-api-1 | from . import json
course_practical_guide_eks-resources-api-1 | File "/usr/local/lib/python3.10/site-packages/flask/json/init.py", line 15, in
course_practical_guide_eks-resources-api-1 | from itsdangerous import json as _json
course_practical_guide_eks-resources-api-1 | ImportError: cannot import name 'json' from 'itsdangerous' (/usr/local/lib/python3.10/site-packages/itsdangerous/init.py)
course_practical_guide_eks-resources-api-1 | [2022-02-20 12:40:04 +0000] [8] [INFO] Worker exiting (pid: 8)
course_practical_guide_eks-resources-api-1 | [2022-02-20 12:40:04 +0000] [1] [INFO] Shutting down: Master
course_practical_guide_eks-resources-api-1 | [2022-02-20 12:40:04 +0000] [1] [INFO] Reason: Worker failed to boot.
course_practical_guide_eks-resources-api-1 exited with code 3

I have tried this with the following linux distros: Ubuntu 18.04, Ubuntu 20.04 and Amazon Linux 2. Always using the newest versions of docker: 20.10.7 and docker-compose v2.2.3

have issue following helm in Course_Practical_Guide_EKS course

krzyss-MacBook-Pro:helm krzys$ pwd
/Users/krzys/SynologyDrive/Course_Practical_Guide_EKS-master/resource-api/infra/helm
krzyss-MacBook-Pro:helm krzys$ helm upgrade --install --namespace development resource-api-development .
Release "resource-api-development" does not exist. Installing it now.
Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "Deployment" in version "apps/v1beta2"
krzyss-MacBook-Pro:helm krzys$

krzyss-MacBook-Pro:helm krzys$ helm version --short
v3.6.3+gd506314
krzyss-MacBook-Pro:helm krzys$ kubectl version --short
Client Version: v1.21.3
Server Version: v1.20.4-eks-6b7464
krzyss-MacBook-Pro:helm krzys$

not sure how to bypass this error

issue creating central-ingress

Hello there, found another issue with creating central-ingres LB

krzyss-MacBook-Pro:central-ingress krzys$ pwd
/Users/krzys/SynologyDrive/Course_Practical_Guide_EKS-master/Infrastructure/helm-charts/central-ingress
krzyss-MacBook-Pro:central-ingress krzys$ ./create.sh 
Missing the 'Namespace' parameter. Taking the default one which is 'development'
W0718 16:52:56.482630   88781 warnings.go:70] extensions/v1beta1 Ingress is deprecated in v1.14+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
W0718 16:52:56.517377   88781 warnings.go:70] extensions/v1beta1 Ingress is deprecated in v1.14+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
W0718 16:52:56.554850   88781 warnings.go:70] extensions/v1beta1 Ingress is deprecated in v1.14+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
Release "central-ingress-development" has been upgraded. Happy Helming!
NAME: central-ingress-development
LAST DEPLOYED: Sun Jul 18 16:52:55 2021
NAMESPACE: development
STATUS: deployed
REVISION: 6
TEST SUITE: None
krzyss-MacBook-Pro:central-ingress krzys$ 

seems like another change where they did depreciate this from new version. I think I found link where they describing the issue
https://www.civo.com/learn/migrating-your-ingresses-in-k3s-1-20

but I have no idea how to convert it, I did try to change few values that I found there but I just got errors and it did not work. Hope you can help me again with this issue

mimemagic 0.3.4 not available

When I ran a build I got an error that mimemagic 0.3.4 was unavailable -

Do you have a quick fix for this, my Ruby is poor to non-existent.

thx

[eksctl]: error creating cluster in us-east-1

A constant issue I keep running into when creating the cluster in us-east-1 is

2022-03-26 00:51:56 [✖]  AWS::EKS::Cluster/ControlPlane: CREATE_FAILED – "Resource handler returned message: \"Cannot create cluster 'eks-bookstore-project' because us-east-1e, the targeted availability zone, does not currently have sufficient capacity to support the cluster. Retry and choose from these availability zones: us-east-1a, us-east-1b, us-east-1c, us-east-1d, us-east-1f (Service: Eks, Status Code: 400, Request ID: 2d525fed-1b2e-460c-aa8a-6c747ffad5ac)\" (RequestToken: 958b48c7-6bc6-497c-8306-655de5a8b8bf, HandlerErrorCode: InvalidRequest)"

A good workaround would be to update the cluster.yaml files to include availabilityZones as a key as mentioned in the eksctl documentation and restrict the AZ's to only 3 or possibly 4 as per the needs of the course :)

My sample cluster.yaml file looks like this

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
  name: eks-bookstore-project
  region: us-east-1
  version: "1.20"

availabilityZones:
  - us-east-1a
  - us-east-1b
  - us-east-1c

vpc:
  cidr: 10.0.0.0/16

nodeGroups:
  - name: eks-node-group
    instanceType: t3.micro
    desiredCapacity: 3
    privateNetworking: true

I can create a PR for this if I have the 👍 from the course instructor.

proxy_1 nginx config permission denied

I'm currently observing this failure in the docker-compose up part:

proxy_1          | 2021/11/24 15:47:04 [emerg] 1#1: open() "/etc/nginx/conf.d/default.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:31
proxy_1          | nginx: [emerg] open() "/etc/nginx/conf.d/default.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:31

issue Alpine docker image on mac

for fixing the issue we need to use for front-end/Dockerfile

FROM node:carbon-alpine
WORKDIR /opt/forms
COPY package*.json ./
RUN apk add --no-cache --virtual .gyp
python
make
g++
&& npm install
&& apk del .gyp
COPY . ./
RUN npm run build

FROM nginx:1.15-alpine
COPY --from=0 /opt/forms/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf

Having trouble creating external ingress for prod

Chapter 5: Creation of the Production Environment - Part 2
Course_Practical_Guide_EKS/Infrastructure/helm-charts/central-ingress
Creating the 2 prod load balancers, I get the internal one but the external one is not created in EC2, also get some warnings:

$ ./create.sh prod
W1112 15:25:21.793656    1400 warnings.go:70] extensions/v1beta1 Ingress is deprecated in v1.14+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
W1112 15:25:21.824321    1400 warnings.go:70] extensions/v1beta1 Ingress is deprecated in v1.14+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
W1112 15:25:21.861043    1400 warnings.go:70] extensions/v1beta1 Ingress is deprecated in v1.14+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
W1112 15:25:21.975333    1400 warnings.go:70] extensions/v1beta1 Ingress is deprecated in v1.14+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
W1112 15:25:22.006066    1400 warnings.go:70] extensions/v1beta1 Ingress is deprecated in v1.14+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
W1112 15:25:22.045948    1400 warnings.go:70] extensions/v1beta1 Ingress is deprecated in v1.14+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
Release "central-ingress-prod" has been upgraded. Happy Helming!
NAME: central-ingress-prod
LAST DEPLOYED: Fri Nov 12 15:25:21 2021
NAMESPACE: prod
STATUS: deployed
REVISION: 5
TEST SUITE: None
$ kubectl get ingresses -n prod
NAME                       CLASS    HOSTS                                                                                             ADDRESS
                                                           PORTS   AGE
central-ingress-external   <none>   bookstore.x.com,api.x.com
                                                           80      57m
central-ingress-internal   <none>   renting-api.x.com,resource-api.x.com,inventory-api.x.com + 1 more...   internal-1xe8c3d1-prod-centralingre-9e08-xx.us-east-2.elb.amazonaws.com   80      57m

Is there something I need to update? No external ALB and the central-ingress-external doesn't get an ADDRESS either. Any help appreciated - thx

Python Version to Use

Hey 👋

For anyone following along in 2024, I ran into some issues regarding python modules not being available in the latest Python 3.12 version specifically urllib3.packages.six.moves and libc.

After some playing around and working my way from oldest python docker image to newest python docker image found that python:3.8-bullseye got the resources api back up and running.

I hope this saves someone some time and effore moving forward 😄

front-end container build has COPY failed error

I just did clone and docker-compose up and Build On MAC passed.
But I also tried on both Ubuntu and SUSE got the same error message as below
COPY failed: stat opt/forms/dist: file does not exist
Perhaps npm run build didn't generate files in dist folder? but how come built on MAC worked?
Can you please help?

Error logs from multiple apps after CI/CD chapter

As i am almost done with the course, i noticed that the clients-api doesn't work after the CI/CD chapter

fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
      An unhandled exception has occurred while executing the request.
System.MissingMethodException: Method n^Cs.ExceptionHandlerMiddleware[1]
      An unhandled exception has occurred while executing the request.
System.MissingMethodException: Method not found: 'Void Amazon.XRay.Recorder.Core.AWSXRayRecorderImpl.BeginSubsegment(System.String)'.
   at Amazon.XRay.Recorder.Handlers.AspNetCore.Internal.AWSXRayMiddleware.ProcessHTTPRequest(HttpContext context)
   at Amazon.XRay.Recorder.Handlers.AspNetCore.Internal.AWSXRayMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[3]
      An exception was thrown attempting to execute the error handler.

logs from the clients api pod

Examining the page i see there is an 500 error
image

Going to the https://api.dev.${domain}/clients-api end point returns the following
image

Next with the resources api when deleting a resource example:
Deleting a resource tries to use localhost
image

Are there any relevant code updates that have not been pushed that might be causing this? I am happy to provide more logs if needed or spend time to debug and fix the issues :) My main focus of the course was to get a refresher on the core concepts but happy to help in anyway possible

Thank you for the awesome course

Issue when initialize the EKS cluster

Hello,
I am encountering the following issue when using eksctl to initialize the EKS cluster.

2022-02-06 18:43:20 [✖] unexpected status "ROLLBACK_IN_PROGRESS" while waiting for CloudFormation stack "eksctl-eks-acg-nodegroup-eks-node-group"
2022-02-06 18:43:20 [ℹ] fetching stack events in attempt to troubleshoot the root cause of the failure
2022-02-06 18:43:20 [!] AWS::EC2::LaunchTemplate/NodeGroupLaunchTemplate: DELETE_IN_PROGRESS
2022-02-06 18:43:20 [!] AWS::EC2::SecurityGroupEgress/EgressInterClusterAPI: DELETE_IN_PROGRESS
2022-02-06 18:43:20 [!] AWS::EC2::SecurityGroupIngress/IngressInterClusterCP: DELETE_IN_PROGRESS
2022-02-06 18:43:20 [!] AWS::EC2::SecurityGroupEgress/EgressInterCluster: DELETE_IN_PROGRESS
2022-02-06 18:43:20 [✖] AWS::AutoScaling::AutoScalingGroup/NodeGroup: CREATE_FAILED – "You must use a valid fully-formed launch template. The requested configuration is currently not supported. Please check the documentation for supported configurations. (Service: AmazonAutoScaling; Status Code: 400; Error Code: ValidationError; Request ID: ******************; Proxy: null)"

I am following the course by using the command line to initialize the cluster. Only updated the cluster.yaml region setting to my default region.
eksctl create cluster -f cluster.yaml

Issue creating internal ALB for development

Initially I was having an issue with the Subnet tags. I added tag of kubernetes.io/cluster/eks-acg : shared into all Subnets.

Now I am getting a Security Group problem:

$ kubectl logs -n kube-system alb-ingress-controller-6dc55945f5-hfvhm
I0428 17:48:11.245900       1 security_group.go:36] development/central-ingress-internal: creating securityGroup 1ee8c3d1-development-centr-fc62:managed LoadBalancer securityGroup by ALB Ingress Controller
I0428 17:48:11.399506       1 tags.go:69] development/central-ingress-internal: modifying tags {  ingress.k8s.aws/resource: "ManagedLBSecurityGroup",  kubernetes.io/cluster-name: "eks-acg",  kubernetes.io/namespace: "development",  kubernetes.io/ingress-name: "central-ingress-internal",  ingress.k8s.aws/cluster: "eks-acg",  ingress.k8s.aws/stack: "development/central-ingress-internal"} on sg-06ec45032b3ed04ad
E0428 17:48:11.472221       1 controller.go:217] kubebuilder/controller "msg"="Reconciler error" "error"="failed to reconcile LB managed SecurityGroup: failed to reconcile managed LoadBalancer securityGroup due to failed to reconcile tags due to UnauthorizedOperation: You are not authorized to perform this operation. Encoded authorization failure message: 55D9MzRWNTBkPYQ6ejFCXjxCQn3q3-UTKsDnZ89ZLeH4UPNxQon9Mlgo_tumadEZ-OjCoAolP1ocMXmAN6HLakS4p9dfFUoSUz3hhVF56z0NZXbtl0HiSmtPnQG26RY__g3Gk-VALl2FzqMEJbkUvqK91G4MyzGcH-TWTcwIcFOdfQroO-dlrtmA_yB5oIS3qky1zANccHAUky3NY7S8eUNcxrrgdI87Q3naPrsTY85FOqF-KquagyM-QGG19sWPsnx75t60Ptv8rfzpI2aoahVbMw7Gg30Vn6YOjY3Cb0UhEvdtAzhj8ffDMwE02boq_E76EI_crk0Y3sjNcTxJru_JU4A4K4K1rJwVdT5URsk-7FXV0l9ig84NSdttIJLhfD-hsz5rtxv1GEUHwMSdzrcjdjKMVjZd6JfQUITMi_VPyXS8HOKZEhOTbEFug5azMkYYobu4QzLEggCEtre_1ne4lv0f-McHMDdTr6r36BVmL-TaRd_ncOw4qFIEwj-jkd7ehdDlViOp8q5qgAqCOq_AtF64F3uyd3UYcZqvtYcZScimGZ3QKHxVw8TdOdXgiW6nxZlO2sbn-YEiRbNHPX1haL974zFZojp3X74IKkGFdc4_ixgveMz5eG7Y_5BDFgfJTnYRuVcWUScsyhQPs8eaSUH9\n\tstatus code: 403, request id: fea48eee-8dcf-4561-8ee4-f16a16554081"  "controller"="alb-ingress-controller" "request"={"Namespace":"development","Name":"central-ingress-internal"}
I0428 17:48:11.472494       1 recorder.go:53] kubebuilder/manager/events "level"=1 "msg"="Warning"  "message"="error tagging sg-06ec45032b3ed04ad due to UnauthorizedOperation: You are not authorized to perform this operation. Encoded authorization failure message: 55D9MzRWNTBkPYQ6ejFCXjxCQn3q3-UTKsDnZ89ZLeH4UPNxQon9Mlgo_tumadEZ-OjCoAolP1ocMXmAN6HLakS4p9dfFUoSUz3hhVF56z0NZXbtl0HiSmtPnQG26RY__g3Gk-VALl2FzqMEJbkUvqK91G4MyzGcH-TWTcwIcFOdfQroO-dlrtmA_yB5oIS3qky1zANccHAUky3NY7S8eUNcxrrgdI87Q3naPrsTY85FOqF-KquagyM-QGG19sWPsnx75t60Ptv8rfzpI2aoahVbMw7Gg30Vn6YOjY3Cb0UhEvdtAzhj8ffDMwE02boq_E76EI_crk0Y3sjNcTxJru_JU4A4K4K1rJwVdT5URsk-7FXV0l9ig84NSdttIJLhfD-hsz5rtxv1GEUHwMSdzrcjdjKMVjZd6JfQUITMi_VPyXS8HOKZEhOTbEFug5azMkYYobu4QzLEggCEtre_1ne4lv0f-McHMDdTr6r36BVmL-TaRd_ncOw4qFIEwj-jkd7ehdDlViOp8q5qgAqCOq_AtF64F3uyd3UYcZqvtYcZScimGZ3QKHxVw8TdOdXgiW6nxZlO2sbn-YEiRbNHPX1haL974zFZojp3X74IKkGFdc4_ixgveMz5eG7Y_5BDFgfJTnYRuVcWUScsyhQPs8eaSUH9\n\tstatus code: 403, request id: fea48eee-8dcf-4561-8ee4-f16a16554081" "object"={"kind":"Ingress","namespace":"development","name":"central-ingress-internal","uid":"040adefb-66cc-4c36-9eea-f6477742f6e8","apiVersion":"extensions/v1beta1","resourceVersion":"260859"} "reason"="ERROR"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.