Sign inSign up

gkarthics/influx-additional-db

By gkarthics

•Updated about 8 years ago

Image used as helm post-install hook to create additional DBs with InfluxDB.

Image
1

2.7K

gkarthics/influx-additional-db repository overview

Build Status

⁠influx-additional-db

Since InfluxDB image suports creation of only one database during the time of container startup, this image creates additional Databases in InfluxDB after container startup.

⁠Execution method:

Image has shell and the options should be passed as below

./createdb.sh -url http://localhost:8086⁠ -db db1,db2

⁠How to use:

This image can be used with the influxdb's helm chart as a post-install hook to create multiple databases in the InfluxDB.

⁠Example helm post-install hook:

apiVersion: batch/v1
kind: Job
metadata:
  name: influx-additional-dbs
  labels:
    app.kubernetes.io/managed-by: {{.Release.Service | quote }}
    app.kubernetes.io/instance: {{.Release.Name | quote }}
    helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}"
  annotations:
    "helm.sh/hook": post-install
    "helm.sh/hook-weight": "-5"
    "helm.sh/hook-delete-policy": hook-succeeded
spec:
  template:
    metadata:
      name: additional-dbs
      labels:
        app.kubernetes.io/managed-by: {{.Release.Service | quote }}
        app.kubernetes.io/instance: {{.Release.Name | quote }}
        helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}"
    spec:
      restartPolicy: Never
      containers:
      - name: create-additional-dbs
        image: gkarthics/influx-additional-db:release-0.2.11
        command: ["./createdb.sh"]
        args: ["-url", "http://influxdb.default.svc:8086", "-db", "mydb1,mydb2,mydb3"]

Tag summary

Content type

Image

Digest

Size

5.2 MB

Last updated

about 8 years ago

docker pull gkarthics/influx-additional-db