Skip to content
Open
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: 2 additions & 0 deletions charts/openvsx/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ metadata:
spec:
progressDeadlineSeconds: 3600
revisionHistoryLimit: 1
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
app: {{ .Values.name }}
Expand Down
46 changes: 46 additions & 0 deletions charts/openvsx/templates/okd-hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Values.name }}-{{ .Values.environment }}-{{ .Values.platform }}-hpa
namespace: {{ .Values.namespace }}
labels:
app: {{ .Values.name }}
environment: {{ .Values.environment }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Values.name }}-{{ .Values.environment }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
behavior:
scaleDown:
# Look at the last N minutes and pick the HIGHEST replica count recommended.
# This ensures we don't scale down during a brief dip in traffic.
stabilizationWindowSeconds: {{ .Values.autoscaling.scaleDownWindow | default 600 }}
policies:
- type: Percent
value: 10
periodSeconds: 60 # Only remove 10% of pods per minute
scaleUp:
# Scale up almost immediately to handle spikes quickly.
stabilizationWindowSeconds: 0
policies:
- type: Percent
value: 100
periodSeconds: 15 # Double the fleet size every 15s if needed
{{- end }}
9 changes: 9 additions & 0 deletions charts/openvsx/values-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@ name: &name open-vsx-org
environment: &environment staging
namespace: &namespace open-vsx-org-staging
host: staging.open-vsx.org
platform: okd

replicaCount: 1
esReplicaCount: 1

autoscaling:
enabled: true
minReplicas: 1
maxReplicas: 3
targetCPUUtilizationPercentage: 70
targetMemoryUtilizationPercentage: 80
scaleDownWindow: 300

image:
repository: ghcr.io/eclipsefdn/openvsx-website
pullPolicy: Always
Expand Down
4 changes: 4 additions & 0 deletions charts/openvsx/values-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ name: &name open-vsx-org
environment: &environment test
namespace: &namespace open-vsx-org-test
host: test.open-vsx.org
platform: okd

replicaCount: 1
esReplicaCount: 1

autoscaling:
enabled: false

image:
repository: ghcr.io/eclipsefdn/openvsx-website
pullPolicy: Always
Expand Down
9 changes: 9 additions & 0 deletions charts/openvsx/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@ name: &name open-vsx-org
environment: &environment production
namespace: &namespace open-vsx-org
host: open-vsx.org
platform: okd

replicaCount: 6
esReplicaCount: 3

autoscaling:
enabled: false
# minReplicas: 6
# maxReplicas: 12
# targetCPUUtilizationPercentage: 70
# targetMemoryUtilizationPercentage: 80
# scaleDownWindow: 600

image:
repository: ghcr.io/eclipsefdn/openvsx-website
pullPolicy: Always
Expand Down