apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/name: accessing-data-mysql
  name: accessing-data-mysql
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: accessing-data-mysql
  template:
    metadata:
      labels:
        app.kubernetes.io/name: accessing-data-mysql
    spec:
      containers:
      - image: accessing-data-mysql:0.0.1-SNAPSHOT
        imagePullPolicy: IfNotPresent
        env:
          - name: MYSQL_DATABASE
            value: my_database
          - name: MYSQL_USER
            value: springuser
          - name: MYSQL_PASSWORD
            valueFrom:
              secretKeyRef:
                name: mysql
                key: mysql-password
          - name: SPRING_PROFILES_ACTIVE
            value: k8sdev
        livenessProbe:
          initialDelaySeconds: 60
          httpGet:
            path: /actuator/info
            port: 8080
        name: app
        ports:
        - containerPort: 8080
        readinessProbe:
          periodSeconds: 3
          failureThreshold: 20
          httpGet:
            path: /actuator/health
            port: 8080


