.
This commit is contained in:
parent
3752df60bd
commit
95f2d5f1b4
46
StatefullSet&DaemonSet/sts-nginx.yml
Normal file
46
StatefullSet&DaemonSet/sts-nginx.yml
Normal 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
|
79
StatefullSet&DaemonSet/sts-pv.yml
Normal file
79
StatefullSet&DaemonSet/sts-pv.yml
Normal 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"
|
Loading…
Reference in New Issue
Block a user