From 8d7444f4ff20b70e98bad03d3b1e35981eac4932 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Thu, 8 Mar 2018 03:10:37 +0100 Subject: initial matomo deployment (not working yet) --- contrib/k8s-emc/acme-hack/do.sh | 5 +++- contrib/k8s-emc/matomo-deploy.yml | 48 ++++++++++++++++++++++++++++++++++++++ contrib/k8s-emc/matomo-ingress.yml | 23 ++++++++++++++++++ contrib/k8s-emc/matomo-svc.yml | 16 +++++++++++++ 4 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 contrib/k8s-emc/matomo-deploy.yml create mode 100644 contrib/k8s-emc/matomo-ingress.yml create mode 100644 contrib/k8s-emc/matomo-svc.yml (limited to 'contrib/k8s-emc') 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/g" | kubectl "$1" -f - cat nginx-acme-svc.yml | sed "s/<>/$node/g" | kubectl "$1" -f - cat nginx-acme-ingress.yml | sed "s/<>/$node/g" | sed "s/<>/$node/g" | sed "s/<>/$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 -- cgit v1.2.3