Difference between revisions of "Influxdb"

From UVOO Tech Wiki
Jump to navigation Jump to search
 
Line 1: Line 1:
 +
#
 +
https://docs.influxdata.com/influxdb/v2.2/
 +
 
# Install on k8s via helm
 
# Install on k8s via helm
 
https://artifacthub.io/packages/helm/influxdata/influxdb
 
https://artifacthub.io/packages/helm/influxdata/influxdb
Line 9: Line 12:
  
  
 +
<br>
 +
<br>
 +
<br>
 +
<br>
  
  
Line 15: Line 22:
  
  
 
+
- https://github.com/influxdata/influxdata-operator
https://github.com/influxdata/influxdata-operator
 
  
 
# k8s
 
# k8s

Latest revision as of 16:44, 2 June 2022

https://docs.influxdata.com/influxdb/v2.2/

Install on k8s via helm

https://artifacthub.io/packages/helm/influxdata/influxdb

Apt install and general config

https://computingforgeeks.com/install-influxdb-on-ubuntu-and-debian/





k8s

kubectl create secret generic influxdb-creds \
  --from-literal=INFLUXDB_DB=monitoring \
  --from-literal=INFLUXDB_USER=user \
  --from-literal=INFLUXDB_USER_PASSWORD=<password> \
  --from-literal=INFLUXDB_READ_USER=readonly \
  --from-literal=INFLUXDB_USER_PASSWORD=<password> \
  --from-literal=INFLUXDB_ADMIN_USER=root \
  --from-literal=INFLUXDB_ADMIN_USER_PASSWORD=<password> \
  --from-literal=INFLUXDB_HOST=influxdb  \
  --from-literal=INFLUXDB_HTTP_AUTH_ENABLED=true

Next, create some persistent storage to store the database itself:

---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  namespace: monitoring
  labels:
    app: influxdb
  name: influxdb-pvc
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi

If you are new to Kubernetes, the way to execute these files is to call kubectl apply -f , in our case kubectl apply -f influxdb-pvc.yml. Now, let’s create the Deployment, that defines what containers we need and how:

---
apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: monitoring
  labels:
    app: influxdb
  name: influxdb
spec:
  replicas: 1
  selector:
    matchLabels:
      app: influxdb
  template:
    metadata:
      labels:
        app: influxdb
    spec:
      containers:
      - envFrom:
        - secretRef:
            name: influxdb-creds
        image: docker.io/influxdb:1.8
        name: influxdb
        volumeMounts:
        - mountPath: /var/lib/influxdb
          name: var-lib-influxdb
      volumes:
      - name: var-lib-influxdb
        persistentVolumeClaim:
          claimName: influxdb-pvc