This message was deleted.
# longhorn-storage
a
This message was deleted.
t
this deployment below seems to work fine on a bare metal k8s cluster with longhorn 1.6.0
Copy code
apiVersion: v1
kind: Service
metadata:
  name: mysql
  labels:
    app: mysql
spec:
  ports:
    - port: 3306
  selector:
    app: mysql
  clusterIP: None
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: mysql-pvc
  namespace: default
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: longhorn
  resources:
    requests:
      storage: 2Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mysql
  labels:
    app: mysql
  namespace: default
spec:
  selector:
    matchLabels:
      app: mysql
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: mysql
    spec:
      restartPolicy: Always
      containers:
      - image: mysql:5.6
        name: mysql
        livenessProbe:
          exec:
            command:
              - ls
              - /var/lib/mysql/lost+found
          initialDelaySeconds: 5
          periodSeconds: 5
        ports:
        - containerPort: 3306
          name: mysql
        volumeMounts:
        - name: mysql-volume
          mountPath: /var/lib/mysql
        env:
        - name: MYSQL_ROOT_PASSWORD
          value: "rancher"
      volumes:
      - name: mysql-volume
        persistentVolumeClaim:
          claimName: mysql-pvc
c
Enter longhorn and check the settings for space
if you have enough space on your nodes in order to provision the volume
f
To my knowledge, no one has successfully run Longhorn in a KiND cluster. See: • https://github.com/longhorn/longhorn/issues/3643https://github.com/longhorn/longhorn/discussions/2702 It looks like very recent progress has been made in: • https://github.com/longhorn/longhorn/issues/5693https://github.com/longhorn/longhorn/issues/8158 This is currently not a tested or supported deployment, but it may be in the future. Please feel free to chime in on the recent issues or try it out with Longhorn v1.6.1 (which will have the result of https://github.com/longhorn/longhorn/issues/5693) when it releases.
👍 1