Skip to content

Commit

Permalink
Merge pull request #23 from avanier/feature/add-security-context
Browse files Browse the repository at this point in the history
  • Loading branch information
James Rhoat authored Dec 20, 2022
2 parents ae4e899 + f6387f9 commit bd1f6c6
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
## Changelog

### V1.2.0

#### Non-Breaking Changes

- Added `securityContext` field to values.yaml

### V1.1.2

#### Non-Breaking Changes

- Fixed a bug where the `game-password` volume had an invalid name

### V1.1.1

#### Non-Breaking Changes

- Fixed a bug where the `account-data` volume had an invalid name
- Extended the pod's DNS config to ensure correct DNS resolution in certain
environments

### V1.1.0

#### Breaking Changes
Expand Down
2 changes: 1 addition & 1 deletion charts/factorio-server-charts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sources:
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.1.2
version: 1.2.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
12 changes: 9 additions & 3 deletions charts/factorio-server-charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ spec:
chown -vR factorio:factorio /factorio
chmod -vR 777 /factorio/configs
ls -alth /factorio
{{- with .Values.securityContext }}
securityContext:
runAsUser: 0
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- name: datadir
mountPath: /factorio
Expand Down Expand Up @@ -87,8 +89,10 @@ spec:
- |
mkdir -p /factorio/mods
bash /scripts/mod-downloader.sh
{{- with .Values.securityContext }}
securityContext:
runAsUser: 0
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- name: datadir
mountPath: /factorio
Expand All @@ -103,8 +107,10 @@ spec:
- name: {{ template "factorio-server-charts.fullname" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with .Values.securityContext }}
securityContext:
runAsUser: 0
{{- toYaml . | nindent 10 }}
{{- end }}
livenessProbe:
exec:
command:
Expand Down
4 changes: 3 additions & 1 deletion charts/factorio-server-charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
## @param strategy.type Strategy used to replace old pods
## @param tolerations Tolerations for pod assignment
## @param affinity Affinity rules for pod assignment

## @param securityContext Useful for fixing file permissions. See official [docs](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/).

replicaCount: 1

securityContext:
runAsUser: 0

#### Image Configuration ####
## @section Image Parameters
Expand Down

0 comments on commit bd1f6c6

Please sign in to comment.