summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2018-03-08 03:10:37 +0100
committerChristian Pointner <equinox@spreadspace.org>2018-03-08 03:10:37 +0100
commit8d7444f4ff20b70e98bad03d3b1e35981eac4932 (patch)
tree141402f1c2d26fccdeded0c25a6293bb275ee55d /contrib
parentadded improvised onion service site (diff)
initial matomo deployment (not working yet)
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/k8s-emc/acme-hack/do.sh5
-rw-r--r--contrib/k8s-emc/matomo-deploy.yml48
-rw-r--r--contrib/k8s-emc/matomo-ingress.yml23
-rw-r--r--contrib/k8s-emc/matomo-svc.yml16
4 files changed, 91 insertions, 1 deletions
diff --git a/contrib/k8s-emc/acme-hack/do.sh b/contrib/k8s-emc/acme-hack/do.sh
index 86cef5d..beaae3a 100755
--- a/contrib/k8s-emc/acme-hack/do.sh
+++ b/contrib/k8s-emc/acme-hack/do.sh
@@ -5,8 +5,11 @@ if [ -z "$1" ]; then
exit 1
fi
+#HOSTS="emc-00 emc-01 emc-02 emc-03 emc-04 emc-05 emc-06 helene"
+HOSTS="emc-00"
+
kubectl "$1" -f nginx-acme-cm.yml
-for node in emc-00 emc-01 emc-02 emc-03 emc-04 emc-05 emc-06 helene; do
+for node in $HOSTS; do
cat nginx-acme-deploy.yml | sed "s/<<node>>/$node/g" | kubectl "$1" -f -
cat nginx-acme-svc.yml | sed "s/<<node>>/$node/g" | kubectl "$1" -f -
cat nginx-acme-ingress.yml | sed "s/<<name>>/$node/g" | sed "s/<<node>>/$node/g" | sed "s/<<hostname>>/$node.spreadspace.org/g" | kubectl "$1" -f -
diff --git a/contrib/k8s-emc/matomo-deploy.yml b/contrib/k8s-emc/matomo-deploy.yml
new file mode 100644
index 0000000..29cbd87
--- /dev/null
+++ b/contrib/k8s-emc/matomo-deploy.yml
@@ -0,0 +1,48 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ namespace: emc
+ name: stats-matomo
+ labels:
+ app: matomo
+ tier: stats
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: matomo
+ tier: stats
+ strategy:
+ type: Recreate
+ revisionHistoryLimit: 5
+ template:
+ metadata:
+ labels:
+ app: matomo
+ tier: stats
+ spec:
+ nodeName: emc-stats
+ securityContext:
+ runAsUser: 998
+ fsGroup: 998
+ initContainers:
+ - name: prepare-matomo-html
+ image: busybox
+ command: ['sh', '-c', 'chown 998:998 /srv/html && chmod 700 /srv/html']
+ securityContext:
+ runAsUser: 0
+ volumeMounts:
+ - name: matomo-html
+ mountPath: /srv/html
+ containers:
+ - name: matomo
+ image: spreadspace/matomo:2
+ imagePullPolicy: Always
+ volumeMounts:
+ - name: matomo-html
+ mountPath: /var/www/html
+ volumes:
+ - name: matomo-html
+ hostPath:
+ type: DirectoryOrCreate
+ path: /srv/stats/matomo
diff --git a/contrib/k8s-emc/matomo-ingress.yml b/contrib/k8s-emc/matomo-ingress.yml
new file mode 100644
index 0000000..fae82c3
--- /dev/null
+++ b/contrib/k8s-emc/matomo-ingress.yml
@@ -0,0 +1,23 @@
+apiVersion: extensions/v1beta1
+kind: Ingress
+metadata:
+ namespace: emc
+ name: stats-matomo
+ labels:
+ app: matomo
+ tier: stats
+ annotations:
+ nginx.ingress.kubernetes.io/rewrite-target: /
+spec:
+ tls:
+ - secretName: stream-stats-tls
+ hosts:
+ - elevate-stats.spreadspace.org
+ rules:
+ - host: elevate-stats.spreadspace.org
+ http:
+ paths:
+ - path: /matomo
+ backend:
+ serviceName: stats-matomo
+ servicePort: 8080
diff --git a/contrib/k8s-emc/matomo-svc.yml b/contrib/k8s-emc/matomo-svc.yml
new file mode 100644
index 0000000..4bac3c7
--- /dev/null
+++ b/contrib/k8s-emc/matomo-svc.yml
@@ -0,0 +1,16 @@
+apiVersion: v1
+kind: Service
+metadata:
+ namespace: emc
+ name: stats-matomo
+ labels:
+ app: matomo
+ tier: stats
+spec:
+ selector:
+ app: matomo
+ tier: stats
+ clusterIP: 172.18.242.14
+ ports:
+ - name: http
+ port: 8080