Skip to content

Commit

Permalink
HPA周りいじる
Browse files Browse the repository at this point in the history
  • Loading branch information
na2na-p committed Jun 9, 2024
1 parent cf29bd9 commit 813bee8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
3 changes: 1 addition & 2 deletions infra/k8s/web/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ metadata:
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: StatefulSet
kind: ReplicaSet
name: {{ include "web.fullname" . }}
minReplicas: {{ .Values.hpa.minReplicas }}
maxReplicas: {{ .Values.hpa.maxReplicas }}
targetCPUUtilizationPercentage: {{ .Values.hpa.targetCPUUtilizationPercentage }}
# targetMemoryUtilizationPercentage: {{ .Values.hpa.targetMemoryUtilizationPercentage }} # 必要に応じてコメントアウトを解除
{{- end }}
8 changes: 7 additions & 1 deletion infra/k8s/web/templates/replicaSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ metadata:
labels:
{{- include "web.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "web.selectorLabels" . | nindent 6 }}
Expand All @@ -30,6 +29,13 @@ spec:
periodSeconds: 10
path: /healthz
port: 3000
resources:
requests:
cpu: {{ .Values.resources.requests.cpu }}
memory: {{ .Values.resources.requests.memory }}
limits:
cpu: {{ .Values.resources.limits.cpu }}
memory: {{ .Values.resources.limits.memory }}
volumeMounts:
- mountPath: /misskey/.config
name: misskey-default-conf-file
Expand Down
12 changes: 8 additions & 4 deletions infra/k8s/web/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
replicaCount: 2

image:
repository: na2na/misskey-na2na
tag: "2023.11.1-na2na-v4"
Expand All @@ -22,8 +20,6 @@ service:
port: 3000
nodePort: 30000

resources: {}

nodeSelector: {}

tolerations: []
Expand All @@ -37,3 +33,11 @@ hpa:
maxReplicas: 3
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80 # 必要に応じてコメントアウトを解除

resources:
requests:
cpu: 100m
memory: 1Gi
limits:
cpu: 1
memory: 2Gi

0 comments on commit 813bee8

Please sign in to comment.