You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.3 KiB
42 lines
1.3 KiB
6 years ago
|
apiVersion: apps/v1
|
||
|
kind: Deployment
|
||
|
metadata:
|
||
|
name: nginx-deploy
|
||
|
namespace: epdc-nginx
|
||
|
labels:
|
||
|
deploy: nginx-deploy
|
||
|
spec:
|
||
|
replicas: 1
|
||
|
selector:
|
||
|
matchLabels:
|
||
|
app: nginx-pod
|
||
|
template:
|
||
|
metadata:
|
||
|
labels:
|
||
|
app: nginx-pod
|
||
|
spec:
|
||
|
containers:
|
||
|
- name: nginx-container
|
||
|
image: nginx
|
||
|
ports:
|
||
|
- containerPort: 443
|
||
|
name: nginx-443
|
||
|
volumeMounts:
|
||
|
- name: nginx-persistent-storage-01
|
||
|
mountPath: /usr/share/nginx/html
|
||
|
- name: nginx-persistent-storage-02
|
||
|
mountPath: /etc/nginx #MySQL容器的数据都是存在这个目录的,要对这个目录做数据持久化
|
||
|
readOnly: true
|
||
|
- name: nginx-persistent-storage-03 #表示一个挂载点的名称
|
||
|
mountPath: /var/log/nginx #表示新挂载点的路径,这里就是mysql配置文件的路径
|
||
|
volumes:
|
||
|
- name: nginx-persistent-storage-01
|
||
|
persistentVolumeClaim:
|
||
|
claimName: nginx-data-pvc #指定pvc的名称
|
||
|
- name: nginx-persistent-storage-02
|
||
|
persistentVolumeClaim:
|
||
|
claimName: nginx-etc-pvc
|
||
|
- name: nginx-persistent-storage-03
|
||
|
persistentVolumeClaim:
|
||
|
claimName: nginx-log-pvc
|