Skip to content

Commit

Permalink
Added pod SCC and container SCC
Browse files Browse the repository at this point in the history
  • Loading branch information
MatanHeledPort committed Dec 18, 2023
1 parent 7214204 commit 9684220
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
16 changes: 10 additions & 6 deletions charts/port-agent/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ metadata:
labels:
{{- include "port-agent.labels" . | nindent 4 }}
spec:
strategty:
type: {{ .Values.rolloutStrategy }}
securityContext:
{{- if .Values.podSecurityContext }}
{{- toYaml .Values.podSecurityContext | nindent 4 }}
{{- end }}
replicas: 1
selector:
matchLabels:
Expand All @@ -22,19 +28,17 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{ - if .Values.podSecurityContext.enabled }}
{{- toYaml .Values.podSecurityContext.securityContext | nindent 12 }}
{{- end }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.selfSignedCertificate.enabled }}
command: [ "sh", "-c", "update-ca-certificates && python3 main.py" ]
{{- end }}
securityContext:
{{- if .Values.containerSecurityContext }}
{{- toYaml .Values.containerSecurityContext | nindent 14 }}
{{- end }}
env:
{{- if .Values.selfSignedCertificate.enabled }}
{{/* Used for requests library in python - For httpx please use SSL_CERT_FILE */}}
Expand Down
20 changes: 14 additions & 6 deletions charts/port-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,21 @@ env:

podAnnotations: {}

podSecurityContext:
enabled: true
securityContext:
fsGroup: 1001
runAsUser: 1001
podSecurityContext: {}
# Example
# runAsGroup: 1001
# runAsUser: 1001
# fsGroup: 1001
# fsGroupChangePolicy: "OnRootMismatch"
containerSecurityContext: {}
# Example
# runAsGroup: 1001
# runAsUser: 1001
# allowPrivilegeEscalation: false

securityContext: {}


rolloutStrategy: "Recreate"

resources:
requests:
Expand Down

0 comments on commit 9684220

Please sign in to comment.