Skip to content

Commit 5d61dcf

Browse files
committed
Add Pod and Cluster auto-scaling example based on service requests-per-second using Karpenter, Prometheus, and Keda
1 parent faf0173 commit 5d61dcf

55 files changed

Lines changed: 926 additions & 11 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# EBS CSI Driver
2+
3+
The [EBS CSI Driver](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/master/docs/install.md) can be deployed using the `./deploy.sh` script provided here. The driver requires your instance role to have certain permissions which may not be granted by default.
4+
If EBS volume provisioning is not working, please check that your instance role has the AmazonEBSCSIDriverPolicy added.
5+
If you require snapshotting, install the [CSI Snapshotter Controller and CRD](https://github.com/kubernetes-csi/external-snapshotter).
6+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Horizontal Pod Autoscaling
2+
3+
The [Horizontal Pod Autoscaler](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) is included in the base set of Kubernetes resources that comes included with any new cluster.
4+
5+
The `hpa-example` folder contains a simple php-apache microservice which can be built and deployed to illustrate how HPA works. The example requires `metrics-server` to be deployed on the cluster. A script for that is provided in the `/eks/deployment` directory.
6+
7+
[KEDA](keda.sh) is a Kubernetes Event Driven Autoscaler which works alongside standard horizontal pod autoscaler and enables scaling based on various events. Refer to the `keda` directory for deployment.
8+

Container-Root/eks/deployment/horizontal-pod-autoscaler/example/Dockerfile

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.yaml
2+
*.sh
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
export IMAGE=php-apache
4+
export TAG=:latest
5+
export REGION=$(aws configure get region)
6+
export ACCOUNT=$(aws sts get-caller-identity --query Account --output text)
7+
export REGISTRY=${ACCOUNT}.dkr.ecr.${REGION}.amazonaws.com/
8+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./php-apache.yaml
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM php:5-apache
2+
COPY index.php /var/www/html/index.php
3+
RUN mkdir -p /var/www/html/php-apache; ln -s /var/www/html/index.php /var/www/html/php-apache/index.php; mkdir -p /var/www/html/hpa-example; ln -s /var/www/html/index.php /var/www/html/hpa-example/index.php
4+
RUN chmod a+rx index.php
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
source .env
4+
5+
# Build Docker image
6+
docker image build ${BUILD_OPTS} -t ${REGISTRY}${IMAGE}${TAG} -f Dockerfile .
7+

Container-Root/eks/deployment/horizontal-pod-autoscaler/example/example.sh renamed to Container-Root/eks/deployment/horizontal-pod-autoscaler/hpa-example/example.sh

File renamed without changes.

0 commit comments

Comments
 (0)