Skip to content

Commit

Permalink
Merge pull request #21 from humanitec-architecture/mathieu-benoit-pat…
Browse files Browse the repository at this point in the history
…ch-1

`mongodb`: `mongo:8` and `securityContext`
  • Loading branch information
mathieu-benoit authored Oct 15, 2024
2 parents 5638c57 + 65a2b16 commit 0d8d2e6
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions humanitec-resource-defs/mongodb/basic/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ deployment.yaml:
labels:
app: {{ .init.id }}
spec:
automountServiceAccountToken: false
containers:
- name: mongodb
image: mongo:7
image: mongo:8
ports:
- containerPort: {{ .init.port }}
env:
Expand All @@ -57,13 +58,31 @@ deployment.yaml:
secretKeyRef:
name: {{ .init.id }}
key: MONGO_INITDB_ROOT_PASSWORD
securityContext:
runAsUser: 1001
runAsGroup: 1001
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
volumeMounts:
- name: data
mountPath: /data/db
- name: data
mountPath: /data/db
- name: tmp
mountPath: /tmp
securityContext:
runAsNonRoot: true
fsGroup: 1001
seccompProfile:
type: RuntimeDefault
volumes:
- name: data
persistentVolumeClaim:
claimName: pvc-{{ .init.id }}
- name: tmp
emptyDir: {}
pvc.yaml:
location: namespace
data:
Expand All @@ -76,7 +95,7 @@ pvc.yaml:
- ReadWriteOnce
resources:
requests:
storage: 10G
storage: 1G
service.yaml:
location: namespace
data:
Expand Down

0 comments on commit 0d8d2e6

Please sign in to comment.