Skip to content

Commit

Permalink
feat: deploy influxdb
Browse files Browse the repository at this point in the history
  • Loading branch information
FruitieX committed Aug 1, 2024
1 parent 8042752 commit 22b52ac
Show file tree
Hide file tree
Showing 20 changed files with 182 additions and 15 deletions.
7 changes: 4 additions & 3 deletions clusters/homelab/cluster-secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ stringData:
PODINFO_DOMAIN_NAME: ENC[AES256_GCM,data:ZX10MXxeuiWWnA3ZBxY/aot6J0E=,iv:Rz5adZg/Nhg8Ab0zFuwmvj79z2GfSHGcDfNA01yTV+k=,tag:z+jqorbvLNggMO8Oxj7tCg==,type:str]
CLOUDFLARE_EMAIL: ENC[AES256_GCM,data:e8GR4kogxXplJK/67S0QR4q6,iv:c0Eui6/XzSJZGttmafZdvNjlSqULc7abVCr2TGeJHX0=,tag:Hd0mEKqOowBqPsqQ4Gpu9A==,type:str]
EXTERNAL_DNS_CLOUDFLARE_API_TOKEN: ENC[AES256_GCM,data:DRswXksY/LW6VCUA0BZgPG0rDPxu0oBbQ7Bm6BOSgm/GPpC6cceJLA==,iv:XBtP2+/xEm2QDhAEIDohTsES/BqwQ7C4Lhn679whIYk=,tag:yeOS0rW37CE4f8+WTdd4nQ==,type:str]
INFLUXDB_TOKEN: ENC[AES256_GCM,data:Kn4Ht5JJ9IFBhPKE4bKqPXpZ/rdqiuPs83mLb9Te/SssIrCxCFG8/pcsf/sPdNyK1n+dLXf3guPzTOp3+MIa0qZ8NEJU7znplUTPTydHRrkJQXBcwcPMlA==,iv:WBzjOK8tleimkx9LFc6ktrjJWAhU6USo9NKylqYcbKs=,tag:jUQEqU6Dzh/fxwUC4VciIg==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age: []
lastmodified: "2023-05-21T12:28:12Z"
mac: ENC[AES256_GCM,data:K5oa2FWi5Yobtt2n4DV45SHKe3JBDqpajr27xuZWd6J0xwkekJ3IjvxiT8zOAJVSR04rkIcmPVO0IU+yuPc+I0XbW1/Es+dtm60XcGsu5yp0AWiac/DfhAO+ECXd1u5pFp5IjXFuyjlHerNoTOlVe8mZ0yKW/oQweiiEw821FBA=,iv:BGbXDP7zRa9JVmpOVTwgHHnsCDZ5/P1OIhPJNyZVrkM=,tag:ZL/DRgA8+OVjn2NTCqdOvA==,type:str]
lastmodified: "2024-08-01T14:22:45Z"
mac: ENC[AES256_GCM,data:lcQOJ0jL261CqnlVduFtMAQ6bWsYT/t55C4Mo/sTB7jAAbfRT+UyNwNmODdLCFbqufMQa8+KtTXLbkiDOKAO9kEjNd8XHCQ3SnmO6hSgTSAKohMYoQFuna7bqMyXVvIlsBmvXpvLTP3Kklnm+snGWsq94g2BCrlzQpfFaDufSz8=,iv:+hPfH8J1RxWT7KXY7jmcKr1jxD5VSJEU9YKY+GGFGn4=,tag:x35lJ08+TycV9UdV39Cy1g==,type:str]
pgp:
- created_at: "2023-04-11T10:46:46Z"
enc: |-
Expand All @@ -41,4 +42,4 @@ sops:
-----END PGP MESSAGE-----
fp: 3536F7F9345D96C86FB7F9CD21FAFEE575B18815
encrypted_regex: ^(data|stringData)$
version: 3.7.3
version: 3.9.0
26 changes: 26 additions & 0 deletions clusters/homelab/infrastructure/influxdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: influxdb
spec:
interval: 1h
timeout: 3m
retryInterval: 10s
sourceRef:
kind: GitRepository
name: flux-system
path: ./infrastructure/monitoring/influxdb
prune: true
wait: true
decryption:
provider: sops
secretRef:
name: sops-gpg
postBuild:
substitute: {}
substituteFrom:
- kind: ConfigMap
name: cluster-config
- kind: Secret
name: cluster-secrets

1 change: 1 addition & 0 deletions clusters/homelab/infrastructure/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ resources:
- metallb.yaml
- reloader.yaml
- reflector.yaml
- influxdb.yaml
# - loki-stack.yaml
4 changes: 2 additions & 2 deletions infrastructure/crds/certificates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ spec:
secretTemplate:
annotations:
reflector.v1.k8s.emberstack.com/reflection-allowed: "true"
reflector.v1.k8s.emberstack.com/reflection-allowed-namespaces: "flux-system,ingress-proxy,kube-prometheus-stack" # Control destination namespaces
reflector.v1.k8s.emberstack.com/reflection-allowed-namespaces: "flux-system,ingress-proxy,kube-prometheus-stack,influxdb" # Control destination namespaces
reflector.v1.k8s.emberstack.com/reflection-auto-enabled: "true" # Auto create reflection for matching namespaces
reflector.v1.k8s.emberstack.com/reflection-auto-namespaces: "flux-system,ingress-proxy,kube-prometheus-stack" # Control auto-reflection namespaces
reflector.v1.k8s.emberstack.com/reflection-auto-namespaces: "flux-system,ingress-proxy,kube-prometheus-stack,influxdb" # Control auto-reflection namespaces
40 changes: 40 additions & 0 deletions infrastructure/monitoring/influxdb/influxdb-auth.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: v1
kind: Secret
metadata:
namespace: influxdb
name: influxdb-auth
type: Opaque
stringData:
admin-password: ENC[AES256_GCM,data:3wLiBd2jzWG8QZmsampuWY7AYKM=,iv:Zco6dXhrUdFsO5XfiOapG89iPSs7TzaTE5idYRmVvb0=,tag:QTV+l5RtdUYjkbw51kkrZw==,type:str]
admin-token: ENC[AES256_GCM,data:zkhcQvzqgNSAAWLwttX8LZM52doSn60RqCZB2W1Pt0XL7WXJ/O0uU6HFJoayuW95/9dianl6ep1DRdfublUz0PCsWmLwauQ10v4gozz8IWhCLSlTf5VUJQ==,iv:W2tV4zsnVH0eBUrkcwwusvP3kpXGKDK9F1YiZFoJug4=,tag:XSaInpsntOwALTOcP38kLQ==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age: []
lastmodified: "2024-08-01T14:21:55Z"
mac: ENC[AES256_GCM,data:v/a4sN/MGMXiDo0166atsfaDzj39F4sDHNxfsUfVKYru6J+4B5wRvP0n2bcwM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
=xv4o
-----END PGP MESSAGE-----
fp: 3536F7F9345D96C86FB7F9CD21FAFEE575B18815
encrypted_regex: ^(data|stringData)$
version: 3.9.0
8 changes: 8 additions & 0 deletions infrastructure/monitoring/influxdb/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: influxdb
resources:
- influxdb-auth.yaml
- namespace.yaml
- release.yaml
- telegraf.yaml
9 changes: 9 additions & 0 deletions infrastructure/monitoring/influxdb/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: Namespace
metadata:
name: influxdb

labels:
pod-security.kubernetes.io/enforce: privileged
pod-security.kubernetes.io/audit: privileged
pod-security.kubernetes.io/warn: privileged
29 changes: 29 additions & 0 deletions infrastructure/monitoring/influxdb/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: influxdb
namespace: influxdb
spec:
interval: 1h
timeout: 5m
chart:
spec:
chart: influxdb2
version: "*"
sourceRef:
kind: HelmRepository
name: influxdata
namespace: flux-system
values:
adminUser:
existingSecret: influxdb-auth
persistence:
enabled: true
storageClass: syno-storage
size: 10Gi
ingress:
enabled: true
className: private
tls: true
secretName: fruitiex-org-tls
hostname: influxdb.fruitiex.org
44 changes: 44 additions & 0 deletions infrastructure/monitoring/influxdb/telegraf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: telegraf-home
spec:
interval: 1h
timeout: 5m
chart:
spec:
chart: telegraf
version: "*"
sourceRef:
kind: HelmRepository
name: influxdata
namespace: flux-system
values:
metrics:
health:
enabled: false
internal:
enabled: false

config:
agent:
omit_hostname: true

outputs:
- influxdb_v2:
urls:
- "https://influxdb.fruitiex.org"
organization: influxdata
bucket: home
token: ${INFLUXDB_TOKEN}

inputs:
- mqtt_consumer:
servers:
- "tcp://mqtt.fruitiex.org:1883"
topics:
- "home/#"
data_format: json_v2
tags:
- name
- id
2 changes: 1 addition & 1 deletion infrastructure/sources/cert-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ kind: HelmRepository
metadata:
name: cert-manager
spec:
interval: 1h
interval: 24h
url: https://charts.jetstack.io
2 changes: 1 addition & 1 deletion infrastructure/sources/emberstack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ kind: HelmRepository
metadata:
name: emberstack
spec:
interval: 1h
interval: 24h
url: https://emberstack.github.io/helm-charts
2 changes: 1 addition & 1 deletion infrastructure/sources/grafana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ kind: HelmRepository
metadata:
name: grafana
spec:
interval: 1h
interval: 24h
url: https://grafana.github.io/helm-charts
8 changes: 8 additions & 0 deletions infrastructure/sources/influxdata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: influxdata
spec:
interval: 24h
url: https://helm.influxdata.com

2 changes: 1 addition & 1 deletion infrastructure/sources/ingress-nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ kind: HelmRepository
metadata:
name: ingress-nginx
spec:
interval: 1h
interval: 24h
url: https://kubernetes.github.io/ingress-nginx
3 changes: 2 additions & 1 deletion infrastructure/sources/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ resources:
- metrics-server.yaml
- nfs-subdir-external-provisioner.yaml
- prometheus-community.yaml
- reloader.yaml
- reloader.yaml
- influxdata.yaml
2 changes: 1 addition & 1 deletion infrastructure/sources/metallb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ kind: HelmRepository
metadata:
name: metallb
spec:
interval: 1h
interval: 24h
url: https://metallb.github.io/metallb
2 changes: 1 addition & 1 deletion infrastructure/sources/metrics-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ kind: HelmRepository
metadata:
name: metrics-server
spec:
interval: 1h
interval: 24h
url: https://kubernetes-sigs.github.io/metrics-server
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ kind: HelmRepository
metadata:
name: nfs-subdir-external-provisioner
spec:
interval: 1h
interval: 24h
url: https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner
2 changes: 1 addition & 1 deletion infrastructure/sources/prometheus-community.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ kind: HelmRepository
metadata:
name: prometheus-community
spec:
interval: 1h
interval: 24h
url: https://prometheus-community.github.io/helm-charts
2 changes: 1 addition & 1 deletion infrastructure/sources/reloader.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ kind: HelmRepository
metadata:
name: reloader
spec:
interval: 1h
interval: 24h
url: https://stakater.github.io/stakater-charts

0 comments on commit 22b52ac

Please sign in to comment.