Skip to content

DigoqueDigo/shotkube

Repository files navigation

ShotKube

A cloud-native deployment and provisioning project for the Moonshot application. Designed with scalability, automation, and observability in mind, this project uses Kubernetes, Ansible, Docker, and Google Cloud to manage deployment pipelines, handle infrastructure provisioning, and execute performance tests in real-world scenarios.

k8s


πŸ“Œ Overview

  • Automate the provisioning and deployment of a multilayer application
  • Ensure service availability, scalability, and fault tolerance
  • Monitor system performance using real workloads and metrics
  • Use modern tools such as Kubernetes, Prometheus, Grafana, Docker, and GCP

πŸš€ Deployment

To automate the deployment and testing process on Google Kubernetes Engine (GKE), use the following Ansible playbooks:


πŸ› οΈ Create and Destroy GKE Cluster

ansible-playbook -i inventory/gcp.yml gke-cluster-create.yml
# To destroy the cluster
ansible-playbook -i inventory/gcp.yml gke-cluster-destroy.yml

πŸ“¦ Deploy and Undeploy Moonshot

ansible-playbook -i inventory/gcp.yml moonshot-deploy.yml
# To undeploy the application
ansible-playbook -i inventory/gcp.yml moonshot-undeploy.yml

πŸ”¬ Run Load Tests

ansible-playbook -i inventory/gcp.yml load-test.yml

βœ… Execute All Tests (Deployment + Load Testing + Monitoring)

ansible-playbook -i inventory/gcp.yml test-all.yml

πŸ“Š Metrics

Monitoring plays a crucial role in assessing the health, performance, and resilience of the Moonshot system. This project uses Prometheus to collect metrics and Grafana to visualize them via dashboards.

Pod-Level Metrics

  • CPU & Memory Usage: Tracks resource consumption to detect saturation and trigger HPA scaling
  • Network Throughput: Monitors incoming/outgoing data for bottlenecks and bandwidth usage
  • Storage Usage: Observes ephemeral and persistent volume usage, ensuring there's no disk exhaustion
Metric Graphic
CPU usage pod_cpu
Memory usage pod_memory
Volume usage pod_volume
Ephemeral storage usage pod_ephemeral_storage
Transmission throughput pod_bytes_transmitted
Reception throughput pod_bytes_received

Node-Level Metrics

  • Resource Distribution: Ensures that load is balanced across the Kubernetes nodes
  • CPU & RAM: Helps determine whether the nodes are over or under-utilized, which informs autoscaling needs
Metric Graphic
CPU usage vm_cpu
Memory usage vm_memory

Client-Side Metrics (via k6 / JMeter)

  • Request Duration: Measures latency and responsiveness of the application under different loads
  • Request Rate: Indicates throughput capacity of the system
  • Failed Requests: Alerts on system failures and backend unavailability during stress tests
Metric Graphic
HTTP overview test_2_http_overview
HTTP request duration test_2_http_request_duration
HTTP request receiving test_2_http_request_receiving

Workload Testing

  • Simple Workload: Simulates 300 virtual users hitting /api/health to test autoscaling of the application server
  • Complex Workload: Simulates 20 users performing login and certificate creation, stressing the database and I/O

About

Cloud-native deployment and monitoring project for the Moonshot application, includes automated provisioning, scaling, load testing, and system observability.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors