Skip to content

Commit

Permalink
Update securityContext fields of testing pods
Browse files Browse the repository at this point in the history
  • Loading branch information
ramperher committed Oct 24, 2024
1 parent aeac852 commit 146e21f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ spec:
- cnf-app
- pkt-gen
topologyKey: kubernetes.io/hostname
securityContext:
runAsNonRoot: true
serviceAccountName: loadbalancer-account
{% if runtime_class_name is defined and runtime_class_name|length %}
runtimeClassName: "{{ runtime_class_name }}"
Expand Down Expand Up @@ -78,6 +80,7 @@ spec:
image: "{{ image_testpmd }}"
imagePullPolicy: "{{ image_pull_policy }}"
securityContext:
readOnlyRootFilesystem: true
{% if privileged %}
privileged: true
{% else %}
Expand Down
4 changes: 4 additions & 0 deletions testpmd-operator/roles/testpmd/templates/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ spec:
values:
- lb-app
topologyKey: kubernetes.io/hostname
securityContext:
runAsNonRoot: true
serviceAccountName: testpmd-account
{% if runtime_class_name is defined and runtime_class_name | length %}
runtimeClassName: "{{ runtime_class_name }}"
Expand All @@ -61,6 +63,8 @@ spec:
image: "{{ image_testpmd }}"
imagePullPolicy: "{{ image_pull_policy }}"
securityContext:
runAsNonRoot: true
readOnlyRootFilesystem: true
{% if privileged %}
privileged: true
{% else %}
Expand Down
5 changes: 5 additions & 0 deletions trex-operator/roles/app/templates/job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ spec:
{% endif %}
spec:
restartPolicy: Never
securityContext:
runAsNonRoot: true
serviceAccountName: trex-app-account
{% if runtime_class_name is defined and runtime_class_name | length %}
runtimeClassName: "{{ runtime_class_name }}"
Expand All @@ -24,6 +26,9 @@ spec:
- name: trex-app
image: "{{ image_app }}"
imagePullPolicy: "{{ image_pull_policy }}"
securityContext:
runAsNonRoot: true
readOnlyRootFilesystem: true
volumeMounts:
- name: varlog
mountPath: /var/log
Expand Down
7 changes: 7 additions & 0 deletions trex-operator/roles/server/templates/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ spec:
- cnf-app
{% endif %}
topologyKey: kubernetes.io/hostname
securityContext:
runAsNonRoot: true
serviceAccountName: trex-server-account
{% if runtime_class_name is defined and runtime_class_name | length %}
runtimeClassName: "{{ runtime_class_name }}"
Expand All @@ -79,6 +81,8 @@ spec:
- name: "http-probe"
containerPort: 8096
securityContext:
runAsNonRoot: true
readOnlyRootFilesystem: true
{% if privileged %}
privileged: true
{% else %}
Expand Down Expand Up @@ -151,6 +155,9 @@ spec:
- name: trex-app
image: "{{ image_app }}"
imagePullPolicy: "{{ image_pull_policy }}"
securityContext:
runAsNonRoot: true
readOnlyRootFilesystem: true
resources:
limits:
memory: "756Mi"
Expand Down

0 comments on commit 146e21f

Please sign in to comment.