diff --git a/charts/saleor/Chart.yaml b/charts/saleor/Chart.yaml index 32fdb26..dbe4a75 100644 --- a/charts/saleor/Chart.yaml +++ b/charts/saleor/Chart.yaml @@ -14,7 +14,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: 0.1.12 +version: 0.1.13 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. diff --git a/charts/saleor/templates/saleor_deployment.yaml b/charts/saleor/templates/saleor_deployment.yaml index 744bdc1..b024373 100644 --- a/charts/saleor/templates/saleor_deployment.yaml +++ b/charts/saleor/templates/saleor_deployment.yaml @@ -5,7 +5,7 @@ metadata: labels: {{- include "saleor-helm.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicaCount }} + replicas: {{ .Values.saleor.minReplicas }} selector: matchLabels: {{- include "saleor-helm.selectorLabels" . | nindent 6 }} diff --git a/charts/saleor/templates/saleor_hpa.yaml b/charts/saleor/templates/saleor_hpa.yaml new file mode 100644 index 0000000..39294f6 --- /dev/null +++ b/charts/saleor/templates/saleor_hpa.yaml @@ -0,0 +1,23 @@ +{{- if .Values.saleor.enableHpa -}} +apiVersion: autoscaling/v2beta2 +kind: HorizontalPodAutoscaler +metadata: + annotations: + field.cattle.io/displayName: saleor-api-autoscaler + labels: + name: saleor-api-autoscaler +spec: + maxReplicas: {{ .Values.saleor.maxReplicas }} + metrics: + - resource: + name: cpu + target: + averageUtilization: 80 + type: Utilization + type: Resource + minReplicas: {{ .Values.saleor.minReplicas }} + scaleTargetRef: + apiVersion: apps/v1beta2 + kind: Deployment + name: saleor-api +{{- end }} \ No newline at end of file diff --git a/charts/saleor/values.yaml b/charts/saleor/values.yaml index ffc8fb4..d47c71e 100644 --- a/charts/saleor/values.yaml +++ b/charts/saleor/values.yaml @@ -2,8 +2,6 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -replicaCount: 1 - image: repository: registry.gitlab.com/trieb.work/saleor pullPolicy: IfNotPresent @@ -54,6 +52,9 @@ ingress: # - chart-example.local saleor: + enableHpa: true + maxReplicas: 3 + minReplicas: 2 resources: requests: cpu: 300m