apiVersion: apps/v1
kind: Deployment
metadata:
  name: petclinic-app
spec:
  replicas: 1
  selector:
    matchLabels:
      service: app
  template:
    metadata:
      labels:
        service: app
    spec:
      containers:
        - name: app
          image: margol/spring-petclinic:color
          ports:
            - name: http
              containerPort: 8080
              protocol: TCP
          env:
            - name: SPRING_PROFILES_ACTIVE
              value: mysql
            - name: MYSQL_URL
              value: 'jdbc:mysql://petclinic-db:3306/petclinic'
          readinessProbe:
            httpGet:
              path: /
              port: 8080
            initialDelaySeconds: 10
            periodSeconds: 5
          livenessProbe:
            httpGet:
              path: /
              port: 8080
            initialDelaySeconds: 10
            periodSeconds: 5
