130 lines
3.1 KiB
YAML
130 lines
3.1 KiB
YAML
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: drupal
|
|
labels:
|
|
app: drupal
|
|
spec:
|
|
ports:
|
|
- port: 80
|
|
name: http
|
|
targetPort: http
|
|
selector:
|
|
app: drupal
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: drupal
|
|
labels:
|
|
app: drupal
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: 5Gi
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: drupal
|
|
labels:
|
|
app: drupal
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: drupal
|
|
strategy:
|
|
type: Recreate
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: drupal
|
|
spec:
|
|
initContainers:
|
|
- name: init-sites-volume
|
|
image: drupal
|
|
command: ["/bin/bash", "-c"]
|
|
args:
|
|
[
|
|
"cp -r /var/www/html/sites/ /data/; chown www-data:www-data /data/ -R",
|
|
]
|
|
volumeMounts:
|
|
- mountPath: /data
|
|
name: drupal
|
|
containers:
|
|
- image: registry.gitlab.com/oceanbox/fornix/oceanbox:dev
|
|
name: drupal
|
|
ports:
|
|
- containerPort: 80
|
|
name: http
|
|
protocol: TCP
|
|
env:
|
|
- name: DRUPAL_DATABASE_HOST
|
|
value: drupal-db-rw
|
|
- name: DRUPAL_DATABASE_PREFIX
|
|
value: ""
|
|
- name: DRUPAL_DATABASE_NAME
|
|
value: app
|
|
- name: DRUPAL_DATABASE_USERNAME
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: drupal-db-app
|
|
key: username
|
|
- name: DRUPAL_DATABASE_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: drupal-db-app
|
|
key: password
|
|
volumeMounts:
|
|
- mountPath: /var/www/html/modules
|
|
name: drupal
|
|
subPath: modules
|
|
- mountPath: /var/www/html/profiles
|
|
name: drupal
|
|
subPath: profiles
|
|
- mountPath: /var/www/html/sites
|
|
name: drupal
|
|
subPath: sites
|
|
- mountPath: /var/www/html/themes
|
|
name: drupal
|
|
subPath: themes
|
|
volumes:
|
|
- name: drupal
|
|
persistentVolumeClaim:
|
|
claimName: drupal
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
annotations:
|
|
cert-manager.io/cluster-issuer: letsencrypt-production
|
|
nginx.ingress.kubernetes.io/backend-protocol: HTTP
|
|
nginx.ingress.kubernetes.io/proxy-body-size: "0"
|
|
nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
|
|
nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
|
|
nginx.ingress.kubernetes.io/ssl-redirect: "true"
|
|
nginx.ingress.kubernetes.io/whitelist-source-range: 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,172.19.255.0/24,100.64.0.0/12
|
|
labels:
|
|
app.kubernetes.io/component: drupal
|
|
name: drupal
|
|
namespace: drupal
|
|
spec:
|
|
ingressClassName: nginx
|
|
rules:
|
|
- host: drupal.hel1.oceanbox.io
|
|
http:
|
|
paths:
|
|
- backend:
|
|
service:
|
|
name: drupal
|
|
port:
|
|
number: 80
|
|
path: /
|
|
pathType: Prefix
|
|
tls:
|
|
- hosts:
|
|
- drupal.hel1.oceanbox.io
|
|
secretName: drupal-tls
|