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: k8s securityContext, resource limits #72

Merged
merged 2 commits into from
Feb 9, 2024
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
15 changes: 13 additions & 2 deletions charts/semgr8s/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.deployment.podSecurityContext }}
securityContext:
{{- toYaml .Values.deployment.podSecurityContext | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{- with .Values.deployment.securityContext }}
securityContext:
{{- toYaml .Values.deployment.securityContext | nindent 12 }}
{{- toYaml . | nindent 12 }}
{{- end }}
image: "{{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag | default (print "v" .Chart.AppVersion) }}"
imagePullPolicy: {{ .Values.deployment.image.pullPolicy }}
ports:
Expand All @@ -46,6 +50,9 @@ spec:
- mountPath: /.cache
name: cache
readOnly: false
- mountPath: /tmp
name: tmp
readOnly: false
- mountPath: /app/rules
name: rules
readOnly: false
Expand All @@ -63,6 +70,10 @@ spec:
emptyDir: {}
- name: cache
emptyDir: {}
- name: tmp
emptyDir:
medium: "Memory"
sizeLimit: 10Mi
- name: rules
emptyDir: {}
- name: data
Expand Down
24 changes: 21 additions & 3 deletions charts/semgr8s/values.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,32 @@
deployment:
replicaCount: 1
image:
repository: ghcr.io/sse-secure-systems/semgr8s
pullPolicy: IfNotPresent
tag: ""
containerPort: 5000
imagePullSecrets: []
replicaCount: 1
containerPort: 5000
podAnnotations: {}
podSecurityContext: {}
securityContext: {}
resources:
limits:
cpu: 1000m
memory: 128Mi
requests:
cpu: 100m
memory: 64Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 10001 # remove when using openshift or OKD 4
runAsGroup: 20001 # remove when using openshift or OKD 4
seccompProfile:
type: RuntimeDefault

service:
type: ClusterIP
Expand Down
Loading