From 2e17aaf2387bf8333d53b70a5dfaaf0907b59da3 Mon Sep 17 00:00:00 2001 From: auricom <27022259+auricom@users.noreply.github.com> Date: Thu, 15 Jul 2021 14:30:20 +0200 Subject: [PATCH] feat: uptime-kuma --- cluster/apps/monitoring/kustomization.yaml | 1 + .../monitoring/uptime-kuma/kustomization.yaml | 5 + .../monitoring/uptime-kuma/statefulset.yaml | 91 +++++++++++++++++++ .../apps/monitoring/uptime-kuma/volume.yaml | 15 +++ 4 files changed, 112 insertions(+) create mode 100644 cluster/apps/monitoring/uptime-kuma/kustomization.yaml create mode 100644 cluster/apps/monitoring/uptime-kuma/statefulset.yaml create mode 100644 cluster/apps/monitoring/uptime-kuma/volume.yaml diff --git a/cluster/apps/monitoring/kustomization.yaml b/cluster/apps/monitoring/kustomization.yaml index 40d42d3ee..22a107b03 100644 --- a/cluster/apps/monitoring/kustomization.yaml +++ b/cluster/apps/monitoring/kustomization.yaml @@ -7,3 +7,4 @@ resources: - kube-prometheus-stack - loki-stack - thanos + - uptime-kuma diff --git a/cluster/apps/monitoring/uptime-kuma/kustomization.yaml b/cluster/apps/monitoring/uptime-kuma/kustomization.yaml new file mode 100644 index 000000000..c6a5fa7c7 --- /dev/null +++ b/cluster/apps/monitoring/uptime-kuma/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - statefulset.yaml + - volume.yaml diff --git a/cluster/apps/monitoring/uptime-kuma/statefulset.yaml b/cluster/apps/monitoring/uptime-kuma/statefulset.yaml new file mode 100644 index 000000000..7ec055ded --- /dev/null +++ b/cluster/apps/monitoring/uptime-kuma/statefulset.yaml @@ -0,0 +1,91 @@ +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: uptime-kuma + namespace: monitoring + labels: + app.kubernetes.io/instance: uptime-kuma + app.kubernetes.io/name: uptime-kuma +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/instance: uptime-kuma + app.kubernetes.io/name: uptime-kuma + updateStrategy: + type: RollingUpdate + serviceName: uptime-kuma + strategy: + template: + metadata: + labels: + app.kubernetes.io/instance: uptime-kuma + app.kubernetes.io/name: uptime-kuma + spec: + containers: + - image: louislam/uptime-kuma:1.0.4 + name: uptime-kuma + ports: + - containerPort: 3001 + name: http + volumeMounts: + - name: config + mountPath: /app/data + subPath: claude + volumes: + - name: config + persistentVolumeClaim: + claimName: uptime-kuma-config + dnsConfig: + options: + - name: ndots + value: "1" +--- +apiVersion: v1 +kind: Service +metadata: + annotations: + prometheus.io/probe: "true" + prometheus.io/protocol: tcp + labels: + app.kubernetes.io/instance: uptime-kuma + app.kubernetes.io/name: uptime-kuma + name: uptime-kuma + namespace: monitoring +spec: + ports: + - name: http + port: 3001 + protocol: TCP + targetPort: 3001 + selector: + app.kubernetes.io/instance: uptime-kuma + app.kubernetes.io/name: uptime-kuma + type: ClusterIP +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + kubernetes.io/ingress.class: "nginx" + labels: + app.kubernetes.io/instance: uptime-kuma + app.kubernetes.io/name: uptime-kuma + name: uptime-kuma + namespace: monitoring +spec: + rules: + - host: uptime-kuma.${SECRET_CLUSTER_DOMAIN} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: uptime-kuma + port: + number: 3001 + tls: + - hosts: + - uptime-kuma.${SECRET_CLUSTER_DOMAIN} diff --git a/cluster/apps/monitoring/uptime-kuma/volume.yaml b/cluster/apps/monitoring/uptime-kuma/volume.yaml new file mode 100644 index 000000000..750d7f90b --- /dev/null +++ b/cluster/apps/monitoring/uptime-kuma/volume.yaml @@ -0,0 +1,15 @@ +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: uptime-kuma-config + namespace: monitoring + labels: + kasten-io-snapshots: "enable" +spec: + accessModes: + - ReadWriteOnce + storageClassName: rook-ceph-block + resources: + requests: + storage: 1Gi