From 62e8f2acf83c9c9df2de7fa708ab2b816e8b9789 Mon Sep 17 00:00:00 2001 From: na2na-p Date: Mon, 10 Jun 2024 01:47:39 +0900 Subject: [PATCH] =?UTF-8?q?HPA=E5=91=A8=E3=82=8A=E3=81=84=E3=81=98?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- infra/k8s/web/templates/hpa.yaml | 3 +-- infra/k8s/web/templates/replicaSet.yaml | 8 +++++++- infra/k8s/web/values.yaml | 12 ++++++++---- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/infra/k8s/web/templates/hpa.yaml b/infra/k8s/web/templates/hpa.yaml index c456723ab013..30277900104a 100644 --- a/infra/k8s/web/templates/hpa.yaml +++ b/infra/k8s/web/templates/hpa.yaml @@ -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 }} diff --git a/infra/k8s/web/templates/replicaSet.yaml b/infra/k8s/web/templates/replicaSet.yaml index be5091ae547a..b55cdc0bd9db 100644 --- a/infra/k8s/web/templates/replicaSet.yaml +++ b/infra/k8s/web/templates/replicaSet.yaml @@ -5,7 +5,6 @@ metadata: labels: {{- include "web.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicaCount }} selector: matchLabels: {{- include "web.selectorLabels" . | nindent 6 }} @@ -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 diff --git a/infra/k8s/web/values.yaml b/infra/k8s/web/values.yaml index 178b95a30005..78f95afbd922 100644 --- a/infra/k8s/web/values.yaml +++ b/infra/k8s/web/values.yaml @@ -1,5 +1,3 @@ -replicaCount: 2 - image: repository: na2na/misskey-na2na tag: "2023.11.1-na2na-v4" @@ -22,8 +20,6 @@ service: port: 3000 nodePort: 30000 -resources: {} - nodeSelector: {} tolerations: [] @@ -37,3 +33,11 @@ hpa: maxReplicas: 3 targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 # 必要に応じてコメントアウトを解除 + +resources: + requests: + cpu: 100m + memory: 1Gi + limits: + cpu: 1024m + memory: 2Gi