{"id":25019572,"url":"https://github.com/iambotcoder/portfolio-k8s-deployment","last_synced_at":"2026-02-13T06:04:34.396Z","repository":{"id":272473571,"uuid":"916701086","full_name":"iambotcoder/portfolio-k8s-deployment","owner":"iambotcoder","description":"AWS EKS-based deployment of a portfolio website using Docker, Kubernetes, and a LoadBalancer Service.","archived":false,"fork":false,"pushed_at":"2025-01-14T16:42:27.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-05T11:51:44.696Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/iambotcoder.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":"2025-01-14T15:54:02.000Z","updated_at":"2025-01-14T16:42:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"1614f037-5f97-4d7b-9a28-6f868ac24988","html_url":"https://github.com/iambotcoder/portfolio-k8s-deployment","commit_stats":null,"previous_names":["iambotcoder/portfolio-k8s-deployment"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iambotcoder%2Fportfolio-k8s-deployment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iambotcoder%2Fportfolio-k8s-deployment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iambotcoder%2Fportfolio-k8s-deployment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iambotcoder%2Fportfolio-k8s-deployment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iambotcoder","download_url":"https://codeload.github.com/iambotcoder/portfolio-k8s-deployment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246301997,"owners_count":20755514,"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":[],"created_at":"2025-02-05T11:51:03.650Z","updated_at":"2026-02-13T06:04:29.354Z","avatar_url":"https://github.com/iambotcoder.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 Portfolio Website Deployment Using Kubernetes (EKS)\n\n## 📖 Overview\nThis project demonstrates the deployment of a portfolio website using Kubernetes (EKS), Docker, and Docker Hub. It includes the steps for setting up EKS, building a custom Docker container, and deploying the application using Kubernetes services like LoadBalancer.\n\n---\n\n## 📑 Table of Contents\n- [Prerequisites](#prerequisites) 🔑\n- [Setup \u0026 Installation](#setup-and-installation) 🛠️\n- [Docker Setup](#docker-setup) 🐳\n- [Kubernetes Deployment](#kubernetes-deployment) 🏗️\n- [Accessing the Application](#accessing-the-application) 🌐\n- [Cleaning Up Resources](#cleaning-up-resources) 🧹\n- [Conclusion](#conclusion) ✅\n\n---\n\n## 🔑 Prerequisites\nBefore you start, ensure you have the following:\n- An AWS account 🌍\n- **eksctl** and **kubectl** installed for interacting with EKS cluster\n- **Docker** installed for building and pushing Docker images\n- A Docker Hub account for pushing your Docker images\n- Basic knowledge of Kubernetes and Docker 🧑‍💻\n\n---\n\n## 🗺️ Architecture\n\nThe architecture of the portfolio website deployment involves the following components:\n\n- **AWS EKS Cluster**: A managed Kubernetes cluster that hosts the application.\n- **Docker**: Used to build and containerize the website.\n- **LoadBalancer Service**: Exposes the website to the internet.\n- **Kubernetes Deployment**: Ensures the application is running in pods, with multiple replicas for scalability.\n\nThe application follows a microservices architecture, where the frontend service is independently deployed and managed.\n\n![Untitled design (3)](https://github.com/user-attachments/assets/915bb2d6-7cc0-4703-a9e6-d10b901130e9)\n\n---\n\n## 🛠️ Setup \u0026 Installation\n\n### 1️⃣ Install eksctl and kubectl\n- Install **eksctl** and **kubectl** following the official documentation.\n\n### 2️⃣ Create a Cluster for Your Portfolio Website\n\n```bash\neksctl create cluster --node-type t2.micro --nodes 2\neksctl get cluster\neksctl get nodes\n```\n\n---\n\n## 🐳 Docker Setup\n\n### 1️⃣ Install Docker\n- Download Docker and Docker Desktop from the official Docker website.\n- Create a Docker Hub account.\n\n### 2️⃣ Create a Dockerfile\nHere is the Dockerfile that configures your website container:\n\n```dockerfile\nFROM httpd\nCOPY assets/ /usr/local/apache2/htdocs/assets\nCOPY website-demo-image/ /usr/local/apache2/htdocs/website-demo-image\nCOPY error.html /usr/local/apache2/htdocs/error.html\nCOPY index.html /usr/local/apache2/htdocs/index.html\n```\n\n### 3️⃣ Build the Docker Image\nRun the following command to build your custom Docker image:\n\n```dockerfile\ndocker build -t custom-httpd .\ndocker images\n```\n\n### 4️⃣ Run the Container Locally\n```dockerfile\ndocker run -d -p 8080:80 custom-httpd\n```\n\n(If port 8080 is already in use, run on port 8081 instead.)\n\nTo check the locally hosted website, go to:\nhttp://localhost:8080\n\n### 5️⃣ Push the Docker Image to Docker Hub\n\n- Login to Docker Hub:\n\n```dockerfile\ndocker login --username=\u003cusername\u003e\n```\n\n- Tag and push the Docker image to your Docker Hub repository:\n```dockerfile\ndocker tag imageid \u003cdockerhubrepo\u003e/\u003cusername\u003e/custom-httpd\ndocker push \u003cusername\u003e/repo\n```\n---\n\n🏗️ ### Kubernetes Deployment\n\n1️⃣ Load Balancer and Deployment YAML\n\nHere’s the manifest file for the LoadBalancer service and deployment:\n\n```yaml\napiVersion: v1\nkind: Service\nmetadata:\n  name: lb-service\n  labels:\n    app: lb-service\nspec:\n  type: LoadBalancer\n  ports:\n  - port: 80\n  selector:\n    app: frontend\n---\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: frontend-deployment\nspec:\n  replicas: 2\n  selector:\n    matchLabels:\n      app: frontend\n  minReadySeconds: 30\n  strategy:\n    type: RollingUpdate\n    rollingUpdate:\n      maxSurge: 1\n      maxUnavailable: 0\n  template:\n    metadata:\n      labels:\n        app: frontend\n    spec:\n      containers:\n      - name: frontend-container\n        image: \u003cdockerhubrepolink\u003e\n```\n2️⃣ Deploy the Application\n\nUse the following command to deploy the LoadBalancer service and the frontend application:\n\n```bash\nkubectl apply -f loadbalancerservice.yaml\nkubectl get all\n```\nThis will create 2 pods for your frontend application.\n\n3️⃣ Access the Running Container\n\nTo enter the running container:\n\n```bash\nkubectl exec -it \u003cpod-name\u003e -- /bin/sh\n```\n\nYou can verify the files inside the container by using the `ls` command.\n\n4️⃣ Access the Website\n\nTo get the LoadBalancer URL:\n\n```bash\nkubectl get service\n```\n\n---\n\n## 💻 Output\n\nAfter successful deployment, you can access the portfolio website via the LoadBalancer URL. The website should be available and accessible from the internet, displaying the portfolio content.\n\nExample of access:\n- Open the LoadBalancer URL obtained from the `kubectl get service` command in the browser.\n- The website will be visible, served from the containerized application.\n\n![Screenshot 2025-01-11 183844](https://github.com/user-attachments/assets/9592a457-71c5-481e-9143-82a338c54b8b)\n\n---\n\n### 🧹 Cleaning Up Resources\n\nTo delete the Kubernetes resources (deployment and service), run the following commands:\n\n```bash\nkubectl delete deployment \u003cpod-name\u003e\nkubectl delete service lb-service\n```\n\nThis will remove the deployed application and associated resources from your cluster.\n\n---\n\n### ✅ Conclusion\n\nThis project demonstrates how to deploy a portfolio website using Kubernetes on AWS EKS. It covers the steps to set up the environment, build a custom Docker container, push the container to Docker Hub, and deploy it on Kubernetes using LoadBalancer services. This setup enables seamless access to the website via a scalable architecture.\n\n---\n## 👨‍🏫 Instructor\n\nThis project was guided by **Rajdeep Saha**, who provided valuable mentorship throughout the process.\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiambotcoder%2Fportfolio-k8s-deployment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiambotcoder%2Fportfolio-k8s-deployment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiambotcoder%2Fportfolio-k8s-deployment/lists"}