bureaucraten, interfacemoderatoren, Beheerders (Semantic MediaWiki), Curatoren (Semantic MediaWiki), Redacteuren (Semantic MediaWiki), toezichthouders, beheerders
205
bewerkingen
Regel 438: | Regel 438: | ||
Now that we know how to persistently store data and access it from Pods, it's time to create an actual Deployment with a real-world application in it. | Now that we know how to persistently store data and access it from Pods, it's time to create an actual Deployment with a real-world application in it. | ||
<pre> | <pre> | ||
$ cat nginx.yaml | |||
apiVersion: v1 | |||
kind: PersistentVolume | |||
metadata: | |||
name: nfs-html-storage | |||
spec: | |||
capacity: | |||
storage: 10Gi | |||
accessModes: | |||
- ReadWriteOnce | |||
nfs: | |||
path: /persistent/html | |||
server: <IP of nfs server> | |||
--- | |||
apiVersion: v1 | |||
kind: PersistentVolumeClaim | |||
metadata: | |||
name: nginx-webfiles | |||
spec: | |||
accessModes: | |||
- ReadWriteOnce | |||
resources: | |||
requests: | |||
storage: 2Gi | |||
--- | |||
apiVersion: apps/v1 | apiVersion: apps/v1 | ||
kind: Deployment | kind: Deployment | ||
Regel 457: | Regel 480: | ||
spec: | spec: | ||
volumes: | volumes: | ||
- name: | - name: webfiles | ||
persistentVolumeClaim: | |||
claimName: nginx-webfiles | |||
containers: | containers: | ||
- name: nginx | - name: nginx | ||
Regel 468: | Regel 490: | ||
volumeMounts: | volumeMounts: | ||
- mountPath: /usr/share/nginx/html | - mountPath: /usr/share/nginx/html | ||
name: | name: webfiles | ||
</pre> | </pre> | ||
Regel 477: | Regel 499: | ||
</pre> | </pre> | ||
Then, start the deployment: | Then, start the PV, PVC and deployment: | ||
<pre> | <pre> |