81 lines
1.4 KiB
YAML
81 lines
1.4 KiB
YAML
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: html
|
|
namespace: demo
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteMany
|
|
resources:
|
|
requests:
|
|
storage: 8M
|
|
storageClassName: cephfs-hyper
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: nginx
|
|
namespace: demo
|
|
labels:
|
|
app: nginx
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: nginx
|
|
template:
|
|
metadata:
|
|
annotations:
|
|
#backup.velero.io/backup-volumes: html
|
|
labels:
|
|
app: nginx
|
|
spec:
|
|
containers:
|
|
- name: nginx
|
|
image: nginx
|
|
imagePullPolicy: IfNotPresent
|
|
ports:
|
|
- containerPort: 443
|
|
- containerPort: 80
|
|
env:
|
|
- name: PUID
|
|
value: "1000"
|
|
- name: PGID
|
|
value: "1000"
|
|
volumeMounts:
|
|
- mountPath: /usr/share/nginx/html
|
|
name: html
|
|
volumes:
|
|
- name: html
|
|
persistentVolumeClaim:
|
|
claimName: html
|
|
readOnly: false
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: nginx
|
|
namespace: demo
|
|
labels:
|
|
app.kubernetes.io/name: demo-app
|
|
spec:
|
|
internalTrafficPolicy: Cluster
|
|
ipFamilies:
|
|
- IPv6
|
|
- IPv4
|
|
ipFamilyPolicy: PreferDualStack
|
|
#ipFamilyPolicy: SingleStack
|
|
ports:
|
|
- name: https
|
|
port: 443
|
|
protocol: TCP
|
|
targetPort: 443
|
|
- name: http
|
|
port: 80
|
|
protocol: TCP
|
|
targetPort: 80
|
|
selector:
|
|
app: nginx
|
|
#sessionAffinity: None
|
|
type: ClusterIP
|