Skip to content

Commit 6dc52a4

Browse files
authored
feat(chart/xatu-server): add hpa (ethpandaops#153)
1 parent 0ea98f8 commit 6dc52a4

File tree

4 files changed

+38
-2
lines changed

4 files changed

+38
-2
lines changed

charts/xatu-server/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: xatu-server
33
description: Ethereum p2p monitoring tool that collects events from and controls various Xatu clients.
44
home: https://github.com/ethpandaops/xatu
55
type: application
6-
version: 0.0.2
6+
version: 0.0.3
77
maintainers:
88
- name: samcm
99

charts/xatu-server/README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# xatu-server
33

4-
![Version: 0.0.2](https://img.shields.io/badge/Version-0.0.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
4+
![Version: 0.0.3](https://img.shields.io/badge/Version-0.0.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
55

66
Ethereum p2p monitoring tool that collects events from and controls various Xatu clients.
77

@@ -14,6 +14,10 @@ Ethereum p2p monitoring tool that collects events from and controls various Xatu
1414
| affinity | object | `{}` | Affinity configuration for pods |
1515
| annotations | object | `{}` | Annotations for the Deployment |
1616
| args | list | `[]` | Command arguments |
17+
| autoscaling.enabled | bool | `false` | Autoscaling configuration |
18+
| autoscaling.maxReplicas | int | `3` | Maximum number of replicas |
19+
| autoscaling.minReplicas | int | `2` | Minimum number of replicas |
20+
| autoscaling.targetCPUUtilizationPercentage | int | `85` | Target CPU utilization percentage |
1721
| config.addr | string | `":8080"` | |
1822
| config.logging | string | `"info"` | |
1923
| config.metricsAddr | string | `":9090"` | |

charts/xatu-server/templates/hpa.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{{- if .Values.autoscaling.enabled -}}
2+
apiVersion: autoscaling/v2
3+
kind: HorizontalPodAutoscaler
4+
metadata:
5+
name: {{ include "xatu-server.fullname" . }}
6+
labels:
7+
{{- include "xatu-server.labels" . | nindent 4 }}
8+
spec:
9+
scaleTargetRef:
10+
apiVersion: apps/v1
11+
kind: Deployment
12+
name: {{ include "xatu-server.fullname" . }}
13+
minReplicas: {{ .Values.autoscaling.minReplicas }}
14+
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
15+
metrics:
16+
- type: Resource
17+
resource:
18+
name: cpu
19+
target:
20+
type: Utilization
21+
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
22+
{{- end }}

charts/xatu-server/values.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ fullnameOverride: ""
77
# -- Number of replicas
88
replicas: 1
99

10+
autoscaling:
11+
# -- Autoscaling configuration
12+
enabled: false
13+
# -- Minimum number of replicas
14+
minReplicas: 2
15+
# -- Maximum number of replicas
16+
maxReplicas: 3
17+
# -- Target CPU utilization percentage
18+
targetCPUUtilizationPercentage: 85
19+
1020
image:
1121
# -- xatu container image repository
1222
repository: ethpandaops/xatu

0 commit comments

Comments
 (0)