Skip to content

Commit

Permalink
Add security context
Browse files Browse the repository at this point in the history
  • Loading branch information
peterzhongyi committed Jun 6, 2024
1 parent 2abfd71 commit 969863e
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions install/helm/agones/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ spec:
- name: agones-controller
image: "{{ .Values.agones.image.registry }}/{{ .Values.agones.image.controller.name}}:{{ default .Values.agones.image.tag .Values.agones.image.controller.tag }}"
imagePullPolicy: {{ .Values.agones.image.controller.pullPolicy }}
securityContext:
runAsNonRoot: true
runAsUser: 1000
allowPrivilegeEscalation: false
env:
# minimum port that can be exposed to GameServer traffic
- name: MIN_PORT
Expand Down
4 changes: 4 additions & 0 deletions install/helm/agones/templates/extensions-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ spec:
- name: agones-extensions
image: "{{ .Values.agones.image.registry }}/{{ .Values.agones.image.extensions.name}}:{{ default .Values.agones.image.tag .Values.agones.image.extensions.tag }}"
imagePullPolicy: {{ .Values.agones.image.extensions.pullPolicy }}
securityContext:
runAsNonRoot: true
runAsUser: 1001
allowPrivilegeEscalation: false
env:
- name: PROMETHEUS_EXPORTER
value: {{ .Values.agones.metrics.prometheusEnabled | quote }}
Expand Down
4 changes: 4 additions & 0 deletions install/helm/agones/templates/ping.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ spec:
- name: agones-ping
image: "{{ .Values.agones.image.registry }}/{{ .Values.agones.image.ping.name}}:{{ default .Values.agones.image.tag .Values.agones.image.ping.tag }}"
imagePullPolicy: {{ .Values.agones.image.ping.pullPolicy }}
securityContext:
runAsNonRoot: true
runAsUser: 1002
allowPrivilegeEscalation: false
{{- if .Values.agones.ping.resources }}
resources:
{{ toYaml .Values.agones.ping.resources | indent 12 }}
Expand Down
4 changes: 4 additions & 0 deletions install/helm/agones/templates/service/allocation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ spec:
- name: agones-allocator
image: "{{ .Values.agones.image.registry }}/{{ .Values.agones.image.allocator.name}}:{{ default .Values.agones.image.tag .Values.agones.image.allocator.tag }}"
imagePullPolicy: {{ .Values.agones.image.allocator.pullPolicy }}
securityContext:
runAsNonRoot: true
runAsUser: 1003
allowPrivilegeEscalation: false
livenessProbe:
httpGet:
path: /live
Expand Down
16 changes: 16 additions & 0 deletions install/yaml/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17061,6 +17061,10 @@ spec:
- name: agones-controller
image: "us-docker.pkg.dev/agones-images/release/agones-controller:1.41.0"
imagePullPolicy: IfNotPresent
securityContext:
runAsNonRoot: true
runAsUser: 1000
allowPrivilegeEscalation: false
env:
# minimum port that can be exposed to GameServer traffic
- name: MIN_PORT
Expand Down Expand Up @@ -17221,6 +17225,10 @@ spec:
- name: agones-extensions
image: "us-docker.pkg.dev/agones-images/release/agones-extensions:1.41.0"
imagePullPolicy: IfNotPresent
securityContext:
runAsNonRoot: true
runAsUser: 1001
allowPrivilegeEscalation: false
env:
- name: PROMETHEUS_EXPORTER
value: "true"
Expand Down Expand Up @@ -17358,6 +17366,10 @@ spec:
- name: agones-ping
image: "us-docker.pkg.dev/agones-images/release/agones-ping:1.41.0"
imagePullPolicy: IfNotPresent
securityContext:
runAsNonRoot: true
runAsUser: 1002
allowPrivilegeEscalation: false
livenessProbe:
httpGet:
port: 8080
Expand Down Expand Up @@ -17432,6 +17444,10 @@ spec:
- name: agones-allocator
image: "us-docker.pkg.dev/agones-images/release/agones-allocator:1.41.0"
imagePullPolicy: IfNotPresent
securityContext:
runAsNonRoot: true
runAsUser: 1003
allowPrivilegeEscalation: false
livenessProbe:
httpGet:
path: /live
Expand Down

0 comments on commit 969863e

Please sign in to comment.