Добрый день. Пытаюсь объединить два контейнера в поде.
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: app
name: app-nginx
spec:
replicas: 1
selector:
matchLabels:
app: app
strategy:
type: Recreate
template:
metadata:
labels:
app: app
spec:
volumes:
- name: shared-files
emptyDir: {}
- name: shared-log
hostPath:
path: /env/var/log/nginx
- name: nginx-config-default
configMap:
name: nginx-default
- name: php-fpm
configMap:
name: php-fpm
- name: php-fpm-xdebug
configMap:
name: php-fpm-xdebug
containers:
- image: nginx:1.15.9
name: nginx
ports:
- containerPort: 80
volumeMounts:
- name: shared-files
mountPath: /var/www/
- name: shared-log
mountPath: /var/log/nginx
- name: nginx-config-default
mountPath: /etc/nginx/conf.d/default.conf
subPath: default.conf
- image: app
imagePullPolicy: Never
name: app
ports:
- containerPort: 11080
volumeMounts:
- name: shared-files
mountPath: /var/www
- name: php-fpm
mountPath: /etc/php/7.1/fpm/pool.d/www.conf
subPath: www.conf
- name: php-fpm-xdebug
mountPath: /usr/local/etc/php/conf.d/xdebug-dev.ini
subPath: xdebug-dev.ini
lifecycle:
postStart:
exec:
command: ["/bin/sh", "-c", "cp -r /app/. /var/www"]
status: {}
Почему папка var/www в поде пуста, хотя в контейнере app в папке есть файлы