Skip to content
Open
2 changes: 1 addition & 1 deletion charts/plane-enterprise/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Meet Plane. An Enterprise software development tool to manage issue

type: application

version: 1.2.7
version: 1.3.0
appVersion: "1.12.1"

home: https://plane.so/
Expand Down
9 changes: 9 additions & 0 deletions charts/plane-enterprise/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,12 @@
{{- define "hashString" -}}
{{- printf "%s%s%s%s" .Values.license.licenseServer .Values.license.licenseDomain .Release.Namespace .Release.Name | sha256sum -}}
{{- end -}}

{{- define "enable.hpa" -}}
{{- $metrics := lookup "rbac.authorization.k8s.io/v1" "ClusterRole" "" "system:metrics-server" }}
{{- if not $metrics }}
false
{{- else }}
true
{{- end }}
{{- end }}
37 changes: 37 additions & 0 deletions charts/plane-enterprise/templates/workloads/admin.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,41 @@ spec:
serviceAccount: {{ .Release.Name }}-srv-account
serviceAccountName: {{ .Release.Name }}-srv-account

---
{{- if eq (include "enable.hpa" . | trim) "true" }}

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Release.Name }}-admin-hpa
namespace: {{ .Release.Namespace }}
labels:
app.name: {{ .Release.Namespace }}-{{ .Release.Name }}-admin-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Release.Name }}-admin-wl
minReplicas: {{ .Values.services.admin.autoscaling.minReplicas }}
maxReplicas: {{ .Values.services.admin.autoscaling.maxReplicas }}
{{- if or .Values.services.admin.autoscaling.targetCPUUtilizationPercentage .Values.services.admin.autoscaling.targetMemoryUtilizationPercentage }}
metrics:
{{- if .Values.services.admin.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.services.admin.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.services.admin.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.services.admin.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
{{- end }}
---
38 changes: 38 additions & 0 deletions charts/plane-enterprise/templates/workloads/api.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,42 @@ spec:

serviceAccount: {{ .Release.Name }}-srv-account
serviceAccountName: {{ .Release.Name }}-srv-account

---
{{- if eq (include "enable.hpa" . | trim) "true" }}

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Release.Name }}-api-hpa
namespace: {{ .Release.Namespace }}
labels:
app.name: {{ .Release.Namespace }}-{{ .Release.Name }}-api-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Release.Name }}-api-wl
minReplicas: {{ .Values.services.api.autoscaling.minReplicas }}
maxReplicas: {{ .Values.services.api.autoscaling.maxReplicas }}
{{- if or .Values.services.api.autoscaling.targetCPUUtilizationPercentage .Values.services.api.autoscaling.targetMemoryUtilizationPercentage }}
metrics:
{{- if .Values.services.api.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.services.api.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.services.api.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.services.api.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
{{- end }}
Comment on lines +144 to +180

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

minReplicas, maxReplicas, and averageUtilization rendered as strings will break kubectl apply

The | quote filter forces the integers to YAML strings:

minReplicas: "1"

Kubernetes rejects this with
cannot unmarshal string into Go value of type int32.

Same for averageUtilization.

-  minReplicas: {{ .Values.services.api.autoscaling.minReplicas | default 1 | quote }}
-  maxReplicas: {{ .Values.services.api.autoscaling.maxReplicas | default 5 | quote }}
+  minReplicas: {{ .Values.services.api.autoscaling.minReplicas | default 1 | int }}
+  maxReplicas: {{ .Values.services.api.autoscaling.maxReplicas | default 5 | int }}

-          averageUtilization: {{ .Values.services.api.autoscaling.targetCPUUtilizationPercentage | default 90 | quote }}
+          averageUtilization: {{ .Values.services.api.autoscaling.targetCPUUtilizationPercentage | default 90 | int }}

Repeat the | int change for the memory metric block as well.

🤖 Prompt for AI Agents
In charts/plane-enterprise/templates/workloads/api.deployment.yaml between lines
85 and 121, the minReplicas, maxReplicas, and averageUtilization fields are
incorrectly rendered as strings due to the use of the | quote filter, which
causes kubectl apply to fail. Remove the | quote filter from these fields and
instead use the | int filter to ensure they are rendered as integers. Apply this
fix consistently to both the CPU and memory averageUtilization values.

---
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,41 @@ spec:
serviceAccount: {{ .Release.Name }}-srv-account
serviceAccountName: {{ .Release.Name }}-srv-account

---
{{- if eq (include "enable.hpa" . | trim) "true" }}

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Release.Name }}-beat-worker-hpa
namespace: {{ .Release.Namespace }}
labels:
app.name: {{ .Release.Namespace }}-{{ .Release.Name }}-beat-worker-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Release.Name }}-beat-worker-wl
minReplicas: {{ .Values.services.beatworker.autoscaling.minReplicas }}
maxReplicas: {{ .Values.services.beatworker.autoscaling.maxReplicas }}
{{- if or .Values.services.beatworker.autoscaling.targetCPUUtilizationPercentage .Values.services.beatworker.autoscaling.targetMemoryUtilizationPercentage }}
metrics:
{{- if .Values.services.beatworker.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.services.beatworker.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.services.beatworker.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.services.beatworker.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
{{- end }}
---
37 changes: 37 additions & 0 deletions charts/plane-enterprise/templates/workloads/live.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,40 @@ spec:
serviceAccountName: {{ .Release.Name }}-srv-account

---
{{- if eq (include "enable.hpa" . | trim) "true" }}

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Release.Name }}-live-hpa
namespace: {{ .Release.Namespace }}
labels:
app.name: {{ .Release.Namespace }}-{{ .Release.Name }}-live-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Release.Name }}-live-wl
minReplicas: {{ .Values.services.live.autoscaling.minReplicas }}
maxReplicas: {{ .Values.services.live.autoscaling.maxReplicas }}
{{- if or .Values.services.live.autoscaling.targetCPUUtilizationPercentage .Values.services.live.autoscaling.targetMemoryUtilizationPercentage }}
metrics:
{{- if .Values.services.live.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.services.live.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.services.live.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.services.live.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
{{- end }}
---
38 changes: 38 additions & 0 deletions charts/plane-enterprise/templates/workloads/silo.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,43 @@ spec:
optional: false
serviceAccount: {{ .Release.Name }}-srv-account
serviceAccountName: {{ .Release.Name }}-srv-account

---
{{- if eq (include "enable.hpa" . | trim) "true" }}

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Release.Name }}-silo-hpa
namespace: {{ .Release.Namespace }}
labels:
app.name: {{ .Release.Namespace }}-{{ .Release.Name }}-silo-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Release.Name }}-silo-wl
minReplicas: {{ .Values.services.silo.autoscaling.minReplicas }}
maxReplicas: {{ .Values.services.silo.autoscaling.maxReplicas }}
{{- if or .Values.services.silo.autoscaling.targetCPUUtilizationPercentage .Values.services.silo.autoscaling.targetMemoryUtilizationPercentage }}
metrics:
{{- if .Values.services.silo.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.services.silo.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.services.silo.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.services.silo.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
{{- end }}
---
{{- end }}
37 changes: 37 additions & 0 deletions charts/plane-enterprise/templates/workloads/space.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,41 @@ spec:
serviceAccount: {{ .Release.Name }}-srv-account
serviceAccountName: {{ .Release.Name }}-srv-account

---
{{- if eq (include "enable.hpa" . | trim) "true" }}

Comment on lines +64 to +66

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Avoid emitting an empty YAML document when HPA is disabled

The --- delimiter sits outside the {{- if ... }} guard.
When enable.hpa resolves to false, Helm will still render a standalone ---, producing an empty document that some linters (kube-lint, kube-score, etc.) flag as a warning and that can break kubectl apply -k pipelines expecting non-empty manifests.

----
-{{- if eq (include "enable.hpa" . | trim) "true" }}
+{{- if eq (include "enable.hpa" . | trim) "true" }}
+---

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In charts/plane-enterprise/templates/workloads/space.deployment.yaml around
lines 63 to 65, the YAML document start delimiter `---` is outside the
conditional block that checks if HPA is enabled, causing an empty document to be
emitted when HPA is disabled. Move the `---` delimiter inside the `{{- if eq
(include "enable.hpa" . | trim) "true" }}` block to ensure it only appears when
HPA is enabled, preventing empty YAML documents and avoiding linter warnings or
pipeline errors.

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Release.Name }}-space-hpa
namespace: {{ .Release.Namespace }}
labels:
app.name: {{ .Release.Namespace }}-{{ .Release.Name }}-space-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Release.Name }}-space-wl
minReplicas: {{ .Values.services.space.autoscaling.minReplicas }}
maxReplicas: {{ .Values.services.space.autoscaling.maxReplicas }}
{{- if or .Values.services.space.autoscaling.targetCPUUtilizationPercentage .Values.services.space.autoscaling.targetMemoryUtilizationPercentage }}
metrics:
{{- if .Values.services.space.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.services.space.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.services.space.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.services.space.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
{{- end }}
---
37 changes: 37 additions & 0 deletions charts/plane-enterprise/templates/workloads/web.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,41 @@ spec:
serviceAccount: {{ .Release.Name }}-srv-account
serviceAccountName: {{ .Release.Name }}-srv-account

---
{{- if eq (include "enable.hpa" . | trim) "true" }}

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Release.Name }}-web-hpa
namespace: {{ .Release.Namespace }}
labels:
app.name: {{ .Release.Namespace }}-{{ .Release.Name }}-web-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Release.Name }}-web-wl
minReplicas: {{ .Values.services.web.autoscaling.minReplicas }}
maxReplicas: {{ .Values.services.web.autoscaling.maxReplicas }}
{{- if or .Values.services.web.autoscaling.targetCPUUtilizationPercentage .Values.services.web.autoscaling.targetMemoryUtilizationPercentage }}
metrics:
{{- if .Values.services.web.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.services.web.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.services.web.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.services.web.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
{{- end }}
---
37 changes: 37 additions & 0 deletions charts/plane-enterprise/templates/workloads/worker.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,41 @@ spec:
serviceAccount: {{ .Release.Name }}-srv-account
serviceAccountName: {{ .Release.Name }}-srv-account

---
{{- if eq (include "enable.hpa" . | trim) "true" }}

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Release.Name }}-worker-hpa
namespace: {{ .Release.Namespace }}
labels:
app.name: {{ .Release.Namespace }}-{{ .Release.Name }}-worker-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Release.Name }}-worker-wl
minReplicas: {{ .Values.services.worker.autoscaling.minReplicas }}
maxReplicas: {{ .Values.services.worker.autoscaling.maxReplicas }}
{{- if or .Values.services.worker.autoscaling.targetCPUUtilizationPercentage .Values.services.worker.autoscaling.targetMemoryUtilizationPercentage }}
metrics:
{{- if .Values.services.worker.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.services.worker.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.services.worker.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.services.worker.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
{{- end }}
---
Loading