Add canary HPA

This commit is contained in:
Stefan Prodan
2018-09-23 11:27:35 +03:00
parent c9ba2f6cb3
commit e559e1254c
2 changed files with 29 additions and 6 deletions

View File

@@ -6,11 +6,10 @@ metadata:
labels:
app: podinfo-canary
spec:
replicas: 3
replicas: 1
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 1
maxUnavailable: 0
type: RollingUpdate
selector:
matchLabels:
@@ -49,7 +48,7 @@ spec:
failureThreshold: 3
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
timeoutSeconds: 2
readinessProbe:
exec:
command:
@@ -60,10 +59,13 @@ spec:
failureThreshold: 3
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
timeoutSeconds: 2
resources:
limits:
cpu: 1000m
memory: 256Mi
requests:
cpu: 1m
cpu: 10m
memory: 16Mi
volumeMounts:
- mountPath: /data

View File

@@ -0,0 +1,21 @@
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: podinfo-canary
namespace: test
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: podinfo-canary
minReplicas: 2
maxReplicas: 3
metrics:
- type: Resource
resource:
name: cpu
targetAverageUtilization: 99
- type: Resource
resource:
name: memory
targetAverageValue: 200Mi