Helper to transfer data to CephFs and setup wikis

This commit is contained in:
Paul-Henri Froidmont 2019-09-01 03:41:21 +02:00
parent 80321d5ec9
commit d77f2ef548
10 changed files with 163 additions and 39 deletions

View file

@ -0,0 +1,90 @@
- name: "{{ wiki_instance }} wiki deployment"
k8s:
namespace: default
state: present
definition:
apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ wiki_instance }}-wiki"
spec:
replicas: 2
selector:
matchLabels:
app: "{{ wiki_instance }}-wiki"
template:
metadata:
labels:
app: "{{ wiki_instance }}-wiki"
spec:
containers:
- name: "{{ wiki_instance }}-wiki"
image: bitnami/dokuwiki:0.20180422.201901061035
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
livenessProbe:
httpGet:
path: /
port: 80
readinessProbe:
httpGet:
path: /
port: 80
volumeMounts:
- mountPath: /bitnami
name: "{{ wiki_instance }}-wiki-data"
volumes:
- name: "{{ wiki_instance }}-wiki-data"
flexVolume:
driver: ceph.rook.io/rook
fsType: ceph
options:
fsName: ceph-fs # name of the filesystem specified in the filesystem CRD.
clusterNamespace: rook-ceph # namespace where the Rook cluster is deployed
path: /wiki/{{ wiki_instance }}
- name: "{{ wiki_instance }} wiki service"
k8s:
namespace: default
state: present
definition:
apiVersion: v1
kind: Service
metadata:
name: "{{ wiki_instance }}-wiki"
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 80
selector:
app: "{{ wiki_instance }}-wiki"
- name: "{{ wiki_instance }} wiki ingress"
k8s:
namespace: default
state: present
definition:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: "{{ wiki_instance }}"
annotations:
kubernetes.io/ingress.class: nginx
certmanager.k8s.io/cluster-issuer: "{{cert_manager_issuer}}"
# ingress.kubernetes.io/ssl-redirect: "true"
# ingress.kubernetes.io/ssl-temporary-redirect: "false"
spec:
rules:
- host: "{{ wiki_instance }}.{{banditlair_domain}}"
http:
paths:
- path: /
backend:
serviceName: "{{ wiki_instance }}-wiki"
servicePort: 80
tls:
- hosts:
- "{{ wiki_instance }}.{{banditlair_domain}}"
secretName: "{{ wiki_instance }}-cert"