apiVersion: v1
kind: Pod
metadata:
  name: tectonic-console-tester
  namespace: tectonic-system
  labels: 
    framework: protractor
spec:
  restartPolicy: Never
  imagePullSecrets:
    - name: coreos-console-ui-e2e-pull-secret
  volumes:
    - name: results
      persistentVolumeClaim:
        claimName: test-output
  containers:
    - name: tectonic-console-tester
      image: 'quay.io/coreos/tectonic-console-tester:protractor'
      imagePullPolicy: Always
      volumeMounts:
        - mountPath: "/out"
          name: results
      env:
        - name: BRIDGE_AUTH_USERNAME
          valueFrom:
            secretKeyRef:
              name: tectonic-console-tester
              key: username
        - name: BRIDGE_AUTH_PASSWORD
          valueFrom:
            secretKeyRef:
              name: tectonic-console-tester
              key: password
        - name: BRIDGE_BASE_ADDRESS
          valueFrom:
            configMapKeyRef:
              name: tectonic-config
              key: consoleBaseAddress
        - name: BRIDGE_BASE_PATH
          value: /

---

apiVersion: v1
kind: PersistentVolume
metadata:
  name: test-output-volume
spec:
  capacity:
    storage: 5Gi
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  storageClassName: slow
  hostPath:
    path: /tmp/test-output


---

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: test-output
  namespace: tectonic-system
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 5Gi
  storageClassName: slow
  selector:
    matchName:
      test-output-volume
