[bitnami/nginx] Horizontal Pod Autoscaler (#2593)

* Added hpa

* typo corrected

* [bitnami/nginx] Update components versions

Signed-off-by: Bitnami Containers <containers@bitnami.com>

Co-authored-by: Shankar Mohan <Shankar.Mohan@mrisoftware.com>
Co-authored-by: Bitnami Containers <containers@bitnami.com>
This commit is contained in:
shankarmohannamakkal
2020-05-18 16:34:29 +05:30
committed by GitHub
parent 207962de4f
commit f34312f44d
4 changed files with 45 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
apiVersion: v1
name: nginx
version: 5.3.1
version: 5.4.0
appVersion: 1.17.10
description: Chart for the nginx server
keywords:

View File

@@ -125,6 +125,11 @@ The following tables lists the configurable parameters of the NGINX Open Source
| `metrics.serviceMonitor.interval` | Interval at which metrics should be scraped. | `nil` (Prometheus Operator default value) |
| `metrics.serviceMonitor.scrapeTimeout` | Timeout after which the scrape is ended | `nil` (Prometheus Operator default value) |
| `metrics.serviceMonitor.selector` | Prometheus instance selector labels | `nil` |
| `autoscaling.enabled` | Enable autoscaling for NGINX deployment | `false` |
| `autoscaling.minReplicas` | Minimum number of replicas to scale back | `nil` |
| `autoscaling.maxReplicas` | Maximum number of replicas to scale out | `nil` |
| `autoscaling.targetCPU` | Target CPU utilization percentage | `nil` |
| `autoscaling.targetMemory` | Target Memory utilization percentage | `nil` |
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

View File

@@ -0,0 +1,27 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "nginx.fullname" . }}
labels: {{- include "nginx.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "nginx.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPU }}
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetCPU }}
{{- end }}
{{- if .Values.autoscaling.targetMemory }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemory }}
{{- end }}
{{- end }}

View File

@@ -13,7 +13,7 @@
image:
registry: docker.io
repository: bitnami/nginx
tag: 1.17.10-debian-10-r33
tag: 1.17.10-debian-10-r40
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
@@ -54,7 +54,7 @@ cloneStaticSiteFromGit:
image:
registry: docker.io
repository: bitnami/git
tag: 2.26.2-debian-10-r1
tag: 2.26.2-debian-10-r26
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
@@ -298,7 +298,7 @@ metrics:
image:
registry: docker.io
repository: bitnami/nginx-exporter
tag: 0.7.0-debian-10-r21
tag: 0.7.0-debian-10-r28
pullPolicy: IfNotPresent
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
@@ -364,3 +364,12 @@ metrics:
##
# selector:
# prometheus: my-prometheus
## Autoscaling parameters
##
autoscaling:
enabled: false
# minReplicas: 1
# maxReplicas: 10
# targetCPU: 50
# targetMemory: 50