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.
 
 
 
 
 
 

101 lines
2.2 KiB

apiVersion: v1
kind: Service
metadata:
name: drupal
namespace: drupal
labels:
app: drupal
spec:
type: NodePort
ports:
- port: 80
nodePort: 30898
targetPort: drupal
selector:
app: drupal
tier: frontend
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: drupal-pv-claim
namespace: drupal
labels:
app: drupal
spec:
accessModes:
- ReadWriteOnce
storageClassName: ""
resources:
requests:
storage: 10Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: drupal
namespace: drupal
labels:
app: drupal
spec:
selector:
matchLabels:
app: drupal
tier: frontend
strategy:
type: Recreate
template:
metadata:
labels:
app: drupal
tier: frontend
spec:
initContainers:
-
name: init-sites-volume
image: drupal:latest
command: ['/bin/bash', '-c']
args: ['cp -r /var/www/html/sites/ /data/; chown www-data:www-data /data/ -R']
volumeMounts:
- mountPath: /data
name: drupal-persistent-storage
containers:
- image: drupal:latest
name: drupal
env:
- name: DB_TYPE
value: mysql
- name: DB_NAME
value: drupal
- name: DB_HOST
value: drupal-mysql
- name: DB_PASS
valueFrom:
secretKeyRef:
name: mysqldrupal-pass
key: password
- name: DB_USER
valueFrom:
secretKeyRef:
name: mysqldrupal-pass
key: db_user
ports:
- containerPort: 80
name: drupal
volumeMounts:
- name: drupal-persistent-storage
mountPath: /var/www/html/modules
subPath: modules
- name: drupal-persistent-storage
mountPath: /var/www/html/profiles
subPath: profiles
- name: drupal-persistent-storage
mountPath: /var/www/html/sites
subPath: sites
- name: drupal-persistent-storage
mountPath: /var/www/html/themes
subPath: themes
volumes:
- name: drupal-persistent-storage
persistentVolumeClaim:
claimName: drupal-pv-claim