Skip to content

Commit ecb684b

Browse files
authored
Merge pull request #76 from ThreaditApp/dev
Updated main (HPA configuration update)
2 parents e83a096 + ee222f5 commit ecb684b

File tree

9 files changed

+64
-56
lines changed

9 files changed

+64
-56
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ jobs:
9595
run: |
9696
helm repo add traefik https://traefik.github.io/charts
9797
helm repo update
98-
helm upgrade --install traefik traefik/traefik -n $CLUSTER_NAME -f traefik/values.yaml
99-
100-
kubectl apply -n $CLUSTER_NAME -f traefik/cors.yaml
101-
kubectl apply -n $CLUSTER_NAME -f traefik/strip-prefix.yaml
98+
99+
helm upgrade --install traefik traefik/traefik -n $CLUSTER_NAME -f traefik/resources.yaml
100+
kubectl apply -n $CLUSTER_NAME -f traefik/ingress.yaml
101+
kubectl apply -n $CLUSTER_NAME -f traefik/hpa-config.yaml
102102
103103
- name: Create Kubernetes secrets
104104
run: |

code/kubernetes/grpc-gateway/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ spec:
9696
kind: Deployment
9797
name: grpc-gateway
9898
minReplicas: 1
99-
maxReplicas: 3
99+
maxReplicas: 4
100100
metrics:
101101
- type: Resource
102102
resource:

code/kubernetes/grpc-gateway/ingress.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

code/kubernetes/scripts/deploy.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ cd "$SCRIPT_DIR/.." || exit 1
5050
# Deploy traefik
5151
helm repo add traefik https://traefik.github.io/charts
5252
helm repo update
53-
helm upgrade --install traefik traefik/traefik -n $CLUSTER_NAME -f traefik/values.yaml
5453

55-
kubectl apply -n $CLUSTER_NAME -f traefik/cors.yaml
56-
kubectl apply -n $CLUSTER_NAME -f traefik/strip-prefix.yaml
54+
helm upgrade --install traefik traefik/traefik -n $CLUSTER_NAME -f traefik/resources.yaml
55+
kubectl apply -n $CLUSTER_NAME -f traefik/ingress.yaml
56+
kubectl apply -n $CLUSTER_NAME -f traefik/hpa-config.yaml
5757

5858
# Deploy threadit application
5959
kubectl create secret generic "bucket-secret" \
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: autoscaling/v2
2+
kind: HorizontalPodAutoscaler
3+
metadata:
4+
name: traefik-hpa
5+
spec:
6+
scaleTargetRef:
7+
apiVersion: apps/v1
8+
kind: Deployment
9+
name: traefik
10+
minReplicas: 1
11+
maxReplicas: 3
12+
metrics:
13+
- type: Resource
14+
resource:
15+
name: cpu
16+
target:
17+
type: Utilization
18+
averageUtilization: 80
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,31 @@
11
apiVersion: traefik.io/v1alpha1
2+
kind: IngressRoute
3+
metadata:
4+
name: grpc-gateway
5+
spec:
6+
entryPoints:
7+
- web
8+
- websecure
9+
routes:
10+
- match: PathPrefix(`/api`)
11+
kind: Rule
12+
services:
13+
- name: grpc-gateway
14+
port: 80
15+
middlewares:
16+
- name: cors
17+
- name: strip-prefix
18+
---
19+
apiVersion: traefik.io/v1alpha1
20+
kind: Middleware
21+
metadata:
22+
name: strip-prefix
23+
spec:
24+
stripPrefix:
25+
prefixes:
26+
- /api
27+
---
28+
apiVersion: traefik.io/v1alpha1
229
kind: Middleware
330
metadata:
431
name: cors
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Resource configuration for traefik
2+
3+
replicaCount: 1
4+
5+
resources:
6+
requests:
7+
cpu: 40m
8+
memory: 80Mi
9+
limits:
10+
cpu: 120m
11+
memory: 240Mi

code/kubernetes/traefik/strip-prefix.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

code/kubernetes/traefik/values.yaml

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)