Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Resource Limits for backstage container #27

Merged
merged 10 commits into from
Dec 15, 2022
2 changes: 1 addition & 1 deletion charts/backstage/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.7.0
version: 0.8.0

dependencies:
- name: common
Expand Down
3 changes: 2 additions & 1 deletion charts/backstage/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Backstage Helm Chart

![Version: 0.7.0](https://img.shields.io/badge/Version-0.7.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 0.8.0](https://img.shields.io/badge/Version-0.8.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

A Helm chart for deploying a Backstage application

Expand Down Expand Up @@ -102,6 +102,7 @@ The command removes all the Kubernetes components associated with the chart and
| backstage.image.repository | | string | `"backstage/backstage"` |
| backstage.image.tag | | string | `"latest"` |
| backstage.podSecurityContext | | object | `{}` |
| backstage.resources | resource requests/limits ref: https://kubernetes.io/docs/user-guide/compute-resources/ # E.g. # resources: # limits: # memory: 1Gi # cpu: 1000m # requests: # memory: 250Mi # cpu: 100m | object | `{}` |
| clusterDomain | | string | `"cluster.local"` |
| commonAnnotations | | object | `{}` |
| commonLabels | | object | `{}` |
Expand Down
11 changes: 7 additions & 4 deletions charts/backstage/templates/backstage-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
spec:
{{- if .Values.serviceAccount.create }}
serviceAccountName: {{ .Values.serviceAccount.name }}
{{- end }}
{{- end }}
{{- if .Values.backstage.podSecurityContext }}
securityContext:
{{- include "common.tplvalues.render" ( dict "value" .Values.backstage.podSecurityContext "context" $) | nindent 8 }}
Expand All @@ -38,7 +38,7 @@ spec:
- name: {{ .configMapRef }}
configMap:
name: {{ .configMapRef }}
{{- end }}
{{- end }}
{{- if .Values.backstage.extraVolumes }}
{{- toYaml .Values.backstage.extraVolumes | nindent 8 }}
{{- end }}
Expand Down Expand Up @@ -70,6 +70,9 @@ spec:
{{- range .Values.backstage.args }}
- {{ . | quote }}
{{- end }}
{{- if .Values.backstage.resources }}
resources: {{- include "common.tplvalues.render" (dict "value" .Values.backstage.resources "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.backstage.extraAppConfig }}
{{- range .Values.backstage.extraAppConfig }}
- "--config"
Expand All @@ -92,7 +95,7 @@ spec:
value: {{ include "backstage.postgresql.host" . }}
- name: POSTGRES_PORT
value: "5432"
- name: POSTGRES_USER
- name: POSTGRES_USER
value: {{ .Values.postgresql.auth.username }}
- name: POSTGRES_PASSWORD
valueFrom:
Expand All @@ -112,7 +115,7 @@ spec:
{{- range .Values.backstage.extraAppConfig }}
- name: {{ .configMapRef }}
mountPath: "/app/{{ .filename }}"
subPath: {{ .filename }}
subPath: {{ .filename }}
{{- end }}
{{- if .Values.backstage.extraVolumeMounts }}
{{- toYaml .Values.backstage.extraVolumeMounts | nindent 12 }}
Expand Down
11 changes: 11 additions & 0 deletions charts/backstage/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,17 @@ backstage:
extraEnvVarsSecrets:
extraVolumeMounts: []
extraVolumes: []
# -- resource requests/limits
# ref: https://kubernetes.io/docs/user-guide/compute-resources/
## E.g.
## resources:
## limits:
## memory: 1Gi
## cpu: 1000m
## requests:
## memory: 250Mi
## cpu: 100m
resources: {}

## @param backstage.podSecurityContext Security settings for a Pod.
## The security settings that you specify for a Pod apply to all Containers in the Pod.
Expand Down