longhorn/examples/deployment.yaml
Sheng Yang 5c5103d0a9 Sync with Manager
commit 0b3f97866bb0016d09c7054b9ad7c41ae3096484
Author: Sheng Yang <sheng.yang@rancher.com>
Date:   Tue Nov 12 23:15:45 2019 -0800

    Longhorn v0.7.0-rc2 release

Signed-off-by: Sheng Yang <sheng.yang@rancher.com>
2019-11-12 23:33:14 -08:00

70 lines
1.3 KiB
YAML

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
spec:
accessModes:
- ReadWriteOnce
storageClassName: longhorn
resources:
requests:
storage: 2Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql
labels:
app: mysql
spec:
selector:
matchLabels:
app: mysql # has to match .spec.template.metadata.labels
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
env:
- name: MYSQL_ROOT_PASSWORD
value: changeme
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