diff --git a/REVIEW_GUIDELINES.md b/REVIEW_GUIDELINES.md index 51574317e5..09d1e801d3 100644 --- a/REVIEW_GUIDELINES.md +++ b/REVIEW_GUIDELINES.md @@ -112,7 +112,7 @@ volumes: {{- end -}} ``` -* Example pvc.yaml +* Example pvc.yaml: ```yaml {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} @@ -141,6 +141,55 @@ spec: {{- end }} ``` +## AutoScaling / HorizontalPodAutoscaler + +* Autoscaling should be disabled by default +* All options should be shown in README.md + +* Example autoscaling section in values.yaml: + +```yaml +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 5 + targetCPUUtilizationPercentage: 50 + targetMemoryUtilizationPercentage: 50 +``` + +* Example hpa.yaml: + +```yaml +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + labels: + app: {{ template "helm-chart.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: "{{ .Values.name }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "helm-chart.fullname" . }} +spec: + scaleTargetRef: + apiVersion: apps/v1beta1 + kind: Deployment + name: {{ template "helm-chart.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} +{{- end }} +``` + ## Documentation `README.md` and `NOTES.txt` are mandatory. `README.md` should contain a table listing all configuration options. `NOTES.txt` should provide accurate and useful information how the chart can be used/accessed.