-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path05-shared-storage.yaml
58 lines (57 loc) · 1.16 KB
/
05-shared-storage.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: file-storage-claim
spec:
accessModes:
- ReadWriteMany
storageClassName: azurefile-premium
resources:
requests:
storage: 100Gi
---
apiVersion: v1
kind: Service
metadata:
name: volumes-lb
spec:
type: LoadBalancer
ports:
- port: 80
selector:
app: nginx
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: dynamic-shared-storage
spec:
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
initContainers:
- name: index-html-producer
image: busybox
command: [ 'sh', '-c', 'echo "<p>hello from $HOSTNAME</p>" >> /usr/share/nginx/html/index.html' ]
volumeMounts:
- name: html
mountPath: /usr/share/nginx/html
readOnly: false
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
volumeMounts:
- name: html
mountPath: /usr/share/nginx/html
readOnly: true
volumes:
- name: html
persistentVolumeClaim:
claimName: file-storage-claim