apiVersion: apps/v1
kind: Deployment
metadata:
  name: mongo-express
  labels:
    app: mongo-express
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mongo-express
  template:
    metadata:
      labels:
        app: mongo-express
      annotations:
        sidecar.istio.io/inject: "true"
    spec:
      containers:
      - name: mongo-express
        image: mongo-express:latest
        env:
        - name: ME_CONFIG_BASICAUTH_USERNAME
          value: "mongo-auth-username"
        - name: ME_CONFIG_BASICAUTH_PASSWORD
          value: "mongo-auth-password"
        - name: ME_CONFIG_MONGODB_PORT
          value: "27017"
        - name: ME_CONFIG_MONGODB_SERVER
          value: "mongodb-release"
        - name: ME_CONFIG_MONGODB_ENABLE_ADMIN
          value: "true"
        - name: ME_CONFIG_MONGODB_ADMINUSERNAME
          value: "root"
        - name: ME_CONFIG_MONGODB_ADMINPASSWORD
          value: "root-password"
        ports:
        - containerPort: 8081
      restartPolicy: Always
