This commit is contained in:
2024-02-20 17:15:27 +08:00
committed by huty
parent 6706e1a633
commit 34158042ad
1529 changed files with 177765 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: sleep
labels:
kiamol: ch08
spec:
selector:
matchLabels:
app: sleep
template:
metadata:
labels:
app: sleep
spec:
containers:
- name: sleep
image: kiamol/ch03-sleep
volumeMounts:
- name: backup
mountPath: "/backup"
readOnly: true
volumes:
- name: backup
persistentVolumeClaim:
claimName: todo-db-backup-pvc

View File

@@ -0,0 +1,45 @@
apiVersion: v1
kind: Service
metadata:
name: sleep-with-pvc
labels:
kiamol: ch08
spec:
selector:
app: sleep-with-pvc
clusterIP: None
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: sleep-with-pvc
labels:
kiamol: ch08
spec:
selector:
matchLabels:
app: sleep-with-pvc
serviceName: sleep-with-pvc
replicas: 2
template:
metadata:
labels:
app: sleep-with-pvc
spec:
containers:
- name: sleep
image: kiamol/ch03-sleep
volumeMounts:
- name: data
mountPath: /data
volumeClaimTemplates:
- metadata:
name: data
labels:
kiamol: ch08
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Mi

View File

@@ -0,0 +1,18 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: sleep
labels:
kiamol: ch08
spec:
selector:
matchLabels:
app: sleep
template:
metadata:
labels:
app: sleep
spec:
containers:
- name: sleep
image: kiamol/ch03-sleep