apiVersion: apps/v1
kind: Deployment
metadata:
  name: mongo
  labels:
    app: mongo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mongo
  template:
    metadata:
      labels:
        app: mongo
    spec:
      containers:
        - name: mongo
          image: mongo:5.0
          env:
            - name: MONGO_INITDB_ROOT_USERNAME
              value: root
          envFrom:
            - secretRef:
                name: mongo
          resources: {}
          volumeMounts:
            - mountPath: /data/db
              name: mongo
      restartPolicy: Always
      volumes:
        - name: mongo
          hostPath:
            path: /var/k8s/volumes/default/mongo
