
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mysql-magnetic
  labels:
    app: mysql-magnetic
spec:
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: mysql-magnetic
  template:
    metadata:
      labels:
        app: mysql-magnetic
    spec:
      containers:
      - image: mariadb:10.4
        name: mysql-magnetic
        env:
        - name: MYSQL_ROOT_PASSWORD
          value: changeme
        ports:
        - containerPort: 3306
          name: mysql-magnetic
        
        volumeMounts:
        - name: mysql-magnetic-volume
          mountPath: /var/lib/mysql
        
        env:
        - name: MYSQL_ROOT_PASSWORD
          value: "rancher"
      
      nodeSelector:
        database: magnetic

      volumes:
      - name: mysql-magnetic-volume
        hostPath:
          path: /opt/default/mysql-ssd-volume
      #- name: mysql-volume
      #  nfs: 
      #    path: /var/rancher/nfs/homolog/testejon/redis
      #    server: 10.33.1.185



