-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathaz-location.sh
executable file
·34 lines (31 loc) · 1.01 KB
/
az-location.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
. ./setenv.sh
echo '-------Create a Azure Blob Storage Container'
az storage container create -n $MY_PREFIX-$MY_CONTAINER --account-key $(cat az_storage_key) --account-name $MY_PREFIX$AZURE_STORAGE_ACCOUNT_ID
echo '-------Create a Azure Blob Storage profile secret'
kubectl create secret generic k10-azure-secret \
--namespace kasten-io \
--from-literal=azure_storage_account_id=$MY_PREFIX$AZURE_STORAGE_ACCOUNT_ID \
--from-literal=azure_storage_key=$(cat az_storage_key)
echo '-------Creating a Azure Blob Storage profile'
cat <<EOF | kubectl apply -f -
apiVersion: config.kio.kasten.io/v1alpha1
kind: Profile
metadata:
name: $MY_OBJECT_STORAGE_PROFILE
namespace: kasten-io
spec:
type: Location
locationSpec:
credential:
secretType: AzStorageAccount
secret:
apiVersion: v1
kind: Secret
name: k10-azure-secret
namespace: kasten-io
type: ObjectStore
objectStore:
name: $MY_PREFIX-$MY_CONTAINER
objectStoreType: AZ
region: $MY_REGION
EOF