From 5c9c5b1a2ca11303104590d9885d72be6ac8f0c4 Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Fri, 16 Nov 2018 20:39:40 +0200 Subject: [PATCH] Add HPA example --- README.md | 7 +++++++ workloads/podinfo-dep.yaml | 1 - workloads/podinfo-hpa.yaml | 19 +++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 workloads/podinfo-hpa.yaml diff --git a/README.md b/README.md index b2cd5ed..9e94071 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,13 @@ We published a step-by-step run-through on how to use Flux and Helm Operator [over here](https://github.com/weaveworks/flux/blob/master/site/helm-get-started.md). +### Workloads + +podinfo +* Kubernetes deployment, ClusterIP service and Horizontal Pod Autoscaler +* init container automated image updates (regular expression filter) +* container automated image updates (semantic versioning filter) + ### Helm releases Mongodb diff --git a/workloads/podinfo-dep.yaml b/workloads/podinfo-dep.yaml index 829e2ca..7fd8c90 100644 --- a/workloads/podinfo-dep.yaml +++ b/workloads/podinfo-dep.yaml @@ -11,7 +11,6 @@ metadata: flux.weave.works/tag.init: regexp:^3.* flux.weave.works/tag.podinfod: semver:~1.3 spec: - replicas: 1 strategy: rollingUpdate: maxUnavailable: 0 diff --git a/workloads/podinfo-hpa.yaml b/workloads/podinfo-hpa.yaml new file mode 100644 index 0000000..93bc135 --- /dev/null +++ b/workloads/podinfo-hpa.yaml @@ -0,0 +1,19 @@ +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: podinfo + namespace: demo +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 (10m) + targetAverageUtilization: 99