apiVersion: v1
kind: Pod
metadata:
  name: monitor1-mongo
  namespace: default
  labels:
    app: monitor1-mongo
spec:
  affinity:
    nodeAffinity:
      preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 1
        preference:
          matchExpressions:
          - key: kubernetes.io/hostname
            operator: In
            values:
            - perl
            - host.local
  restartPolicy: Always
  containers:
  - name: monitor1-mongo
    image: mongo:latest
    ports:
      - name: web
        containerPort: 27017
        protocol: TCP
    env:
      - name: MONGO_INITDB_ROOT_USERNAME
        value: mongoadmin
      - name: MONGO_INITDB_ROOT_PASSWORD
        value: secret

