kind: Deployment
apiVersion: apps/v1
metadata:
  name: jpetstoreweb
spec:
  replicas: 1
  selector:
      matchLabels:
        app: jpetstoreweb
  template:
    metadata:
      labels:
        app: jpetstoreweb
    spec:
      containers:
      - name: jpetstoreweb
        image: "{{ .Values.image.repository }}/jpetstoreweb:{{ .Values.image.tag }}"
        imagePullPolicy: Always
        env:
          - name: VERSION
            value: "1"
          - name: mysqlUrl
            valueFrom:
              secretKeyRef:
                name: mysql-creds
                key: mysql.url
          - name: mysqlUser
            valueFrom:
                secretKeyRef:
                  name: mysql-creds
                  key: mysql.username
          - name: mysqlPass
            valueFrom:
              secretKeyRef:
                name: mysql-creds
                key: mysql.password
        ports:
        - containerPort: 9080
        readinessProbe:
          httpGet:
            path: /
            port: 9080
          initialDelaySeconds: 10
          periodSeconds: 5

