ReplicationController
apiVersion: v1
kind: ReplicationController
metadata:
name: baimeidashu-rc
spec:
# 表示运行几个Pod副本数量
replicas: 7
# 创建Pod的模板
template:
metadata:
labels:
apps: web
spec:
volumes:
- name: data
nfs:
server: master231
path: /baimeidashu/data/kubernetes
- name: etc
configMap:
name: nginx.conf
items:
- key: nginx.conf
path: nginx.conf
containers:
- name: web
image: harbor.baimeidashu.com/baimeidashu-web/nginx:1.25.1-alpine
volumeMounts:
- name: data
mountPath: /usr/share/nginx/html
- name: etc
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf