apiVersion: apps/v1
kind: Deployment
metadata:
  name: guestbook
  labels:
    app: guestbook
spec:
  replicas: 1
  selector:
    matchLabels:
      app: guestbook
  template:
    metadata:
      labels:
        app: guestbook
    spec:
      containers:
      - name: guestbook
        image: ibmcom/guestbook:v1
        ports:
        - name: http-server
          containerPort: 3000
        env:
        - name: REDIS_MASTER_SERVICE_HOST
          valueFrom:
            secretKeyRef:
              name: guestbookcreds
              key: host
        - name: REDIS_MASTER_SERVICE_PORT
          valueFrom:
            secretKeyRef:
              name: guestbookcreds
              key: port
        - name: REDIS_MASTER_SERVICE_PASSWORD
          valueFrom:
            secretKeyRef:
              name: guestbookcreds
              key: password
