mirror of
https://github.com/helm/charts.git
synced 2026-08-23 22:37:45 +00:00
[Documentation] Add HPA best practices to review guidelines. (#7562)
* [Documentation] Add HPA best practices to review guidelines. After reviewing the nginx-ingress and spark charts which both have HPA's defined I am making the following recommendations based on the nginx-ingress chart specifically (after #7560) be added to the review guidelines. Signed-off-by: Paul Czarkowski <username.taken@gmail.com> * fixed accidental deletion of pvc.yaml Signed-off-by: Paul Czarkowski <username.taken@gmail.com>
This commit is contained in:
committed by
k8s-ci-robot
parent
846587edbf
commit
eb54bc88f0
+50
-1
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user