Skip to content

Latest commit

 

History

History
131 lines (87 loc) · 4.16 KB

README.md

File metadata and controls

131 lines (87 loc) · 4.16 KB

Task App Deployment

This repository contains the necessary code and configuration files for deploying a scalable task application using Kubernetes, Terraform, and Ansible. The application is built with a focus on resilience, monitoring, and automation.

Table of Contents

Introduction

This tutorial will guide you through the process of deploying a task application using Kubernetes, Terraform, and Ansible. The application is designed to be scalable and resilient, ensuring that it can handle increased demand and recover from failures. Throughout the tutorial, we will cover the following topics:

  • Creating the application and Dockerfile
  • Setting up the necessary configuration files
  • Automating the deployment process using Terraform and Ansible
  • Monitoring the application using Prometheus, Grafana, Elasticsearch, Fluentd, and Kibana
  • Scaling and updating the application using Kubernetes features

Prerequisites

Before you begin, ensure that you have the following tools installed and configured on your machine:

  • Docker
  • Kubernetes
  • Terraform
  • Ansible
  • kubectl
  • git

Getting Started

To get started, clone the repository and navigate to the project directory:

git clone https://github.com/kadirbelkuyu/task-app-deployment.git
cd task-app-deployment

Next, follow the instructions provided in the Application Deployment section to deploy the application using Kubernetes, Terraform, and Ansible.

Application Deployment

  1. Build the Docker image for the task application:
docker build -t your-dockerhub-username/task-app:latest .
  1. Push the Docker image to your container registry:
docker push your-dockerhub-username/task-app:latest
  1. Initialize and apply the Terraform configuration:
terraform init
terraform apply
  1. Run the Ansible playbook to configure the Kubernetes cluster:
ansible-playbook -i inventory.ini configure-cluster.yml
  1. Apply the Kubernetes manifests for the task application:
kubectl apply -f k8s/app/

Monitoring and Logging

To set up monitoring and logging, apply the Kubernetes manifests for Prometheus, Grafana, Elasticsearch, Fluentd, and Kibana:

ubectl apply -f k8s/monitoring/
kubectl apply -f k8s/logging/

Scaling and Updating

To scale the application using the Horizontal Pod Autoscaler (HPA), apply the corresponding Kubernetes manifest:

kubectl apply -f k8s/app/hpa.yaml

To update the application, make the necessary changes to your code, create a new Docker image, push it to your container registry, and update the image in your Kubernetes Deployment:

kubectl set image deployment/task-app task-app=your-dockerhub-username/task-app:updated-version

Additional Resources

For more information on Kubernetes, Terraform, and Ansible, consult the following documentation:

Demo Application

We have set up a demo application based on the configurations and code provided in this repository. You can find the demo application's source code on GitHub:

Task App Deployment Demo

Feel free to clone the repository, explore the code, and deploy the demo application on your own Kubernetes cluster.

Contributing

We welcome contributions and suggestions to improve this project. If you have any ideas or encounter any issues, please feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.