This commit is contained in:
Jarosław Karcewicz 2022-04-05 17:26:50 +02:00
parent 3752df60bd
commit 95f2d5f1b4
2 changed files with 125 additions and 0 deletions

View File

@ -0,0 +1,46 @@
apiVersion: v1
kind: Service
metadata:
name: nginx-headless
labels:
run: nginx-sts
spec:
ports:
- port: 80
name: web
clusterIP: None
selector:
run: nginx-sts
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: nginx-sts
spec:
serviceName: "nginx-headless"
replicas: 4
selector:
matchLabels:
run: nginx-sts
template:
metadata:
labels:
run: nginx-sts
spec:
containers:
- name: nginx
image: nginx
volumeMounts:
- name: www
mountPath: /var/www/
volumeClaimTemplates:
- metadata:
name: www
spec:
storageClassName: manual
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Mi

View File

@ -0,0 +1,79 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-nfs-pv0
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 100Mi
accessModes:
- ReadWriteOnce
nfs:
server: 192.168.100.179
path: "/kubenfs/pv0"
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-nfs-pv1
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 200Mi
accessModes:
- ReadWriteOnce
nfs:
server: 192.168.100.179
path: "/kubenfs/pv1"
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-nfs-pv2
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 200Mi
accessModes:
- ReadWriteOnce
nfs:
server: 192.168.100.179
path: "/kubenfs/pv2"
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-nfs-pv3
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 200Mi
accessModes:
- ReadWriteOnce
nfs:
server: 192.168.100.179
path: "/kubenfs/pv3"
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-nfs-pv4
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 200Mi
accessModes:
- ReadWriteOnce
nfs:
server: 192.168.100.179
path: "/kubenfs/pv4"