Files
Cloud-book/Kubernetes/resources/02.phpfpm_v2.yaml
2025-08-27 17:10:05 +08:00

63 lines
1.2 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: php
name: php
spec:
replicas: 3
selector:
matchLabels:
app: php
template:
metadata:
labels:
app: php
spec:
containers:
- name: myapp
image: myphp:7.4-fpm
ports:
- containerPort: 9000
livenessProbe:
tcpSocket:
port: 9000
initialDelaySeconds: 15
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
tcpSocket:
port: 9000
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 2
volumeMounts:
- name: html
mountPath: /usr/share/nginx/html
- name: config
mountPath: /usr/local/etc
volumes:
- name: html
nfs:
server: 10.3.204.100
path: /root/data/nfs/html
- name: config
nfs:
server: 10.3.204.100
path: /root/data/nfs/php
---
apiVersion: v1
kind: Service
metadata:
name: phpfpm
spec:
selector:
app: php
type: ClusterIP
ports:
- port: 9000
targetPort: 9000