Skip to content

Commit

Permalink
Merge pull request #50 from port-labs/PORT-5612-port-agent-chart
Browse files Browse the repository at this point in the history
added security context and resource controls to port-agent
  • Loading branch information
MatanHeledPort authored Dec 18, 2023
2 parents 82eb3be + 9684220 commit 9cfd1fc
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
14 changes: 10 additions & 4 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,17 +28,17 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
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
22 changes: 20 additions & 2 deletions charts/port-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,28 @@ env:
podAnnotations: {}

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

securityContext: {}

resources: {}

rolloutStrategy: "Recreate"

resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "256Mi"
cpu: "200m"

nodeSelector: {}

Expand Down

0 comments on commit 9cfd1fc

Please sign in to comment.