Skip to content

Commit

Permalink
feat(capacitor): add default securityContext (#108)
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Gaiser <sebastiangaiser@users.noreply.github.com>
  • Loading branch information
sebastiangaiser authored Jan 18, 2025
1 parent 4341e33 commit b13ea26
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/capacitor/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: capacitor
description: A Helm chart for deploying capacitor, a general purpose UI for FluxCD
type: application
version: 0.1.5
version: 0.2.0
# renovate: image=ghcr.io/gimlet-io/capacitor
appVersion: v0.4.8
maintainers:
Expand Down
3 changes: 2 additions & 1 deletion charts/capacitor/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# capacitor

![Version: 0.1.5](https://img.shields.io/badge/Version-0.1.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.4.8](https://img.shields.io/badge/AppVersion-v0.4.8-informational?style=flat-square)
![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.4.8](https://img.shields.io/badge/AppVersion-v0.4.8-informational?style=flat-square)

A Helm chart for deploying capacitor, a general purpose UI for FluxCD

Expand Down Expand Up @@ -29,6 +29,7 @@ Check the values how to configure the flavor.
| networkPolicy.flavor | string | `"kubernetes"` | kubernetes |
| nodeSelector | object | `{}` | Node selectors |
| podAnnotations | object | `{}` | |
| podSecurityContext | object | `{}` | Pod security context |
| readinessProbe | object | `{"failureThreshold":3,"httpGet":{"path":"/","port":9000,"scheme":"HTTP"},"initialDelaySeconds":0,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":3}` | Readiness probe |
| replicaCount | int | `1` | |
| resources | object | `{"requests":{"cpu":"200m","memory":"200Mi"}}` | Resources |
Expand Down
17 changes: 15 additions & 2 deletions charts/capacitor/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ spec:
serviceAccountName: {{ include "capacitor.serviceAccountName" . }}
securityContext:
fsGroup: 999
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: capacitor
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
Expand All @@ -45,9 +47,20 @@ spec:
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.securityContext }}
{{- if .Values.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- toYaml .Values.securityContext | nindent 12 }}
{{- else }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
Expand Down
3 changes: 3 additions & 0 deletions charts/capacitor/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ image:
# -- Security context
securityContext: {}

# -- Pod security context
podSecurityContext: {}

# -- Liveness probe
livenessProbe: {}

Expand Down

0 comments on commit b13ea26

Please sign in to comment.