{"id":19373759,"url":"https://github.com/waelson/cloud-native-orchestration-calculator-api","last_synced_at":"2026-04-14T19:31:18.316Z","repository":{"id":120616891,"uuid":"258503881","full_name":"Waelson/Cloud-Native-Orchestration-Calculator-API","owner":"Waelson","description":"This repository  demonstrate how you can to orchestrate deploy an API on Kubernetes in the AWS environment. ","archived":false,"fork":false,"pushed_at":"2020-05-09T12:07:08.000Z","size":2502,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-22T17:50:32.723Z","etag":null,"topics":["cluster","docker","docker-compose","ec2-instance","jenkins","kubectl","kubectl-command","kubernetes","python","shell-script","ubuntu"],"latest_commit_sha":null,"homepage":"","language":"Python","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/Waelson.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":"2020-04-24T12:17:45.000Z","updated_at":"2020-11-24T12:55:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"07683d08-b6ca-4e7c-b22a-102363038d70","html_url":"https://github.com/Waelson/Cloud-Native-Orchestration-Calculator-API","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Waelson/Cloud-Native-Orchestration-Calculator-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Waelson%2FCloud-Native-Orchestration-Calculator-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Waelson%2FCloud-Native-Orchestration-Calculator-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Waelson%2FCloud-Native-Orchestration-Calculator-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Waelson%2FCloud-Native-Orchestration-Calculator-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Waelson","download_url":"https://codeload.github.com/Waelson/Cloud-Native-Orchestration-Calculator-API/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Waelson%2FCloud-Native-Orchestration-Calculator-API/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31812968,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"ssl_error","status_checked_at":"2026-04-14T18:05:01.765Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cluster","docker","docker-compose","ec2-instance","jenkins","kubectl","kubectl-command","kubernetes","python","shell-script","ubuntu"],"created_at":"2024-11-10T08:31:34.724Z","updated_at":"2026-04-14T19:31:18.295Z","avatar_url":"https://github.com/Waelson.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003ch2\u003eCloud Native Orchestration\u003c/h2\u003e\n\n\u003cstrong\u003eCapstone project for Udacity's Cloud DevOps Engineer\u003c/strong\u003e\u003cbr/\u003e\n\n\u003ch3\u003e:heavy_check_mark: Description\u003c/h3\u003e\nThis project consists of deploying an API on Kubernetes using deployment Rolling Update strategy.\u003cbr/\u003e The application used in this project is based on Python and Flask. This project has a single endpoint:\u003cbr/\u003e\u003cbr/\u003e\n\u003cul\u003e\n  \u003cli\u003e\u003cstrong\u003e/api/v0/multiply\u003c/strong\u003e\u003c/li\u003e\n  \u003cul\u003e\n    \u003cli\u003eUsage: \u003ccode\u003ehttp://localhost:5001/api/v0/multiply?param1=12\u0026#38;param2=2\u003c/code\u003e\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/ul\u003e\n\n\u003ch3\u003e:heavy_check_mark: Content of Repository\u003c/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n    :file_folder: Folders\n    \u003cul\u003e\n      \u003cli\u003e:page_facing_up: \u003ccode\u003epipelines\u003c/code\u003e - Definitions of the pipeline used by Jenkins \u003c/li\u003e\n      \u003cli\u003e:page_facing_up: \u003ccode\u003edescriptors-k8s\u003c/code\u003e - Descriptors to deploy application in the Kubernetes \u003c/li\u003e\n      \u003cli\u003e:page_facing_up: \u003ccode\u003eimages\u003c/code\u003e - Evidences of pipeline operation\u003c/li\u003e      \n    \u003c/ul\u003e\n  \u003c/li\u003e\n  \u003cli\u003e:page_facing_up: \u003ccode\u003eDockerfile\u003c/code\u003e - Docker descriptor\u003c/li\u003e\n  \u003cli\u003e:page_facing_up: \u003ccode\u003emain.py\u003c/code\u003e - Web application\u003c/li\u003e\n  \u003cli\u003e:page_facing_up: \u003ccode\u003erequirements.txt\u003c/code\u003e - Definitions of dependencies of the application\u003c/li\u003e\n  \u003cli\u003e:page_facing_up: \u003ccode\u003erun_docker.sh\u003c/code\u003e - Script to build docker image\u003c/li\u003e  \n\u003c/ul\u003e\n\n\u003ch3\u003e:heavy_check_mark: Preparing CI/CD Environment\u003c/h3\u003e\nIt was used Jenkins to automate manage of the Cluster Kubernetes and Application on AWS EC2 Instance based on Ubuntu 18.04 image. \u003cbr/\u003e\u003cbr/\u003e\n\u003cstrong\u003eRequirements:\u003c/strong\u003e\n\u003cul\u003e\n  \u003cli\u003e\n    Java\n    \u003cul\u003e\n      \u003cli\u003e\u003ccode\u003e$ sudo apt-get update\u003c/code\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ccode\u003e$ sudo apt install -y default-jdk\u003c/code\u003e\u003c/li\u003e\n    \u003c/ul\u003e\n  \u003c/li\u003e\n  \u003cli\u003e\n    Jenkins\n    \u003cul\u003e  \n      \u003cli\u003e\u003ccode\u003e$ wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -\u003c/code\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ccode\u003e$ sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ \u003e /etc/apt/sources.list.d/jenkins.list'\u003c/code\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ccode\u003e$ sudo apt-get update\u003c/code\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ccode\u003e$ sudo apt-get install jenkins\u003c/code\u003e\u003c/li\u003e     \n      \u003cli\u003e\u003ccode\u003e$ sudo systemctl start jenkins\u003c/code\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ccode\u003e$ sudo systemctl enable jenkins\u003c/code\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ccode\u003e$ sudo systemctl status jenkins\u003c/code\u003e\u003c/li\u003e      \n    \u003c/ul\u003e\n  \u003c/li\u003e\n  \n  \u003cli\u003e\n    Jenkins Plugins\n    \u003cul\u003e\n      \u003cli\u003eBlue Ocean\u003c/li\u003e\n      \u003cli\u003ePipeline: AWS Steps\u003c/li\u003e\n      \u003cli\u003eCloudBees AWS Credentials\u003c/li\u003e      \n    \u003c/ul\u003e\n  \u003c/li\u003e\n  \n  \u003cli\u003e\n    Python and other tools\n    \u003cul\u003e      \n      \u003cli\u003e\u003ccode\u003e$ sudo apt install python3\u003c/code\u003e\u003c/li\u003e      \n      \u003cli\u003e\u003ccode\u003e$ sudo apt install python3-pip\u003c/code\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ccode\u003e$ sudo apt install virtualenv\u003c/code\u003e\u003c/li\u003e \n      \u003cli\u003e\u003ccode\u003e$ sudo pip install pylint \u0026\u0026 pip install pylint --upgrade\u003c/code\u003e\u003c/li\u003e       \n      \u003cli\u003e\u003ccode\u003e$sudo cp /home/\u003cyour user\u003e/.local/bin/pylint /usr/local/bin\u003c/code\u003e\u003c/li\u003e\n    \u003c/ul\u003e  \n  \u003c/li\u003e    \n  \n  \u003cli\u003e\n    Pip for Python\n    \u003cul\u003e\n      \u003cli\u003e\u003ccode\u003e$ sudo apt install python-pip\u003c/code\u003e\u003c/li\u003e\n    \u003c/ul\u003e  \n  \u003c/li\u003e  \n  \n  \u003cli\u003e\n    AWS Client V2.0\n    \u003cul\u003e  \n      \u003cli\u003e\u003ccode\u003e$ curl \"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\" -o \"awscliv2.zip\"\u003c/code\u003e\u003c/li\u003e  \n      \u003cli\u003e\u003ccode\u003e$ unzip awscliv2.zip\u003c/code\u003e\u003c/li\u003e  \n      \u003cli\u003e\u003ccode\u003e$ sudo ./aws/install\u003c/code\u003e\u003c/li\u003e        \n    \u003c/ul\u003e\n  \u003c/li\u003e\n  \n  \u003cli\u003e\n    EKSCTL\n    \u003cul\u003e\n      \u003cli\u003e\u003ccode\u003e$ curl --silent --location \"https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz\" | tar xz -C /tmp\u003c/code\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ccode\u003e$ sudo mv /tmp/eksctl /usr/local/bin\u003c/code\u003e\u003c/li\u003e\n    \u003c/ul\u003e    \n  \u003c/li\u003e\n  \n  \u003cli\u003e\n    AWS-IAM-Authenticator\n    \u003cul\u003e\n      \u003cli\u003e\u003ccode\u003e$ curl -o aws-iam-authenticator https://amazon-eks.s3.us-west-2.amazonaws.com/1.15.10/2020-02-22/bin/linux/amd64/aws-iam-authenticator\u003c/code\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ccode\u003e$ chmod +x ./aws-iam-authenticator\u003c/code\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ccode\u003e$ sudo mv aws-iam-authenticator /usr/local/bin\u003c/code\u003e\u003c/li\u003e      \n    \u003c/ul\u003e    \n  \u003c/li\u003e\n  \n  \u003cli\u003e\n    Docker Engine\n    \u003cul\u003e      \n      \u003cli\u003e\u003ccode\u003e$ sudo add-apt-repository \"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\"\u003c/code\u003e\u003c/li\u003e       \n      \u003cli\u003e\u003ccode\u003e$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -\u003c/code\u003e\u003c/li\u003e       \n      \u003cli\u003e\u003ccode\u003e$ sudo apt-get update\u003c/code\u003e\u003c/li\u003e      \n      \u003cli\u003e\u003ccode\u003e$ sudo apt-get install docker-ce docker-ce-cli containerd.io\u003c/code\u003e\u003c/li\u003e \n      \u003cli\u003e\u003ccode\u003e$ sudo chmod 777 /var/run/docker.sock\u003c/code\u003e\u003c/li\u003e       \n    \u003c/ul\u003e\n  \u003c/li\u003e\n  \u003cli\u003e\n    Hadolint\n    \u003cul\u003e      \n      \u003cli\u003e\u003ccode\u003e$ wget https://github.com/hadolint/hadolint/releases/download/v1.1/hadolint_linux_amd64\u003c/code\u003e\u003c/li\u003e    \n      \u003cli\u003e\u003ccode\u003e$ sudo chmod +x hadolint_linux_amd64\u003c/code\u003e\u003c/li\u003e    \n      \u003cli\u003e\u003ccode\u003e$ sudo mv hadolint_linux_amd64 hadolint\u003c/code\u003e\u003c/li\u003e          \n      \u003cli\u003e\u003ccode\u003e$ sudo mv hadolint /usr/local/bin\u003c/code\u003e\u003c/li\u003e      \n    \u003c/ul\u003e  \n  \n  \u003cli\u003e\n    Kubectl\n    \u003cul\u003e  \n      \u003cli\u003e\u003ccode\u003e$ curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.18.0/bin/linux/amd64/kubectl\u003c/code\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ccode\u003e$ chmod +x ./kubectl\u003c/code\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ccode\u003e$ sudo mv ./kubectl /usr/local/bin/kubectl\u003c/code\u003e\u003c/li\u003e      \n    \u003c/ul\u003e\n  \u003c/li\u003e\n  \n  \u003cli\u003e\n    Shopfy/krane\n    \u003cul\u003e\n      \u003cli\u003e\u003ccode\u003e$ sudo apt install ruby-full\u003c/code\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ccode\u003e$ sudo gem install rake\u003c/code\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ccode\u003e$ sudo gem install rainbow -v '2.2.2'\u003c/code\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ccode\u003e$ sudo gem install krane\u003c/code\u003e\u003c/li\u003e      \n    \u003c/ul\u003e\n  \u003c/li\u003e\n\u003c/ul\u003e\n\u003cbr/\u003e\n:bulb: \u003cstrong\u003eTip - Use AIM Role:\u003c/strong\u003e\u003cbr/\u003e\nCreate a AIM Role with all policies \u003ci\u003eAmazonEKS*\u003c/i\u003e and attach it on EC2 Instance running Jenkins. This way you don't need to configure your credentials into EC2 instance.\u003cbr/\u003e\n\u003cimg width=\"75%\" height=\"75%\" src=\"https://github.com/Waelson/CapstoneProjectForUdacity-CalculatorAPI/blob/master/images/amazon_eks_policies.png\"/\u003e\n\n\u003ch3\u003e:heavy_check_mark: Validating Environment\u003c/h3\u003e\n\n1 - Connect to EC2 instance and execute the command below to create a cluster with 3 nodes. This command can to take about 15 minutes to finish. Be patient!\u003cbr/\u003e\n\u003ccode\u003e$ eksctl create cluster --name \u0026#60;cluster-name\u0026#62; --region \u0026#60;region\u0026#62; --nodegroup-name standard-workers --node-type t3.medium --nodes 3 --nodes-min 1 --nodes-max 4 --managed\u003c/code\u003e\u003cbr/\u003e\n\u003ca href=\"https://gyazo.com/0529950fbd5198c004ec10413389f494\"\u003e\u003cimg src=\"https://i.gyazo.com/0529950fbd5198c004ec10413389f494.gif\" alt=\"Image from Gyazo\" width=\"674\"/\u003e\u003c/a\u003e\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n2 - Next, we need to update \u003ccode\u003e˜/.kube/config\u003c/code\u003e file, so that you can use the \u003ccode\u003ekubectl\u003c/code\u003e command.\u003cbr/\u003e\n\u003ccode\u003e$ aws eks update-kubeconfig --name \u0026#60;cluster-name\u0026#62; --region \u0026#60;region\u0026#62;\u003c/code\u003e\u003cbr/\u003e\n\u003ca href=\"https://gyazo.com/1611c73a4c384a2ec677819fdebe07cb\"\u003e\u003cimg src=\"https://i.gyazo.com/1611c73a4c384a2ec677819fdebe07cb.gif\" alt=\"Image from Gyazo\" width=\"724\"/\u003e\u003c/a\u003e\n\u003c/br\u003e\n\u003cbr/\u003e\n\n3 - Now, we let's get information of the cluster using \u003ccode\u003ekubectl\u003c/code\u003e command.\u003cbr/\u003e\n\u003ccode\u003e$ kubectl cluster-info\u003c/code\u003e\u003cbr/\u003e\n\u003ca href=\"https://gyazo.com/9f353a6bb9e919da6edc4d4006359b22\"\u003e\u003cimg src=\"https://i.gyazo.com/9f353a6bb9e919da6edc4d4006359b22.gif\" alt=\"Image from Gyazo\" width=\"728\"/\u003e\u003c/a\u003e\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n4 - Finally, delete cluster.\u003cbr/\u003e\n\u003ccode\u003e$ eksctl delete cluster cluster --name \u0026#60;cluster-name\u0026#62; --region \u0026#60;region\u0026#62;\u003c/code\u003e\u003cbr/\u003e\n\u003ca href=\"https://gyazo.com/67fa248990144b570e26169946e4b476\"\u003e\u003cimg src=\"https://i.gyazo.com/67fa248990144b570e26169946e4b476.gif\" alt=\"Image from Gyazo\" width=\"724\"/\u003e\u003c/a\u003e\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n\u003ch3\u003e:heavy_check_mark: Rolling Update Release\u003c/h3\u003e\nAs defined by the website kubernetes.io, rolling updates is a strategy that allow you deployments' update to take place with zero downtime by incrementally updating Pods instances with new ones. \n\u003cbr/\u003e\nBelow snnipet code from the file \u003ccode\u003edeployment.yaml\u003c/code\u003e used in this project to deploy application.\u003cbr/\u003e\u003cbr/\u003e\n\n```\n...\nspec:\n  replicas: 2\n  strategy:\n    type: RollingUpdate\n    rollingUpdate:\n      maxUnavailable: 50%\n      maxSurge: 1\n...\n```\n\n\u003cbr/\u003e\n\n\u003ch3\u003e:heavy_check_mark: References\u003c/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eGetting started with EKSCTL - \u003ca href=\"https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html\"\u003ehttps://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003eLaunch a guest book application - \u003ca href=\"https://docs.aws.amazon.com/eks/latest/userguide/eks-guestbook.html\"\u003ehttps://docs.aws.amazon.com/eks/latest/userguide/eks-guestbook.html\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003eCreate a SSH Key - \u003ca href=\"https://eksworkshop.com/prerequisites/sshkey.html\"\u003ehttps://eksworkshop.com/prerequisites/sshkey.html\u003c/a\u003e\u003c/li\u003e  \n  \u003cli\u003eInstall Jenkins on Ubuntu - \u003ca href=\"https://wiki.jenkins.io/display/JENKINS/Installing+Jenkins+on+Ubuntu\"\u003ehttps://wiki.jenkins.io/display/JENKINS/Installing+Jenkins+on+Ubuntu\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003eHow to Install Pip on Ubuntu 18.04 - \u003ca href=\"https://linuxize.com/post/how-to-install-pip-on-ubuntu-18.04/\"\u003ehttps://linuxize.com/post/how-to-install-pip-on-ubuntu-18.04/\u003c/a\u003e\u003c/li\u003e  \n  \u003cli\u003eInstall Docker Engine on Ubuntu - \u003ca href=\"https://docs.docker.com/engine/install/ubuntu/\"\u003ehttps://docs.docker.com/engine/install/ubuntu/\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003eInstalling aws-iam-authenticator - \u003ca href=\"https://docs.aws.amazon.com/eks/latest/userguide/install-aws-iam-authenticator.html\"\u003ehttps://docs.aws.amazon.com/eks/latest/userguide/install-aws-iam-authenticator.html\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003eInstall and Set Up kubectl - \u003ca href=\"https://kubernetes.io/docs/tasks/tools/install-kubectl/\"\u003ehttps://kubernetes.io/docs/tasks/tools/install-kubectl/\u003c/a\u003e\u003c/li\u003e  \n  \u003cli\u003eShopfy/krane - \u003ca href=\"https://github.com/Shopify/krane\"\u003ehttps://github.com/Shopify/krane\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003eHadolint v1.1 - \u003ca href=\"https://github.com/hadolint/hadolint/releases/tag/v1.1\"\u003ehttps://github.com/hadolint/hadolint/releases/tag/v1.1\u003c/li\u003e\n\u003c/ul\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaelson%2Fcloud-native-orchestration-calculator-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaelson%2Fcloud-native-orchestration-calculator-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaelson%2Fcloud-native-orchestration-calculator-api/lists"}