Skip to content
Closed
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
5 changes: 5 additions & 0 deletions .github/workflows/chart-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ jobs:
sed -i "s/name: ${{env.CHART_REPO}}/name: ${{ env.CHART_PREFIX }}-${{env.CHART_REPO}}/" charts/${{env.CHART_REPO}}/Chart.yaml
sed -i "s/description: .*/description: ${flatBranchName}/g" charts/${{env.CHART_REPO}}/Chart.yaml
# sed -i "s/version: \(.*\)/version: \1-${flatBranchName}/" charts/${{env.CHART_REPO}}/Chart.yaml

# Add required repositories and build dependencies
helm repo add metrics-server https://kubernetes-sigs.github.io/metrics-server/
helm repo update
helm dependency build charts/$CHART_REPO

helm package --sign --key "$CR_KEY" --keyring $CR_KEYRING --passphrase-file "$CR_PASSPHRASE_FILE" charts/$CHART_REPO -u -d ${{ env.EXPORT_DIR }}/${{env.CHART_REPO}}/charts
cp charts/${{env.CHART_REPO}}/README.md ${{ env.EXPORT_DIR }}/${{env.CHART_REPO}}/${{env.CHART_REPO}}.md
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/chart-releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ jobs:
echo "MARK_AS_PRERELASE=true" >> $GITHUB_ENV
echo "PAGES_INDEX_PATH=${flatBranchName}" >> $GITHUB_ENV

- name: Build Dependencies
run: |
if [ "${{ github.event.inputs.plane-ce }}" = "true" ]; then
helm dependency build charts/${{ env.CHART_NAME_CE }}
fi

Comment on lines +101 to +106
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Missing Helm repo addition before dependency build

The new Build Dependencies step invokes helm dependency build but does not add the metrics-server repository first, which will cause the dependency fetch to fail. You need to add and update the repo before building.

Apply this diff:

       - name: Build Dependencies
         run: |
-          if [ "${{ github.event.inputs.plane-ce }}" = "true" ]; then
-            helm dependency build charts/${{ env.CHART_NAME_CE }}
-          fi
+          helm repo add metrics-server https://kubernetes-sigs.github.io/metrics-server/
+          helm repo update
+          if [ "${{ github.event.inputs.plane-ce }}" = "true" ]; then
+            helm dependency build charts/${{ env.CHART_NAME_CE }}
+          fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Build Dependencies
run: |
if [ "${{ github.event.inputs.plane-ce }}" = "true" ]; then
helm dependency build charts/${{ env.CHART_NAME_CE }}
fi
- name: Build Dependencies
run: |
helm repo add metrics-server https://kubernetes-sigs.github.io/metrics-server/
helm repo update
if [ "${{ github.event.inputs.plane-ce }}" = "true" ]; then
helm dependency build charts/${{ env.CHART_NAME_CE }}
fi
🤖 Prompt for AI Agents
In .github/workflows/chart-releaser.yml around lines 101 to 106, before running
`helm dependency build`, add a step to add the `metrics-server` Helm repository
using `helm repo add metrics-server <repo-url>` and then run `helm repo update`
to ensure dependencies can be fetched successfully. Insert these commands before
the dependency build command inside the conditional block.

- name: Release Charts
uses: mguptahub/chart-releaser-action@v1.6.2
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ test-helm.yaml
*/local-values.yaml
test.yaml
test-*.yaml
charts/plane-ce/charts
6 changes: 6 additions & 0 deletions charts/plane-ce/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: metrics-server
repository: https://kubernetes-sigs.github.io/metrics-server/
version: 3.12.2
digest: sha256:9be099fcb7bb171b96598c6135df06c9feb60535737dd4adfdc601d44e23d6bf
generated: "2025-05-20T13:23:06.095553+05:30"
5 changes: 5 additions & 0 deletions charts/plane-ce/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ sources:

annotations:
artifacthub.io/license: AGPL-3.0

dependencies:
- name: metrics-server
version: 3.12.2
repository: https://kubernetes-sigs.github.io/metrics-server/
175 changes: 168 additions & 7 deletions charts/plane-ce/questions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,30 @@ questions:
label: "Assign Cluster IP"
type: boolean
default: false

- variable: web.autoscaling.enabled
label: "Enable Autoscaling"
type: boolean
default: true
- variable: web.autoscaling.minReplicas
label: "Minimum Replica Count"
type: int
default: 1
show_if: "web.autoscaling.enabled=true"
- variable: web.autoscaling.maxReplicas
label: "Maximum Replica Count"
type: int
default: 3
show_if: "web.autoscaling.enabled=true"
- variable: web.autoscaling.targetCPUUtilizationPercentage
label: "Target CPU Utilization Percentage"
type: int
default: 80
show_if: "web.autoscaling.enabled=true"
- variable: web.autoscaling.targetMemoryUtilizationPercentage
label: "Target Memory Utilization Percentage"
type: int
default: 70
show_if: "web.autoscaling.enabled=true"
- variable: space.image
label: Space Docker Image
type: string
Expand Down Expand Up @@ -87,7 +110,30 @@ questions:
label: "Assign Cluster IP"
type: boolean
default: false

- variable: space.autoscaling.enabled
label: "Enable Autoscaling"
type: boolean
default: true
- variable: space.autoscaling.minReplicas
label: "Minimum Replica Count"
type: int
default: 1
show_if: "space.autoscaling.enabled=true"
- variable: space.autoscaling.maxReplicas
label: "Maximum Replica Count"
type: int
default: 3
show_if: "space.autoscaling.enabled=true"
- variable: space.autoscaling.targetCPUUtilizationPercentage
label: "Target CPU Utilization Percentage"
type: int
default: 80
show_if: "space.autoscaling.enabled=true"
- variable: space.autoscaling.targetMemoryUtilizationPercentage
label: "Target Memory Utilization Percentage"
type: int
default: 70
show_if: "space.autoscaling.enabled=true"
- variable: admin.image
label: Admin Docker Image
type: string
Expand Down Expand Up @@ -119,7 +165,30 @@ questions:
label: "Assign Cluster IP"
type: boolean
default: true

- variable: admin.autoscaling.enabled
label: "Enable Autoscaling"
type: boolean
default: true
- variable: admin.autoscaling.minReplicas
label: "Minimum Replica Count"
type: int
default: 1
show_if: "admin.autoscaling.enabled=true"
- variable: admin.autoscaling.maxReplicas
label: "Maximum Replica Count"
type: int
default: 3
show_if: "admin.autoscaling.enabled=true"
- variable: admin.autoscaling.targetCPUUtilizationPercentage
label: "Target CPU Utilization Percentage"
type: int
default: 80
show_if: "admin.autoscaling.enabled=true"
- variable: admin.autoscaling.targetMemoryUtilizationPercentage
label: "Target Memory Utilization Percentage"
type: int
default: 70
show_if: "admin.autoscaling.enabled=true"
- variable: live.image
label: Live Docker Image
type: string
Expand Down Expand Up @@ -164,7 +233,30 @@ questions:
label: "Live Sentry Traces Sample Rate"
type: string
default: ""

- variable: live.autoscaling.enabled
label: "Enable Autoscaling"
type: boolean
default: true
- variable: live.autoscaling.minReplicas
label: "Minimum Replica Count"
type: int
default: 1
show_if: "live.autoscaling.enabled=true"
- variable: live.autoscaling.maxReplicas
label: "Maximum Replica Count"
type: int
default: 3
show_if: "live.autoscaling.enabled=true"
- variable: live.autoscaling.targetCPUUtilizationPercentage
label: "Target CPU Utilization Percentage"
type: int
default: 80
show_if: "live.autoscaling.enabled=true"
- variable: live.autoscaling.targetMemoryUtilizationPercentage
label: "Target Memory Utilization Percentage"
type: int
default: 70
show_if: "live.autoscaling.enabled=true"
- variable: api.image
label: Backend Docker Image
type: string
Expand Down Expand Up @@ -218,7 +310,30 @@ questions:
label: "API Key Rate Limit"
type: string
default: "60/minute"

- variable: api.autoscaling.enabled
label: "Enable Autoscaling"
type: boolean
default: true
- variable: api.autoscaling.minReplicas
label: "Minimum Replica Count"
type: int
default: 1
show_if: "api.autoscaling.enabled=true"
- variable: api.autoscaling.maxReplicas
label: "Maximum Replica Count"
type: int
default: 3
show_if: "api.autoscaling.enabled=true"
- variable: api.autoscaling.targetCPUUtilizationPercentage
label: "Target CPU Utilization Percentage"
type: int
default: 80
show_if: "api.autoscaling.enabled=true"
- variable: api.autoscaling.targetMemoryUtilizationPercentage
label: "Target Memory Utilization Percentage"
type: int
default: 70
show_if: "api.autoscaling.enabled=true"
- variable: worker.replicas
label: "Default Replica Count"
type: int
Expand All @@ -233,7 +348,30 @@ questions:
label: "CPU Limit"
type: string
default: 500m

- variable: worker.autoscaling.enabled
label: "Enable Autoscaling"
type: boolean
default: true
- variable: worker.autoscaling.minReplicas
label: "Minimum Replica Count"
type: int
default: 1
show_if: "worker.autoscaling.enabled=true"
- variable: worker.autoscaling.maxReplicas
label: "Maximum Replica Count"
type: int
default: 3
show_if: "worker.autoscaling.enabled=true"
- variable: worker.autoscaling.targetCPUUtilizationPercentage
label: "Target CPU Utilization Percentage"
type: int
default: 80
show_if: "worker.autoscaling.enabled=true"
- variable: worker.autoscaling.targetMemoryUtilizationPercentage
label: "Target Memory Utilization Percentage"
type: int
default: 70
show_if: "worker.autoscaling.enabled=true"
- variable: beatworker.replicas
label: "Default Replica Count"
type: int
Expand All @@ -248,7 +386,30 @@ questions:
label: "CPU Limit"
type: string
default: 500m

- variable: beatworker.autoscaling.enabled
label: "Enable Autoscaling"
type: boolean
default: true
- variable: beatworker.autoscaling.minReplicas
label: "Minimum Replica Count"
type: int
default: 1
show_if: "beatworker.autoscaling.enabled=true"
- variable: beatworker.autoscaling.maxReplicas
label: "Maximum Replica Count"
type: int
default: 3
show_if: "beatworker.autoscaling.enabled=true"
- variable: beatworker.autoscaling.targetCPUUtilizationPercentage
label: "Target CPU Utilization Percentage"
type: int
default: 80
show_if: "beatworker.autoscaling.enabled=true"
- variable: beatworker.autoscaling.targetMemoryUtilizationPercentage
label: "Target Memory Utilization Percentage"
type: int
default: 70
show_if: "beatworker.autoscaling.enabled=true"
- variable: redis.local_setup
label: "Install Redis"
type: boolean
Expand Down
9 changes: 9 additions & 0 deletions charts/plane-ce/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
{{- define "imagePullSecret" }}
{{- printf "{\"auths\":{\"%s\":{\"username\":\"%s\",\"password\":\"%s\"}}}" .Values.dockerRegistry.host .Values.dockerRegistry.loginid .Values.dockerRegistry.password | b64enc }}
{{- end }}

{{- define "enable.hpa" -}}
{{- $metrics := lookup "rbac.authorization.k8s.io/v1" "ClusterRole" "" "system:metrics-server" }}
{{- if not $metrics }}
false
{{- else }}
true
{{- end }}
{{- end }}
40 changes: 38 additions & 2 deletions charts/plane-ce/templates/workloads/admin.deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

apiVersion: v1
kind: Service
metadata:
Expand Down Expand Up @@ -59,4 +58,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.admin.autoscaling.minReplicas }}
maxReplicas: {{ .Values.admin.autoscaling.maxReplicas }}
{{- if or .Values.admin.autoscaling.targetCPUUtilizationPercentage .Values.admin.autoscaling.targetMemoryUtilizationPercentage }}
metrics:
{{- if .Values.admin.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.admin.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.admin.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.admin.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
{{- end }}
---
37 changes: 37 additions & 0 deletions charts/plane-ce/templates/workloads/api.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,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 }}-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.api.autoscaling.minReplicas }}
maxReplicas: {{ .Values.api.autoscaling.maxReplicas }}
{{- if or .Values.api.autoscaling.targetCPUUtilizationPercentage .Values.api.autoscaling.targetMemoryUtilizationPercentage }}
metrics:
{{- if .Values.api.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.api.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.api.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.api.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
{{- end }}
---
Loading