diff --git a/vizzy/templates/deployment.yaml b/vizzy/templates/deployment.yaml index aa3b256..b6b2893 100644 --- a/vizzy/templates/deployment.yaml +++ b/vizzy/templates/deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: {{ .Chart.Name }} diff --git a/vizzy/templates/scaling.yaml b/vizzy/templates/scaling.yaml new file mode 100644 index 0000000..7b82800 --- /dev/null +++ b/vizzy/templates/scaling.yaml @@ -0,0 +1,19 @@ +{{- if .Values.horizontalPodAutoscaler.enabled -}} +apiVersion: autoscaling/v1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ .Chart.Name }} + labels: + app: {{ .Chart.Name }} + chart: {{ .Chart.Name }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + maxReplicas: {{ .Values.maxReplica }} + minReplicas: {{ .Values.replicaCount }} + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ .Chart.Name }} + targetCPUUtilizationPercentage: {{ .Values.horizontalPodAutoscaler.targetCPUUtilizationPercentage }} +{{- end }} \ No newline at end of file diff --git a/vizzy/values.yaml b/vizzy/values.yaml index 234468c..5ac3dae 100644 --- a/vizzy/values.yaml +++ b/vizzy/values.yaml @@ -3,6 +3,7 @@ # Declare variables to be passed into your templates. replicaCount: 5 +maxReplica: 15 image: repository: scottcbishop/vizzy tag: v3.1.1 @@ -38,6 +39,10 @@ service: nginxIngress: enabled: true +horizontalPodAutoscaler: + enabled: false + targetCPUUtilizationPercentage: 80 + # Chart dependency postgresql: enabled: true