A simple Flask web-app for Hepsiburada's DevOps challenge
2.7K
This challenge should demonstrate that you understand the world of containers and microservices. We want to build a simple but resilient Hello World app, deploy it to Kubernetes as a minimal. There are 4 main Challenges:

kubespray: Kubespray is a composition of Ansible playbooks, inventory,
provisioning tools, and domain knowledge for generic OS/Kubernetes clusters
configuration management tasks. Kubespray provides: a highly available
cluster. composable attributes. support for most popular Linux distributionsflask-prometheus-exporter: A python Library used for generating metrics that
prometheus can scrape.helm: A package manager for kubernetes. Used in the deployment of prometheus-operator
and prometheus-adapter.prometheus: Prometheus is a free software application used for
event monitoring and alerting. It records real-time metrics in a time series
database built using a HTTP pull model, with flexible queries and real-time
alerting.prometheus-operator: Prometheus Operator is a tool created by CoreOS to
simplify deployment and management of Prometheus instances in K8s.prometheus-adapter: Prometheus Adapter is required for using Custom Metrics
API in K8s. It is used primarily for Horizontal Pod Autoscaler to scale based
on metrics retrieved from Prometheus.github-actions: GitHub actions is used to automatically deploy docker images
and update the hello-hepsiburada deployment in kubernetes with ssh. Check out
main.yml to view the entire pipeline.kubernetes-python-client: The Python Client of Kubernetes is used to list cluster
objects in the cluster.| R Linux Distro | Specs | Region | IPv4 | private IP |
|---|---|---|---|---|
| Ubuntu 20.04 (LTS) x64 | 1vCPUs 2GB / 50GB Disk ($10/mo) | LON | 138.68.188.217 | 10.106.0.2 |
| Ubuntu 20.04 (LTS) x64 | 1vCPUs 2GB / 50GB Disk ($10/mo) | LON | 138.68.179.98 | 10.106.0.4 |
| Ubuntu 20.04 (LTS) x64 | 1vCPUs 2GB / 50GB Disk ($10/mo) | LON | 138.68.179.98 | 10.106.0.3 |
ansible-playbook -i hosts.ini --become --become-user=root kubespray/cluster.yml
kube-prometheus-stack and prometheus-adapter with helm using custom helm valueshelm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm install prometheus-operator prometheus-community/kube-prometheus-stack -f k8s/helm-values/prometheus-operator-values.yml
helm install prometheus-adapter prometheus-community/prometheus-adapter -f k8s/helm-values/prometheus-adapter-values.yml
kubectl apply -f k8s/webapp


Use this command to watch the horizontal pod autoscaler, deployments and pods.
watch -n 1 "kubectl get hpa,deployment,pods -o wide && kubectl top nodes"
Use this command to trigger the horizontal pod autoscaler.
while true; do sleep 1; curl http://138.68.188.217:32472; echo -e '\n\n\n\n'$(date);done
Content type
Image
Digest
Size
123.1 MB
Last updated
over 5 years ago
docker pull denizgokcin/hepsiburada-devops-challenge