Compare commits

..

2 Commits

Author SHA1 Message Date
Sangmin Kim b194736d7c new file: akashop/hpa.yml 2024-04-26 16:55:41 +09:00
Sangmin Kim 3d3794013f modified: akashop/traefik-ingressR.yml 2024-04-08 11:24:42 +09:00
4 changed files with 50 additions and 14 deletions

View File

@ -4,7 +4,7 @@ metadata:
name: wp name: wp
namespace: akashop namespace: akashop
spec: spec:
replicas: 3 replicas: 1
selector: selector:
matchLabels: matchLabels:
app: wp app: wp
@ -19,11 +19,11 @@ spec:
imagePullPolicy: Always imagePullPolicy: Always
resources: resources:
limits: limits:
cpu: "2"
memory: "2Gi"
requests:
cpu: "1" cpu: "1"
memory: "1Gi" memory: "1Gi"
requests:
cpu: "0.5"
memory: "200Mi"
ports: ports:
- name: http - name: http
containerPort: 80 containerPort: 80
@ -41,12 +41,12 @@ spec:
# secretKeyRef: # secretKeyRef:
# name: my-secret # Name of the secret containing the variable # name: my-secret # Name of the secret containing the variable
# key: VAR2_KEY # key: VAR2_KEY
livenessProbe: #livenessProbe:
httpGet: #httpGet:
path: / #path: /
port: 80 #port: 80
initialDelaySeconds: 5 #initialDelaySeconds: 5
periodSeconds: 10 #periodSeconds: 10
volumeMounts: volumeMounts:
- name: wp-data - name: wp-data
mountPath: /var/www/html mountPath: /var/www/html
@ -78,8 +78,8 @@ spec:
imagePullPolicy: Always imagePullPolicy: Always
resources: resources:
limits: limits:
cpu: "1" cpu: "2"
memory: "1Gi" memory: "2Gi"
requests: requests:
cpu: "0.5" cpu: "0.5"
memory: "200Mi" memory: "200Mi"

19
akashop/hpa.yml Normal file
View File

@ -0,0 +1,19 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: wp-hpa
namespace: akashop
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: wp
minReplicas: 1
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 50

View File

@ -1,3 +1,15 @@
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: akashop-ratelimit
namespace: akashop
spec:
rateLimit:
average: 5
burst: 10
---
apiVersion: traefik.io/v1alpha1 apiVersion: traefik.io/v1alpha1
kind: Middleware kind: Middleware
metadata: metadata:
@ -27,7 +39,8 @@ spec:
- name: wp - name: wp
port: 80 port: 80
# middlewares: middlewares:
- name: akashop-ratelimit
# - name: akashop-redir # - name: akashop-redir
--- ---
@ -56,7 +69,10 @@ spec:
httpOnly: true httpOnly: true
# name: cookie # name: cookie
# secure: true # secure: true
# sameSite: none sameSite: strict
# strategy: RoundRobin # strategy: RoundRobin
# weight: 10 # weight: 10
# nativeLB: true # nativeLB: true
middlewares:
- name: akashop-ratelimit

View File

@ -2,6 +2,7 @@ kind: Deployment
apiVersion: apps/v1 apiVersion: apps/v1
metadata: metadata:
name: traefik-deployment name: traefik-deployment
namespace: traefik
labels: labels:
app: traefik app: traefik