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

feat: adds securityContexts (pod & container) #20

Merged
merged 1 commit into from
Dec 14, 2022
Merged
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
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### macOS ###
.DS_Store
.AppleDouble
.LSOverride


# helm chart dependencies
charts/*/charts/
**/charts/*.tgz
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.6.3
version: 0.7.0

dependencies:
- name: common
Expand Down
4 changes: 3 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.6.3](https://img.shields.io/badge/Version-0.6.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![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)

A Helm chart for deploying a Backstage application

Expand Down Expand Up @@ -89,6 +89,7 @@ The command removes all the Kubernetes components associated with the chart and
| backstage.command[0] | | string | `"node"` |
| backstage.command[1] | | string | `"packages/backend"` |
| backstage.containerPorts.backend | | int | `7007` |
| backstage.containerSecurityContext | | object | `{}` |
| backstage.extraAppConfig | | list | `[]` |
| backstage.extraEnvVars | | list | `[]` |
| backstage.extraEnvVarsSecrets | | string | `nil` |
Expand All @@ -100,6 +101,7 @@ The command removes all the Kubernetes components associated with the chart and
| backstage.image.registry | | string | `"ghcr.io"` |
| backstage.image.repository | | string | `"backstage/backstage"` |
| backstage.image.tag | | string | `"latest"` |
| backstage.podSecurityContext | | object | `{}` |
| clusterDomain | | string | `"cluster.local"` |
| commonAnnotations | | object | `{}` |
| commonLabels | | object | `{}` |
Expand Down
8 changes: 8 additions & 0 deletions charts/backstage/templates/backstage-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ spec:
{{- if .Values.serviceAccount.create }}
serviceAccountName: {{ .Values.serviceAccount.name }}
{{- end }}
{{- if .Values.backstage.podSecurityContext }}
securityContext:
{{- include "common.tplvalues.render" ( dict "value" .Values.backstage.podSecurityContext "context" $) | nindent 8 }}
{{- end }}
volumes:
{{- if (or .Values.backstage.extraAppConfig (and .Values.backstage.extraVolumeMounts .Values.backstage.extraVolumes)) }}
{{- range .Values.backstage.extraAppConfig }}
Expand All @@ -49,6 +53,10 @@ spec:
- name: backstage-backend
image: {{ include "backstage.image" . }}
imagePullPolicy: {{ .Values.backstage.image.pullPolicy | quote -}}
{{- if .Values.backstage.containerSecurityContext }}
securityContext:
{{- include "common.tplvalues.render" ( dict "value" .Values.backstage.podSecurityContext "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.diagnosticMode.enabled }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
{{- else if .Values.backstage.command }}
Expand Down
9 changes: 9 additions & 0 deletions charts/backstage/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@ backstage:
extraVolumeMounts: []
extraVolumes: []

## @param backstage.podSecurityContext Security settings for a Pod.
## The security settings that you specify for a Pod apply to all Containers in the Pod.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
podSecurityContext: {}

## @param backstage.containerSecurityContext Security settings for a Container
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
containerSecurityContext: {}

## @section Traffic Exposure parameters

## Service parameters
Expand Down