Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space FUNCTDEV and version SVC2025.3

...

Code Block
languageyml
titledatarepo.yaml
apiVersion: v1
kind: Pod
metadata:
  name: datarepo
  labels:
    app: datarepo
spec:
# If using NFS for the persistent volume, uncomment the following lines and run the pod with the UID of the owner of the <shared_path>.
# securityContext:
#   runAsUser: <UID>
  volumes:
  - name: datarepo-volume
    persistentVolumeClaim:
      claimName: datarepo-pvc
# To run the Data Repository server with SSL, uncomment the following lines
#  - name: datarepo-sslcert-file
#    configMap:
#      name: datarepo-sslcert
  containers:
  - name: datarepo
    image: mongo:latest
    imagePullPolicy: IfNotPresent
    volumeMounts:
    - name: datarepo-volume
      mountPath: /data/db
# To run the Data Repository server with SSL, uncomment the following lines
#    - name: datarepo-sslcert-file
#      mountPath: /etc/sslCert.pem
#      subPath: sslCert.pem
#    command: ["mongod", "--ipv6", "--bind_ip_all", "--sslMode", "requireSSL", "--sslPEMKeyFile", "/etc/sslCert.pem", "--auth"]
    startupProbe:
      exec:
# To runcheck the health of the Data Repository server with SSL or not, choose one of the following lines to uncomment based on if the server is running with or without SSL
#        command: ["/bin/sh", "-c" "mongosh --host 127.0.0.1 --port 27017 --ssl --sslAllowInvalidCertificates --quiet test --eval 'quit(0)'"]
        command: ["/bin/sh", "-c" "mongosh --host 127.0.0.1 --port 27017 --quiet test --eval 'quit(0)'"]
      initialDelaySeconds: 30
      periodSeconds: 30
      timeoutSeconds: 10
      failureThreshold: 3
    livenessProbe:
      exec:
# To run the Data Repository server with SSL or not, choose one of the following lines to uncomment
#        command: ["/bin/sh", "-c" "mongosh --host 127.0.0.1 --port 27017 --ssl --sslAllowInvalidCertificates --quiet test --eval 'quit(0)'"]
        command: ["/bin/sh", "-c" "mongosh --host 127.0.0.1 --port 27017 --quiet test --eval 'quit(0)'"]
      initialDelaySeconds: 30
      periodSeconds: 30
      timeoutSeconds: 10
    env:
    - name: MONGO_INITDB_ROOT_USERNAME
      valueFrom:
        secretKeyRef:
          name: datarepo-login
          key: username
          optional: false
    - name: MONGO_INITDB_ROOT_PASSWORD
      valueFrom:
        secretKeyRef:
          name: datarepo-login
          key: password
          optional: false
---
apiVersion: v1
kind: Service
metadata:
  name: datarepo
  labels:
    run: datarepo
spec:
  type: NodePort
  ports:
  - port: 27017
    protocol: TCP
    targetPort: 27017
    nodePort: 30017
  selector:
    app: datarepo

...