mirror of
https://github.com/bitnami/charts.git
synced 2026-03-07 08:07:55 +08:00
[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:
committed by
GitHub
parent
207962de4f
commit
f34312f44d
@@ -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:
|
||||
|
||||
@@ -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,
|
||||
|
||||
|
||||
27
bitnami/nginx/templates/hpa.yaml
Normal file
27
bitnami/nginx/templates/hpa.yaml
Normal 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 }}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user