Skip to content

A beginner-level repository containing the necessary files and instructions to deploy a basic 3-tier application using Kubernetes.

Notifications You must be signed in to change notification settings

naveed-a-sattar/3-Tier-Kubernetes-App

Repository files navigation

3-Tier Beginner-Level Kubernetes Deployment

This repository contains the necessary files and instructions to deploy a basic 3-tier application using Kubernetes. The application consists of three components: a frontend, a backend, and a database. Each component will be deployed as a separate Kubernetes deployment, and the necessary services and ingress rules will be created to enable communication between the components.

Prerequisites

Before getting started, make sure you have the following prerequisites:

  • Kubernetes cluster: You should have a running Kubernetes cluster. You can use a local cluster like Minikube or a cloud-based Kubernetes service like Google Kubernetes Engine (GKE) or Amazon Elastic Kubernetes Service (EKS).

  • kubectl command-line tool: Install the kubectl command-line tool to interact with your Kubernetes cluster. You can find installation instructions in the official Kubernetes documentation.

Deployment Steps

Follow the steps below to deploy the 3-tier application on your Kubernetes cluster:

  1. Clone this repository:

    git clone https://github.com/your-username/3-tier-kubernetes-deployment.git
    cd 3-tier-kubernetes-deployment
    
  2. Deploy the database:

    kubectl apply -f database.yaml
    
  3. Deploy the backend:

    kubectl apply -f backend.yaml
    
  4. Deploy the frontend:

    kubectl apply -f frontend.yaml
    
  5. Verify the deployment:

    kubectl get pods
    

    Make sure all the pods are running and ready.

  6. Access the application:

    • If you are using Minikube, run the following command to get the frontend URL:

      minikube service frontend --url
      

      Open the URL in your web browser to access the application.

    • If you are using a cloud-based Kubernetes service, you might need to create an ingress resource or load balancer to expose the frontend service. Refer to your cloud provider's documentation for specific instructions.

  7. Cleanup: To delete the deployed resources, run the following commands:

    kubectl delete -f frontend.yaml
    kubectl delete -f backend.yaml
    kubectl delete -f database.yaml
    

Architecture

The application follows a simple 3-tier architecture:

  • Frontend: A web-based user interface that interacts with the backend API to retrieve and display data.

  • Backend: An API server that handles incoming requests from the frontend and retrieves data from the database.

  • Database: A database to store and retrieve data used by the backend.

The Kubernetes deployment files for each component (frontend.yaml, backend.yaml, and database.yaml) define the necessary containers, volumes, services, and deployments for each component.

Customization

Feel free to modify the deployment files to customize the application to your needs. You can update environment variables, container images, or resource limits based on your requirements.


That's it! This Readme file provides a basic overview of the 3-tier Kubernetes deployment, the deployment steps, and instructions for customization and cleanup. Make sure to provide the necessary YAML files (frontend.yaml, backend.yaml, and database.yaml) in the repository for users to deploy the application.

About

A beginner-level repository containing the necessary files and instructions to deploy a basic 3-tier application using Kubernetes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages