Home > Storage > PowerStore > Virtualization and Cloud > Dell PowerStore and SUSE Rancher > Deploy a database application
In the section Request storage from PowerStore using PVCs we showed you how to request specific storage from PowerStore systems using PVCs. Now, we will integrate the PVCs into an application deployment. This allows you to conveniently deploy both the application and its storage on-demand using a single deployment YAML file.
The following is an example of deploying a mysql database with multiple persistent volumes from PowerStore.
01 ---
02 apiVersion: v1
03 kind: Namespace
04 metadata:
05 name: mysql-powerstore
06 ---
07 apiVersion: v1
08 kind: Service
09 metadata:
10 name: mysql
11 namespace: mysql-powerstore
12 spec:
13 ports:
14 - port: 3306
15 selector:
16 app: mysql
17 ---
18 apiVersion: v1
19 kind: Secret
20 metadata:
21 name: mysql-secret
22 namespace: mysql-powerstore
23 type: kubernetes.io/basic-auth
24 stringData:
25 password: {mysql-root-password}
26 ---
27 kind: PersistentVolumeClaim
28 apiVersion: v1
29 metadata:
30 name: mysql-db-vol0
31 namespace: mysql-powerstore
32 spec:
33 accessModes:
34 - ReadWriteOnce
35 volumeMode: Filesystem
36 resources:
37 requests:
38 storage: 50Gi
39 storageClassName: powerstore-xfs-ps6
40 ---
41 kind: PersistentVolumeClaim
42 apiVersion: v1
43 metadata:
44 name: mysql-db-vol1
45 namespace: mysql-powerstore
46 spec:
47 accessModes:
48 - ReadWriteOnce
49 volumeMode: Filesystem
50 resources:
51 requests:
52 storage: 50Gi
53 storageClassName: powerstore-nfs-ps6
54 ---
55 apiVersion: apps/v1
56 kind: Deployment
57 metadata:
58 name: mysql
59 namespace: mysql-powerstore
60 spec:
61 selector:
62 matchLabels:
63 app: mysql
64 strategy:
65 type: Recreate
66 template:
67 metadata:
68 labels:
69 app: mysql
70 spec:
71 containers:
72 - image: mysql:latest
73 name: mysql
74 env:
75 - name: MYSQL_ROOT_PASSWORD
76 valueFrom:
77 secretKeyRef:
78 name: mysql-secret
79 key: password
80 ports:
81 - containerPort: 3306
82 name: mysql
83 volumeMounts:
84 - name: mysql-persistent-storage0
85 mountPath: /var/lib/mysql
86 - name: mysql-persistent-storage1
87 mountPath: /data
88 volumes:
89 - name: mysql-persistent-storage0
90 persistentVolumeClaim:
91 claimName: mysql-db-vol0
92 - name: mysql-persistent-storage1
93 persistentVolumeClaim:
94 claimName: mysql-db-vol1
Navigate to Cluster-Name > Workloads > Deployments and select the Execute Shell function to access the pod's shell. See Figure 25. This action is equivalent to running the following kubectl command:
kubectl -n mysql-powerstore exec --stdin \
--tty {mysql-pod-name} -- /bin/bash