From 405c3af791e167147e864b1696eb830761ea0ddd Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Sun, 15 Mar 2020 10:57:04 +0100 Subject: [PATCH] install influxdb --- _apps/influxdb.yaml | 21 ++++ influxdb/Makefile | 10 ++ influxdb/influx-config.yaml | 10 ++ influxdb/influxdb.yaml | 189 ++++++++++++++++++++++++++++++++++++ 4 files changed, 230 insertions(+) create mode 100644 _apps/influxdb.yaml create mode 100644 influxdb/Makefile create mode 100644 influxdb/influx-config.yaml create mode 100644 influxdb/influxdb.yaml diff --git a/_apps/influxdb.yaml b/_apps/influxdb.yaml new file mode 100644 index 0000000..5bf148a --- /dev/null +++ b/_apps/influxdb.yaml @@ -0,0 +1,21 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: influxdb + namespace: argocd + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + destination: + namespace: influxdb + server: https://kubernetes.default.svc + project: default + source: + path: influxdb + repoURL: https://git.tbrnt.ch/tobru/gitops-tbrnt.git + targetRevision: HEAD +--- +apiVersion: v1 +kind: Namespace +metadata: + name: influxdb diff --git a/influxdb/Makefile b/influxdb/Makefile new file mode 100644 index 0000000..130ef5b --- /dev/null +++ b/influxdb/Makefile @@ -0,0 +1,10 @@ +build: + helm3 template influxdb --namespace=influxdb influxdata/influxdb \ + -f influx-config.yaml \ + > influxdb.yaml +.PHONY: build + +update: + helm3 repo update + helm3 search repo influxdb +.PHONY: update diff --git a/influxdb/influx-config.yaml b/influxdb/influx-config.yaml new file mode 100644 index 0000000..d603065 --- /dev/null +++ b/influxdb/influx-config.yaml @@ -0,0 +1,10 @@ +persistence: + storageClass: local-path + +ingress: + enabled: true + tls: true + secretName: influx-tbrnt-ch-cert + hostname: influx.tbrnt.ch + annotations: + cert-manager.io/cluster-issuer: letsencrypt-prod diff --git a/influxdb/influxdb.yaml b/influxdb/influxdb.yaml new file mode 100644 index 0000000..9109d64 --- /dev/null +++ b/influxdb/influxdb.yaml @@ -0,0 +1,189 @@ +--- +# Source: influxdb/templates/serviceaccount.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: influxdb + labels: + helm.sh/chart: influxdb-4.4.1 + app.kubernetes.io/name: influxdb + app.kubernetes.io/instance: influxdb + app.kubernetes.io/version: "1.7.10" + app.kubernetes.io/managed-by: Helm +--- +# Source: influxdb/templates/configmap.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: influxdb + labels: + helm.sh/chart: influxdb-4.4.1 + app.kubernetes.io/name: influxdb + app.kubernetes.io/instance: influxdb + app.kubernetes.io/version: "1.7.10" + app.kubernetes.io/managed-by: Helm +data: + influxdb.conf: |+ + reporting-disabled = false + bind-address = ":8088" + + [meta] + dir = "/var/lib/influxdb/meta" + + [data] + dir = "/var/lib/influxdb/data" + wal-dir = "/var/lib/influxdb/wal" + + [coordinator] + + [retention] + + [shard-precreation] + + [monitor] + + [subscriber] + + [http] + + # TODO: allow multiple graphite listeners + + [[graphite]] + + # TODO: allow multiple collectd listeners with templates + + [[collectd]] + + # TODO: allow multiple opentsdb listeners with templates + + [[opentsdb]] + + # TODO: allow multiple udp listeners with templates + + [[udp]] + + [continuous_queries] + + [logging] +--- +# Source: influxdb/templates/service.yaml +apiVersion: v1 +kind: Service +metadata: + name: influxdb + labels: + helm.sh/chart: influxdb-4.4.1 + app.kubernetes.io/name: influxdb + app.kubernetes.io/instance: influxdb + app.kubernetes.io/version: "1.7.10" + app.kubernetes.io/managed-by: Helm +spec: + type: ClusterIP + ports: + - name: api + port: 8086 + targetPort: api + - name: rpc + port: 8088 + targetPort: rpc + selector: + app.kubernetes.io/name: influxdb + app.kubernetes.io/instance: influxdb +--- +# Source: influxdb/templates/statefulset.yaml +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: influxdb + labels: + helm.sh/chart: influxdb-4.4.1 + app.kubernetes.io/name: influxdb + app.kubernetes.io/instance: influxdb + app.kubernetes.io/version: "1.7.10" + app.kubernetes.io/managed-by: Helm +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: influxdb + app.kubernetes.io/instance: influxdb + serviceName: "influxdb" + template: + metadata: + labels: + app.kubernetes.io/name: influxdb + app.kubernetes.io/instance: influxdb + spec: + serviceAccountName: influxdb + containers: + - name: influxdb + image: "influxdb:1.7.10-alpine" + imagePullPolicy: "IfNotPresent" + resources: + {} + ports: + - name: api + containerPort: 8086 + - name: rpc + containerPort: 8088 + livenessProbe: + httpGet: + path: /ping + port: api + initialDelaySeconds: 30 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /ping + port: api + initialDelaySeconds: 5 + timeoutSeconds: 1 + volumeMounts: + - name: influxdb-data + mountPath: /var/lib/influxdb + - name: config + mountPath: /etc/influxdb + volumes: + - name: config + configMap: + name: influxdb + # Cannot use existing claim in enterprise mode + # Must use volume claim template in enterprise mode + volumeClaimTemplates: + - metadata: + name: influxdb-data + annotations: + spec: + accessModes: + - "ReadWriteOnce" + resources: + requests: + storage: "8Gi" + storageClassName: "local-path" +--- +# Source: influxdb/templates/ingress.yaml +apiVersion: networking.k8s.io/v1beta1 +kind: Ingress +metadata: + name: influxdb + labels: + helm.sh/chart: influxdb-4.4.1 + app.kubernetes.io/name: influxdb + app.kubernetes.io/instance: influxdb + app.kubernetes.io/version: "1.7.10" + app.kubernetes.io/managed-by: Helm + annotations: + cert-manager.io/cluster-issuer: letsencrypt-prod +spec: + tls: + - hosts: + - "influx.tbrnt.ch" + secretName: influx-tbrnt-ch-cert + rules: + - host: influx.tbrnt.ch + http: + paths: + - path: / + backend: + serviceName: influxdb + servicePort: 8086