Skip to content

Deploy storage example #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions content/deploy/storage/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: pvc-example
app.kubernetes.io/component: pvc-example
app.kubernetes.io/instance: pvc-example
app.kubernetes.io/part-of: pvc-example
app.openshift.io/runtime: redhat
name: pvc-example
spec:
replicas: 1
selector:
matchLabels:
app: pvc-example
type: Recreate
template:
metadata:
labels:
app: pvc-example
deploymentconfig: pvc-example
spec:
volumes:
- name: san
persistentVolumeClaim:
claimName: san
containers:
- image: registry.access.redhat.com/ubi8/ubi:latest
imagePullPolicy: Always
name: pvc-example
command:
- /bin/sh
- -c
- |
sleep infinity
resources: {}
volumeMounts:
- mountPath: /storage
name: san






12 changes: 12 additions & 0 deletions content/deploy/storage/pvc-storage-class.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: san
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: coe-netapp-san
volumeMode: Filesystem
17 changes: 17 additions & 0 deletions content/deploy/storage/same-share-different-namespaces/a-pv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: PersistentVolume
metadata:
creationTimestamp: null
labels:
type: shared-nfs
name: a-coe-isos
spec:
accessModes:
- ReadWriteMany
capacity:
storage: 500Gi
nfs:
path: /coe_iso
server: 10.32.97.1
persistentVolumeReclaimPolicy: Retain

17 changes: 17 additions & 0 deletions content/deploy/storage/same-share-different-namespaces/b-pv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: PersistentVolume
metadata:
creationTimestamp: null
labels:
type: shared-nfs
name: b-coe-isos
spec:
accessModes:
- ReadWriteMany
capacity:
storage: 500Gi
nfs:
path: /coe_iso
server: 10.32.97.1
persistentVolumeReclaimPolicy: Retain

Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: storage-exposer
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: storage-exposer
template:
metadata:
labels:
app: storage-exposer
spec:
automountServiceAccountToken: false
volumes:
- name: docroot
persistentVolumeClaim:
claimName: coe-isos
containers:
- image: registry.access.redhat.com/ubi8/nginx-120
name: nginx
resources:
limits:
ephemeral-storage: 40Mi
cpu: 0.5
memory: "512Mi"
requests:
ephemeral-storage: 20Mi
cpu: 0.5
memory: "512Mi"
volumeMounts:
- name: docroot
mountPath: /opt/app-root/src/
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
command:
- /bin/sh
- -c
- |
echo "location / { autoindex on; }" > ${NGINX_DEFAULT_CONF_PATH}/index-on.conf

/usr/libexec/s2i/run

triggers:
- type: ConfigChange
---
apiVersion: v1
kind: Service
metadata:
labels:
app: storage-exposer
name: storage-exposer
spec:
ports:
- name: 8080-8080
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: storage-exposer
sessionAffinity: None
type: ClusterIP
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
labels:
app: storage-exposer
name: storage-exposer
spec:
port:
targetPort: 8080
to:
kind: "Service"
name: storage-exposer
weight: null
tls:
termination: Edge
insecureEdgeTerminationPolicy: Redirect

Empty file.
17 changes: 17 additions & 0 deletions content/deploy/storage/same-share-different-namespaces/pv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: PersistentVolume
metadata:
creationTimestamp: null
labels:
type: static-nfs-2e4c62a0f0
name: coe-isos
spec:
accessModes:
- ReadWriteMany
capacity:
storage: 500Gi
nfs:
path: /coe_iso
server: 10.32.97.1
persistentVolumeReclaimPolicy: Retain

13 changes: 13 additions & 0 deletions content/deploy/storage/same-share-different-namespaces/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: coe-isos
spec:
storageClassName: ""
accessModes: [ "ReadWriteMany" ]
selector:
matchLabels:
type: "static-nfs-2e4c62a0f0"
resources:
requests:
storage: 500Gi