mirror of
https://github.com/phfroidmont/self-hosting.git
synced 2025-12-25 05:36:59 +01:00
Helper to transfer data to CephFs and setup wikis
This commit is contained in:
parent
80321d5ec9
commit
d77f2ef548
10 changed files with 163 additions and 39 deletions
90
roles/k8s-manifests/tasks/wiki.yml
Normal file
90
roles/k8s-manifests/tasks/wiki.yml
Normal 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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue