Hi guys,
When i configure location profile in NFS, then blueprint run fail.
location profile configed as below snapshot.
Error information from logs like below, it looks like unsupport the location type. but the guide https://docs.kasten.io/latest/kanister/testing.html#configuring-a-profile is support.
my blueprint contents as below and registry.example.com:8443/kasten-images/mysql-sidecar:0.90.0 is my private repo.
apiVersion: cr.kanister.io/v1alpha1
kind: Blueprint
metadata:
name: mysql-blueprint
namespace: kasten-io
actions:
backup:
outputArtifacts:
mysqlBackup:
# 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.dumpToStore.Output.kopiaOutput }}"
phases:
- func: KubeTask
name: dumpToStore
objects:
mysqlsecret:
kind: Secret
#name: "{{ .DeploymentConfig.Name }}"
name: mysql-password
#namespace: "{{ .Deployment.Namespace }}"
#namespace: "{{ .StatefulSet.Namespace }}"
namespace: mysql-0614
args:
#image: ghcr.io/kanisterio/mysql-sidecar:0.83.0
image: registry.example.com:8443/kasten-images/mysql-sidecar:0.90.0
#namespace: "{{ .StatefulSet.Namespace }}"
namespace: mysql-0614
command:
- bash
- -o
- errexit
- -o
- pipefail
- -c
- |
backup_file_path="dump.sql"
root_password="{{ index .Phases.dumpToStore.Secrets.mysqlsecret.Data "password" | toString }}"
dump_cmd="mysqldump --column-statistics=0 -u root --password=${root_password} -h {{ index .Object.metadata.labels "app.kubernetes.io/instance" }} --single-transaction --all-databases"
${dump_cmd} | kando location push --profile '{{ toJson .Profile }}' --path "${backup_file_path}" --output-name "kopiaOutput" -
restore:
inputArtifactNames:
# The kopia snapshot info created in backup phase can be used here
# Use the `--kopia-snapshot` flag in kando to pass in `mysqlBackup.KopiaSnapshot`
- mysqlBackup
phases:
- func: KubeTask
name: restoreFromStore
objects:
mysqlsecret:
kind: Secret
name: mysql-password
namespace: mysql-0614
args:
image: registry.example.com:8443/kasten-images/mysql-sidecar:0.90.0
namespace: mysql-0614
command:
- bash
- -o
- errexit
- -o
- pipefail
- -c
- |
backup_file_path="dump.sql"
kopia_snap='{{ .ArtifactsIn.mysqlBackup.KopiaSnapshot }}'
root_password="{{ index .Phases.restoreFromStore.Secrets.mysqlsecret.Data "password" | toString }}"
restore_cmd="mysql -u root --password=${root_password} -h {{ index .Object.metadata.labels "app.kubernetes.io/instance" }}"
kando location pull --profile '{{ toJson .Profile }}' --path "${backup_file_path}" --kopia-snapshot "${kopia_snap}" - | ${restore_cmd}
delete:
inputArtifactNames:
# The kopia snapshot info created in backup phase can be used here
# Use the `--kopia-snapshot` flag in kando to pass in `mysqlBackup.KopiaSnapshot`
- mysqlBackup
phases:
- func: KubeTask
name: deleteFromStore
args:
image: registry.example.com:8443/kasten-images/mysql-sidecar:0.90.0
namespace: "{{ .Deployment.Namespace }}"
command:
- bash
- -o
- errexit
- -o
- pipefail
- -c
- |
backup_file_path="dump.sql"
kopia_snap='{{ .ArtifactsIn.mysqlBackup.KopiaSnapshot }}'
kando location delete --profile '{{ toJson .Profile }}' --path "${backup_file_path}" --kopia-snapshot "${kopia_snap}"