Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proxy: hpa #81

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/neon-proxy/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: neon-proxy
description: Neon Proxy
type: application
version: 1.7.23
version: 1.8.0
appVersion: "0.1.0"
kubeVersion: "^1.18.x-x"
home: https://neon.tech
Expand Down
3 changes: 2 additions & 1 deletion charts/neon-proxy/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# neon-proxy

![Version: 1.7.23](https://img.shields.io/badge/Version-1.7.23-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) [![Lint and Test Charts](https://github.com/neondatabase/helm-charts/actions/workflows/lint-test.yaml/badge.svg)](https://github.com/neondatabase/helm-charts/actions/workflows/lint-test.yaml)
![Version: 1.8.0](https://img.shields.io/badge/Version-1.8.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) [![Lint and Test Charts](https://github.com/neondatabase/helm-charts/actions/workflows/lint-test.yaml/badge.svg)](https://github.com/neondatabase/helm-charts/actions/workflows/lint-test.yaml)

Neon Proxy

Expand Down Expand Up @@ -36,6 +36,7 @@ Kubernetes: `^1.18.x-x`
| exposedService.type | string | `"LoadBalancer"` | Exposed service type |
| extraManifests | list | `[]` | Additional manifests that are created with the chart |
| fullnameOverride | string | `""` | String to fully override neon-proxy.fullname template |
| hpa | object | `{}` | HorizontalPodAutoscaling configurations |
| image.pullPolicy | string | `"Always"` | image pull policy |
| image.repository | string | `"neondatabase/neon"` | Neondatabase image repository |
| image.tag | string | `"latest"` | Overrides the image tag whose default is the chart appVersion. |
Expand Down
4 changes: 3 additions & 1 deletion charts/neon-proxy/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ metadata:
spec:
strategy:
{{- toYaml .Values.deploymentStrategy | nindent 4 }}
replicas: {{ .Values.replicaCount }}
{{- with .Values.replicaCount }}
replicas: {{ . }}
{{- end }}
selector:
matchLabels:
{{- include "neon-proxy.selectorLabels" . | nindent 6 }}
Expand Down
36 changes: 36 additions & 0 deletions charts/neon-proxy/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{{ with .Values.hpa }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: php-apache
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "neon-proxy.fullname" . }}
labels:
{{- include "neon-proxy.labels" . | nindent 4 }}
minReplicas: {{ .minReplicas }}
maxReplicas: {{ .maxReplicas }}
metrics:
# With this metric the HPA controller will keep the average utilization of the pods in the scaling target at 50%.
# Utilization is the ratio between the current usage of resource to the requested resources of the pod
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .cpuUtilisation }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .memoryUtilisation }}
{{- range .otherMetrics }}
- {{ . }}
{{- end }}
{{- with .behaviour }}
{{ . }}
{{- end }}
{{ end }}
29 changes: 29 additions & 0 deletions charts/neon-proxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,35 @@

replicaCount: 1

# -- HorizontalPodAutoscaling configurations
hpa: {}
# minReplicas: 1
# maxReplicas: 10
# cpuUtilisation: 50
# memoryUtilisation: 50
# otherMetrics: []
# behavior:
# scaleDown:
# # wait one day before scaling down
# stabilizationWindowSeconds: 86400
# policies:
# # only scale down 10% of pods in a 5 minute window
# - type: Percent
# value: 10
# periodSeconds: 300
# # only scale down 1 pod every minute
# - type: Pods
# value: 1
# periodSeconds: 60
# selectPolicy: Min
# scaleUp:
# stabilizationWindowSeconds: 0
# policies:
# # double the number of pods every minute
# - type: Percent
# value: 100
# periodSeconds: 60

# -- strategy override for deployment
deploymentStrategy:
type: Recreate
Expand Down
Loading