Influxdb
Jump to navigation
Jump to search
https://github.com/influxdata/influxdata-operator
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
--- 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