diff --git a/artifacts/nginx/canary.yaml b/artifacts/nginx/canary.yaml index 13eb15c9..bca0a709 100644 --- a/artifacts/nginx/canary.yaml +++ b/artifacts/nginx/canary.yaml @@ -14,6 +14,11 @@ spec: apiVersion: extensions/v1beta1 kind: Ingress name: podinfo + # HPA reference (optional) + autoscalerRef: + apiVersion: autoscaling/v2beta1 + kind: HorizontalPodAutoscaler + name: podinfo # the maximum time in seconds for the canary deployment # to make progress before it is rollback (default 600s) progressDeadlineSeconds: 60 diff --git a/artifacts/nginx/hpa.yaml b/artifacts/nginx/hpa.yaml new file mode 100644 index 00000000..fa2b5a6f --- /dev/null +++ b/artifacts/nginx/hpa.yaml @@ -0,0 +1,19 @@ +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: podinfo + namespace: test +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: podinfo + minReplicas: 2 + maxReplicas: 4 + metrics: + - type: Resource + resource: + name: cpu + # scale up if usage is above + # 99% of the requested CPU (100m) + targetAverageUtilization: 99