0

I have a influxdb pod created via helm chart from bitnami running in my kubernetes cluster with bind address enabled at 8088. I would like to import data into it after deployment of the pod. For this purpose I am using the following post-install helm hook job.

apiVersion: batch/v1
kind: Job
metadata:
  name: "influxdb-dataloader"
  annotations:
    # This is what defines this resource as a hook. Without this line, the
    # job is considered part of the release.
    "helm.sh/hook": post-install,post-upgrade
    "helm.sh/hook-weight": "-4"
    "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
spec:
  template:
    metadata:
      name: "influxdb-dataloader"
    spec:
      restartPolicy: Never
      containers:
        - image: influxdb:2.1.1
          name: dataloader
          command:
            - "/bin/sh"
            - "-c"
            - "cp -r /input/* /target && influx restore target/ --host http://127.0.0.1:8088 -t sampletoken -b samplebucket"
          volumeMounts:
            - mountPath: /input
              name: input
            - mountPath: /target/
              name: target
      volumes:
          - name: input
            hostPath:
              path: /path/to/local/backup
          - name: target
            persistentVolumeClaim:
              claimName: shared-input

I am getting following error from the hook pods logger.

Error: unable to open boltdb: open /target: is a directory

When I am restoring locally in a docker environment the command to restore works fine. But in a kubernetes pod i receive the above error. Can anyone help?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.