70 lines
1.3 KiB
YAML
70 lines
1.3 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
|
|
resources:
|
|
requests:
|
|
cpu: "200m"
|
|
memory: "256Mi"
|
|
limits:
|
|
cpu: "500m"
|
|
memory: "512Mi"
|
|
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.203.100
|
|
path: /root/data/nfs/html
|
|
- name: config
|
|
nfs:
|
|
server: 10.3.203.100
|
|
path: /root/data/nfs/php
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: phpfpm
|
|
spec:
|
|
selector:
|
|
app: php
|
|
type: ClusterIP
|
|
ports:
|
|
- port: 9000
|
|
targetPort: 9000 |