apiVersion: apps/v1
|
kind: StatefulSet
|
metadata:
|
labels:
|
app: example-mongodb-svc
|
name: example-mongodb
|
spec:
|
replicas: 1
|
revisionHistoryLimit: 10
|
selector:
|
matchLabels:
|
app: example-mongodb-svc
|
serviceName: example-mongodb-svc
|
template:
|
metadata:
|
labels:
|
app: example-mongodb-svc
|
spec:
|
containers:
|
- command:
|
- /bin/sh
|
- -c
|
- mongod --config /etc/mongod.conf --syslog
|
args:
|
- ""
|
env:
|
- name: AGENT_STATUS_FILEPATH
|
value: /healthstatus/agent-health-status.json
|
# If this image is specified, nothing will happen. The whole process just hangs.
|
image: docker.io/mongodb/mongodb-community-server:6.0.5-ubi8
|
# This image however, boots up correctly. It fails with
|
# │ {"t":{"$date":"2023-04-03T09:56:13.265Z"},"s":"F", "c":"CONTROL", "id":20574, "ctx":"-","msg":"Error during global initialization","attr":{"error":{"code":2,"codeName":"BadValue","errmsg":"logpath cannot be empty if supplied"}}}
|
# which is absolutely correct in this case.
|
# image: quay.io/sebastian_laskawiec_mongodb/mongodb-community-server:6.0.5-ubi8
|
imagePullPolicy: Always
|
name: mongod
|
resources:
|
limits:
|
cpu: "1"
|
memory: 500M
|
requests:
|
cpu: 500m
|
memory: 400M
|
terminationMessagePath: /dev/termination-log
|
terminationMessagePolicy: File
|
volumeMounts:
|
- mountPath: /data
|
name: data-volume
|
- mountPath: /var/lib/mongodb-mms-automation/authentication
|
name: example-mongodb-keyfile
|
- mountPath: /healthstatus
|
name: healthstatus
|
- mountPath: /hooks
|
name: hooks
|
- mountPath: /var/log/mongodb-mms-automation
|
name: logs-volume
|
- mountPath: /tmp
|
name: tmp
|
dnsPolicy: ClusterFirst
|
restartPolicy: Always
|
schedulerName: default-scheduler
|
securityContext: {}
|
terminationGracePeriodSeconds: 30
|
volumes:
|
- emptyDir: {}
|
name: agent-scripts
|
- name: automation-config
|
secret:
|
defaultMode: 416
|
secretName: example-mongodb-config
|
- emptyDir: {}
|
name: example-mongodb-keyfile
|
- emptyDir: {}
|
name: healthstatus
|
- emptyDir: {}
|
name: hooks
|
- emptyDir: {}
|
name: tmp
|
updateStrategy:
|
type: RollingUpdate
|
volumeClaimTemplates:
|
- apiVersion: v1
|
kind: PersistentVolumeClaim
|
metadata:
|
creationTimestamp: null
|
name: data-volume
|
spec:
|
accessModes:
|
- ReadWriteOnce
|
resources:
|
requests:
|
storage: 10G
|
volumeMode: Filesystem
|
status:
|
phase: Pending
|
- apiVersion: v1
|
kind: PersistentVolumeClaim
|
metadata:
|
creationTimestamp: null
|
name: logs-volume
|
spec:
|
accessModes:
|
- ReadWriteOnce
|
resources:
|
requests:
|
storage: 2G
|
volumeMode: Filesystem
|