Skip to content

Instantly share code, notes, and snippets.

@noseka1
Last active June 2, 2023 20:01
Show Gist options
  • Save noseka1/01b7aaad22d0d0f6010323bf0ab61f0f to your computer and use it in GitHub Desktop.
Save noseka1/01b7aaad22d0d0f6010323bf0ab61f0f to your computer and use it in GitHub Desktop.
Share NFS volume across multiple pods
apiVersion: apps/v1
kind: Deployment
metadata:
name: nfs-example
spec:
replicas: 3
selector:
matchLabels:
app: nfs-example
template:
metadata:
labels:
app: nfs-example
spec:
containers:
- image: quay.io/noseka1/openshift-toolbox:basic
name: nfs-example
volumeMounts:
- mountPath: /home/toolbox
name: nfs-example
volumes:
- name: nfs-example
persistentVolumeClaim:
claimName: nfs-example
apiVersion: v1
kind: Pod
metadata:
name: nfs-example
spec:
containers:
- image: quay.io/noseka1/openshift-toolbox:basic
name: nfs-example
volumeMounts:
- mountPath: /home/toolbox
name: nfs-example
volumes:
- name: nfs-example
persistentVolumeClaim:
claimName: nfs-example
apiVersion: v1
kind: PersistentVolume
metadata:
name: nfs-example
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteMany
nfs:
path: /home/toolbox
server: 10.131.3.48
storageClassName: nfs-example
# claimRef:
# name: nfs-example
# namespace: xyz
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nfs-example
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
storageClassName: nfs-example
volumeName: nfs-example
Display the source blob
Display the rendered blob
Raw
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" style="background-color: rgb(255, 255, 255);" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="611px" height="301px" viewBox="-0.5 -0.5 611 301" content="&lt;mxfile host=&quot;app.diagrams.net&quot; modified=&quot;2020-07-24T17:32:23.125Z&quot; agent=&quot;5.0 (X11)&quot; etag=&quot;acXm3P5kHg1fMs2CCgbF&quot; version=&quot;13.5.3&quot; type=&quot;google&quot;&gt;&lt;diagram id=&quot;QZAUBjJ9wdsVO9zl7AYQ&quot; name=&quot;Page-1&quot;&gt;3Vhdb9owFP01kbaHTkmcQPsIoe1eqJCQWPfoxbeJNSdGjimwXz+bOOQTASuQalIefI/ta/vcY/vGFgqSzbPAy3jKCTDLtcnGQhPLdR3PdS392WSbIw9okAORoMQ0KoE5/QMGtA26ogSyWkPJOZN0WQdDnqYQyhqGheDrerM3zuqjLnEELWAeYtZGf1Ai4xy99+0S/w40iouRHdvUJLhobIAsxoSvKxB6tFAgOJd5KdkEwDR5BS95v6cDtfuJCUjlKR2elovps7yb4phmE+9lsg6XwZ2DcjfvmK3Mis1s5bagQPBVSkB7sS00XsdUwnyJQ127VkFXWCwTpixHFQnO4l1bbRjfICRsDs7a2XOhRAQ8ASm2qonp4HqGvm2hKGOvy2h4BcVxJRKoCAQ2Coj2vkuSVMHwdAZnbcpmIDKaSbWkBWerBCx3wNQ0xr+EKkW69GW2+PoxYi/ApV+n0h20qXS6qBxci0nvKJMBwzTppDPon0936B8n1L8loX6bUE4U4PTOle829nHv4hsc4OqDB+AVuOp/ow4PcIU+HVeod67uW1yppY7aOxBSMtIJirJSnkKdGdhQ+Vop/9SEfvONNdkYfnfGtjBSNf3XqlHppc2y284q+uUzA9JKhBoxULPnKxHC8atRYhGBPHbwt2NaiVnXsVlgAhiW9L0+3a44mhFmnKqFlMe2fUAyhYt8maZXNaNqOmpcqMhpOMp5aDnayWq/7H9X2kNLaZcQGULoKjLTTtT1TtWqQVxeet6J0vP7lJ53KAU7V3p+Q8PujaVXDHdh7X36A+5UlQ16VVnjTvSav0KnqswbNg44/8Yqc66isuF/I7NhnzJD95eSGepZZu3/0BecQLbLW5t6U6mqrIssk4L/hoAzLkoRvlHGGhBmNEqVGSo56BtwrBNfGmI2MhUJJUQP05k21xPriz+zNHb6/re1+szSISX3/CxameWjVx7C8ukQPf4F&lt;/diagram&gt;&lt;/mxfile&gt;"><defs/><g><rect x="190" y="0" width="420" height="300" fill="#ffffff" stroke="#000000" stroke-dasharray="3 3" pointer-events="all"/><rect x="0" y="120" width="120" height="60" fill="#ffffff" stroke="#000000" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 150px; margin-left: 1px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">PersistentVolume<br />(PV)</div></div></div></foreignObject><text x="60" y="154" fill="#000000" font-family="Helvetica" font-size="12px" text-anchor="middle">PersistentVolume...</text></switch></g><rect x="225" y="120" width="150" height="60" fill="#ffffff" stroke="#000000" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 148px; height: 1px; padding-top: 150px; margin-left: 226px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">PersistentVolumeClaim<br />(PVC)</div></div></div></foreignObject><text x="300" y="154" fill="#000000" font-family="Helvetica" font-size="12px" text-anchor="middle">PersistentVolumeClaim...</text></switch></g><rect x="470" y="20" width="120" height="60" fill="#ffffff" stroke="#000000" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 50px; margin-left: 471px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">Pod 1</div></div></div></foreignObject><text x="530" y="54" fill="#000000" font-family="Helvetica" font-size="12px" text-anchor="middle">Pod 1</text></switch></g><rect x="470" y="120" width="120" height="60" fill="#ffffff" stroke="#000000" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 150px; margin-left: 471px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">Pod 2</div></div></div></foreignObject><text x="530" y="154" fill="#000000" font-family="Helvetica" font-size="12px" text-anchor="middle">Pod 2</text></switch></g><rect x="470" y="220" width="120" height="60" fill="#ffffff" stroke="#000000" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 250px; margin-left: 471px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">Pod 3</div></div></div></foreignObject><text x="530" y="254" fill="#000000" font-family="Helvetica" font-size="12px" text-anchor="middle">Pod 3</text></switch></g><path d="M 120 150 L 225 150" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 150px; margin-left: 173px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; background-color: #ffffff; white-space: nowrap; ">1:1</div></div></div></foreignObject><text x="173" y="153" fill="#000000" font-family="Helvetica" font-size="11px" text-anchor="middle">1:1</text></switch></g><path d="M 375 139.98 L 470 50" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 375 150 L 470 150" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 375 165 L 470 250" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><rect x="220" y="10" width="40" height="20" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 38px; height: 1px; padding-top: 20px; margin-left: 221px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">Namespace</div></div></div></foreignObject><text x="240" y="24" fill="#000000" font-family="Helvetica" font-size="12px" text-anchor="middle">Namesp...</text></switch></g></g><switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a transform="translate(0,-5)" xlink:href="https://desk.draw.io/support/solutions/articles/16000042487" target="_blank"><text text-anchor="middle" font-size="10px" x="50%" y="100%">Viewer does not support full SVG 1.1</text></a></switch></svg>

Share NFS volume across multiple pods

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment