1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00
kube-arangodb/scripts/kube_create_backup_remote_secret.sh
2019-11-11 09:09:33 +01:00

33 lines
470 B
Bash
Executable file

#!/bin/bash
NS=$1
if [ -z "$NS" ]; then
echo "Specify a namespace argument"
exit 1
fi
if [ -z "$2" ]; then
echo "No secret set"
exit 0
fi
case $(uname) in
Darwin)
SECRET=$(echo -n $2 | base64 -b 0)
;;
*)
SECRET=$(echo -n $2 | base64 -w 0)
;;
esac
kubectl apply -f - <<EOF
apiVersion: v1
data:
token: ${SECRET}
kind: Secret
metadata:
name: arangodb-backup-remote-secret
namespace: ${NS}
type: Opaque
EOF