Skip to content
Snippets Groups Projects
Commit 785227e7 authored by Dmitry Chirikov's avatar Dmitry Chirikov Committed by Derek Su
Browse files

Example for shared filesystem and ReadWriteMany mode

(cherry picked from commit 6e21862f)
parent b7e52660
No related branches found
No related tags found
No related merge requests found
apiVersion: apps/v1
kind: Deployment
metadata:
name: local-path-rwx-example
labels:
app: local-path-rwx-example
spec:
replicas: 2
selector:
matchLabels:
app: local-path-rwx-example
template:
metadata:
labels:
app: local-path-rwx-example
spec:
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app: local-path-rwx-example
containers:
- name: pause
image: busybox
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -c
- 'hostname >> /data/shared.txt; sleep 3; cat /data/shared.txt; sleep infinity'
volumeMounts:
- name: volv
mountPath: /data
ports:
- containerPort: 80
volumes:
- name: volv
persistentVolumeClaim:
claimName: local-path-rwx-example
# Plesase note, configuration of the Local Path Provisioner should be set correspondingly
# for this to work:
#
# data:
# config.json: |-
# {
# "sharedFileSystemPath": "/shared/fs/mounted/on/the/same/path/on/all/nodes"
# }
#
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: local-path-rwx-example
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
storageClassName: local-path
volumeMode: Filesystem
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment