Skip to main content
Question

Elastic backup - ActionSet Failed Failed to render template: "kopiaOutput" not found


Hi all,
I tried to do backup of my elasticsaerch database and I have standard blueprint object which goes with that backup process
 

apiVersion: cr.kanister.io/v1alpha1
kind: Blueprint
metadata:
  name: elasticsearch-custom-blueprint
  namespace: kasten-io
actions:
  backup:
    outputArtifacts:
      esBackup:
        # Capture the kopia snapshot information for subsequent actions
        # The information includes the kopia snapshot ID which is essential for restore and delete to succeed
        # `kopiaOutput` is the name provided to kando using `--output-name` flag
        kopiaSnapshot: "{{ .Phases.backupToStore.Output.kopiaOutput }}"
    phases:
    - func: KubeTask
      name: backupToStore
      objects:
        esMasterCredSecret:
          kind: Secret
          name: "elasticsearch-es-elastic-user"
          namespace: "{{ .StatefulSet.Namespace }}"
      args:
        namespace: "{{ .StatefulSet.Namespace }}"
        image: "ghcr.io/kanisterio/es-sidecar:0.112.0"
        command:
        - bash
        - -o
        - errexit
        - -o
        - pipefail
        - -c
        - |
          host_name="{{ .Object.spec.serviceName }}.{{ .StatefulSet.Namespace }}.svc.cluster.local"
          set -x
          backup_file_path='backup.gz'
          master_username="elastic"
          master_password="{{ index .Phases.backupToStore.Secrets.esMasterCredSecret.Data "elastic" | toString }}"
          NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump --bulk=true --input=https://${master_username}:${master_password}@${host_name}:9200 --output=/backup
          gzip -c /backup | kando location push --profile '{{ toJson .Profile }}' --path "${backup_file_path}" --output-name "kopiaOutput" -

But at the end, after kanister pod complete it’s execution, instead og going in complete state, it just keeps restarting, with this error on kasten
 

Did someone faced this issue before?

0 comments

Be the first to comment!

Comment