apiVersion: apps/v1
kind: Deployment
metadata:
  name: watson-speech-to-text-frontend-deployment
  labels:
    app: watson-speech-to-text-frontend
spec:
  replicas: 2
  selector:
    matchLabels:
      app: watson-speech-to-text-frontend
  template:
    metadata:
      labels:
        app: watson-speech-to-text-frontend
    spec:
      containers:
        - name: watson-speech-to-text-frontend
          image: quay.io/wataru_nishiki1_ibm/watson-speech-to-text-frontend:latest
          imagePullPolicy: Always
          ports:
            - name: http-listener
              containerPort: 5000
              protocol: TCP
          env:
            - name: SPEECH_TO_TEXT_AUTH_TYPE
              valueFrom:
                secretKeyRef:
                  name: watson-speech-to-text-frontend-api-key
                  key: SPEECH_TO_TEXT_AUTH_TYPE
            - name: SPEECH_TO_TEXT_APIKEY
              valueFrom:
                secretKeyRef:
                  name: watson-speech-to-text-frontend-api-key
                  key: SPEECH_TO_TEXT_APIKEY
            - name: SPEECH_TO_TEXT_URL
              valueFrom:
                secretKeyRef:
                  name: watson-speech-to-text-frontend-api-key
                  key: SPEECH_TO_TEXT_URL
            - name: PORT
              valueFrom:
                secretKeyRef:
                  name: watson-speech-to-text-frontend-api-key
                  key: PORT
            # livenessProbe:
            #   httpGet:
            #     path: /
            #     port: 5000
            #   initialDelaySeconds: 3
            #   periodSeconds: 3
