Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ jobs:
run: |
helm repo add traefik https://traefik.github.io/charts
helm repo update
helm upgrade --install traefik traefik/traefik -n $CLUSTER_NAME -f traefik/values.yaml

kubectl apply -n $CLUSTER_NAME -f traefik/cors.yaml
kubectl apply -n $CLUSTER_NAME -f traefik/strip-prefix.yaml

helm upgrade --install traefik traefik/traefik -n $CLUSTER_NAME -f traefik/resources.yaml
kubectl apply -n $CLUSTER_NAME -f traefik/ingress.yaml
kubectl apply -n $CLUSTER_NAME -f traefik/hpa-config.yaml

- name: Create Kubernetes secrets
run: |
Expand Down
2 changes: 1 addition & 1 deletion code/kubernetes/grpc-gateway/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ spec:
kind: Deployment
name: grpc-gateway
minReplicas: 1
maxReplicas: 3
maxReplicas: 4
metrics:
- type: Resource
resource:
Expand Down
17 changes: 0 additions & 17 deletions code/kubernetes/grpc-gateway/ingress.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions code/kubernetes/scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ cd "$SCRIPT_DIR/.." || exit 1
# Deploy traefik
helm repo add traefik https://traefik.github.io/charts
helm repo update
helm upgrade --install traefik traefik/traefik -n $CLUSTER_NAME -f traefik/values.yaml

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

# Deploy threadit application
kubectl create secret generic "bucket-secret" \
Expand Down
18 changes: 18 additions & 0 deletions code/kubernetes/traefik/hpa-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: traefik-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: traefik
minReplicas: 1
maxReplicas: 3
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 80
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: grpc-gateway
spec:
entryPoints:
- web
- websecure
routes:
- match: PathPrefix(`/api`)
kind: Rule
services:
- name: grpc-gateway
port: 80
middlewares:
- name: cors
- name: strip-prefix
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: strip-prefix
spec:
stripPrefix:
prefixes:
- /api
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: cors
Expand Down
11 changes: 11 additions & 0 deletions code/kubernetes/traefik/resources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Resource configuration for traefik

replicaCount: 1

resources:
requests:
cpu: 40m
memory: 80Mi
limits:
cpu: 120m
memory: 240Mi
8 changes: 0 additions & 8 deletions code/kubernetes/traefik/strip-prefix.yaml

This file was deleted.

23 changes: 0 additions & 23 deletions code/kubernetes/traefik/values.yaml

This file was deleted.

Loading