Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mongodb: mongo:8 and securityContext #21

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading