Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

18 Commits

Folders and files

Repository files navigation

Kubernetes DevOps Project This project demonstrates how to deploy and manage a simple DevOps application using Docker and Kubernetes. The goal is to containerize the application, deploy it using Kubernetes, and expose it via a service.

Project Structure Dockerfile: Contains the instructions to build the Docker image for the DevOps application.

Kubernetes YAML files: Configuration files to deploy the application to a Kubernetes cluster, including Pods, Deployments, and Services.

Prerequisites Before you begin, ensure you have the following tools installed:

Docker (for building and running Docker containers)

Kubernetes (for orchestrating containers)

kubectl (command-line tool to interact with Kubernetes)

Docker Desktop (for local Kubernetes cluster)

Steps to Run the Application

  1. Build the Docker Image First, build the Docker image for the application. Navigate to the project directory and run:

bash Copy Edit docker build -t my-devops-app .

  1. Push Docker Image to Docker Hub (Optional) If you want to use your image in Kubernetes, you need to push it to a container registry like Docker Hub.

bash Copy Edit docker login docker tag my-devops-app /my-devops-app docker push /my-devops-app

  1. Create Kubernetes Deployment Apply the Kubernetes deployment configuration to deploy the application. This will create a Pod running your Docker image.

bash Copy Edit kubectl apply -f deployment.yaml

  1. Expose the Application via a Service To expose your application, apply the service configuration.

bash Copy Edit kubectl apply -f service.yaml 5. Check the Pod Status Ensure that the Pod is running correctly by checking its status:

bash Copy Edit kubectl get pods You should see something like this:

perl Copy Edit NAME READY STATUS RESTARTS AGE my-devops-app-xxxxxxxxxx-xxxxx 1/1 Running 0 1m

  1. Port Forward to Access the Application Once the Pod is running, you can access the application locally using kubectl port-forward:

bash Copy Edit kubectl port-forward service/my-devops-app-service 8080:8080 Now you can access your application at http://localhost:8080.

Troubleshooting If you encounter issues with pulling the Docker image, ensure your image is pushed to Docker Hub (or any container registry) and the registry is accessible.

If the Kubernetes Pod status shows ImagePullBackOff, it typically means the image is not found or there are permission issues.

Conclusion This project demonstrates a basic Kubernetes deployment workflow for a DevOps application. You can modify this setup to suit more complex applications and environments.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages