From dd721302ee283c2529cf0bf1095ab81fc6982936 Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Sun, 27 Oct 2024 21:18:27 -0500 Subject: [PATCH] add influxdb --- .../apps/database/influxdb/app/gatus.yaml | 21 ++++++++ .../database/influxdb/app/helmrelease.yaml | 54 +++++++++++++++++++ .../database/influxdb/app/kustomization.yaml | 7 +++ kubernetes/apps/database/influxdb/ks.yaml | 25 +++++++++ kubernetes/apps/database/kustomization.yaml | 1 + .../flux/repositories/helm/influxdata.yaml | 10 ++++ .../flux/repositories/helm/kustomization.yaml | 1 + 7 files changed, 119 insertions(+) create mode 100644 kubernetes/apps/database/influxdb/app/gatus.yaml create mode 100644 kubernetes/apps/database/influxdb/app/helmrelease.yaml create mode 100644 kubernetes/apps/database/influxdb/app/kustomization.yaml create mode 100644 kubernetes/apps/database/influxdb/ks.yaml create mode 100644 kubernetes/flux/repositories/helm/influxdata.yaml diff --git a/kubernetes/apps/database/influxdb/app/gatus.yaml b/kubernetes/apps/database/influxdb/app/gatus.yaml new file mode 100644 index 00000000..79eb5dd9 --- /dev/null +++ b/kubernetes/apps/database/influxdb/app/gatus.yaml @@ -0,0 +1,21 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: influxdb-gatus-ep + labels: + gatus.io/enabled: "true" +data: + config.yaml: | + endpoints: + - name: influxdb + group: infrastructure + url: tcp://influxdb.database.svc.cluster.local:8086 + interval: 1m + ui: + hide-url: true + hide-hostname: true + conditions: + - "[CONNECTED] == true" + alerts: + - type: pushover diff --git a/kubernetes/apps/database/influxdb/app/helmrelease.yaml b/kubernetes/apps/database/influxdb/app/helmrelease.yaml new file mode 100644 index 00000000..6b246a1a --- /dev/null +++ b/kubernetes/apps/database/influxdb/app/helmrelease.yaml @@ -0,0 +1,54 @@ +--- +# yaml-language-server: $schema=https://ks.hsn.dev/helm.toolkit.fluxcd.io/helmrelease_v2.json +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: &app influxdb +spec: + interval: 30m + chart: + spec: + chart: influxdb2 + version: 2.1.2 + sourceRef: + kind: HelmRepository + name: influxdata + namespace: flux-system + install: + remediation: + retries: 3 + upgrade: + cleanupOnFail: true + remediation: + strategy: rollback + retries: 3 + values: + fullnameOverride: *app + securityContext: + allowPrivilegeEscalation: false + capabilities: { drop: ["ALL"] } + fsGroup: 568 + fsGroupChangePolicy: OnRootMismatch + readOnlyRootFilesystem: true + runAsNonRoot: true + runAsUser: 568 + runAsGroup: 568 + seccompProfile: { type: RuntimeDefault } + env: + - name: INFLUXD_REPORTING_DISABLED + value: "true" + persistence: + storageClass: ceph-block + size: 50Gi + volumes: + - name: tmp + emptyDir: {} + mountPoints: + - name: tmp + mountPath: /tmp + service: + port: 8086 + ingress: + enabled: true + className: internal-nginx + hostname: "{{ Release.Name }}.jahanson.tech" diff --git a/kubernetes/apps/database/influxdb/app/kustomization.yaml b/kubernetes/apps/database/influxdb/app/kustomization.yaml new file mode 100644 index 00000000..9f287b38 --- /dev/null +++ b/kubernetes/apps/database/influxdb/app/kustomization.yaml @@ -0,0 +1,7 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ./gatus.yaml + - ./helmrelease.yaml diff --git a/kubernetes/apps/database/influxdb/ks.yaml b/kubernetes/apps/database/influxdb/ks.yaml new file mode 100644 index 00000000..aaccf43d --- /dev/null +++ b/kubernetes/apps/database/influxdb/ks.yaml @@ -0,0 +1,25 @@ +--- +# yaml-language-server: $schema=https://ks.hsn.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: &app influxdb + namespace: flux-system +spec: + targetNamespace: database + commonMetadata: + labels: + app.kubernetes.io/name: *app + dependsOn: + - name: rook-ceph-cluster + path: ./kubernetes/apps/observability/influxdb/app + prune: true + sourceRef: + kind: GitRepository + name: theshire + wait: false + interval: 30m + retryInterval: 1m + postBuild: + substitute: + APP: *app diff --git a/kubernetes/apps/database/kustomization.yaml b/kubernetes/apps/database/kustomization.yaml index 9e308de6..b55a970f 100644 --- a/kubernetes/apps/database/kustomization.yaml +++ b/kubernetes/apps/database/kustomization.yaml @@ -9,3 +9,4 @@ resources: - ./crunchy-postgres-operator/ks.yaml - ./dragonfly/ks.yaml - ./emqx/ks.yaml + - ./influxdb/ks.yaml diff --git a/kubernetes/flux/repositories/helm/influxdata.yaml b/kubernetes/flux/repositories/helm/influxdata.yaml new file mode 100644 index 00000000..5759bb2f --- /dev/null +++ b/kubernetes/flux/repositories/helm/influxdata.yaml @@ -0,0 +1,10 @@ +--- +# yaml-language-server: $schema=https://ks.hsn.dev/source.toolkit.fluxcd.io/helmrepository_v1.json +apiVersion: source.toolkit.fluxcd.io/v1 +kind: HelmRepository +metadata: + name: influxdata + namespace: flux-system +spec: + interval: 2h + url: https://helm.influxdata.com/ diff --git a/kubernetes/flux/repositories/helm/kustomization.yaml b/kubernetes/flux/repositories/helm/kustomization.yaml index 435615c3..45b81b9b 100644 --- a/kubernetes/flux/repositories/helm/kustomization.yaml +++ b/kubernetes/flux/repositories/helm/kustomization.yaml @@ -22,6 +22,7 @@ resources: - grafana.yaml - hashicorp.yaml - hetzner.yaml + - influxdata.yaml - ingress-nginx.yaml - intel.yaml - jetstack.yaml