0
Разверните официальное изображение nginx, смола не смонтирована правильно. Том с именем nginx-content был установлен в/etc/nginx/conf вместо/usr/share/www/html. Любой ответ будет оценен.Разверните официальное изображение nginx, смонтировать вертушку
Содержание YAML файла:
[[email protected] ~]# cat pv-nginx-con*
apiVersion: v1
kind: PersistentVolume
metadata:
name: nginx-conf
spec:
capacity:
storage: 2Gi
accessModes:
- ReadWriteMany
nfs:
server: 172.19.180.221
path: /nginxstandlone/conf
apiVersion: v1
kind: PersistentVolume
metadata:
name: nginx-content
spec:
capacity:
storage: 2Gi
accessModes:
- ReadWriteMany
nfs:
server: 172.19.180.221
path: /nginxstandlone/content
[[email protected] ~]# cat nginx
nginx-php7-gwr1.0.yaml nginx-php7.yaml nginxstandone_one.yaml nginxstandone.yaml
[[email protected] ~]# cat nginxstandone.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nginx-conf
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 2Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nginx-content
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 2Gi
---
apiVersion: v1
kind: Service
metadata:
name: nginx-standlone
spec:
ports:
- port: 8383
targetPort: 80
nodePort: 30065
protocol: TCP
selector:
app: nginx-standlone
type: NodePort
---
apiVersion: v1
kind: ReplicationController
metadata:
name: nginx-standlone-controller
spec:
replicas: 1
selector:
app: nginx-standlone
template:
metadata:
labels:
app: nginx-standlone
spec:
containers:
- name: nginx-standlone
image: docker.io/nginx
ports:
- containerPort: 80
volumeMounts:
- name: nginx-conf
mountPath: "/etc/nginx"
- name: nginx-content
mountPath: "/usr/share/nginx/html"
volumes:
- name: nginx-conf
persistentVolumeClaim:
claimName: nginx-conf
- name: nginx-content
persistentVolumeClaim:
claimName: nginx-content
[[email protected] ~]#