apiVersion: apps/v1
kind: Deployment
metadata:
  name: storage-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      component: storage
  template:
    metadata:
      labels:
        component: storage
    spec:
      volumes:
        - name: storage-volume
          persistentVolumeClaim:
            claimName: storage-pvc
      containers:
        - name: storage
          image: researchlabai/myapp-db
          ports:
            - containerPort: 3306
          volumeMounts:
            - name: storage-volume
              mountPath: /var/lib/mysql
          env:
            - name: MYSQL_ROOT_PASSWORD
              value: rootpassword
            - name: MYSQL_DATABASE
              value: myapp
            - name: MYSQL_USER
              value: user
            - name: MYSQL_PASSWORD
              value: userpassword
