Skip to content

Commit 0883b84

Browse files
committed
Create migration-oci-location.sh
1 parent abc6bc0 commit 0883b84

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

migration-oci-location.sh

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
echo '-------Creating a S3 profile secret'
2+
. ./setenv.sh
3+
4+
if [ ! -f ociaccess ]; then
5+
echo -n "Enter your Object Storage Access Key ID and press [ENTER]: "
6+
read AWS_ACCESS_KEY_ID
7+
echo "" | awk '{print $1}'
8+
echo $AWS_ACCESS_KEY_ID > ociaccess
9+
echo -n "Enter your Object Storage Secret Access Key and press [ENTER]: "
10+
read AWS_SECRET_ACCESS_KEY
11+
echo $AWS_SECRET_ACCESS_KEY >> ociaccess
12+
fi
13+
14+
export OCI_MY_REGION=ap-mumbai-1
15+
export OCI_MY_OBJECT_STORAGE_PROFILE=oci-migration
16+
export AWS_ACCESS_KEY_ID=$(cat ociaccess | head -1)
17+
export AWS_SECRET_ACCESS_KEY=$(cat ociaccess | tail -1)
18+
echo oci-k10migration4yong1 | awk '{print tolower($0)}' > k10_migration_bucketname
19+
20+
#echo '-------Creating a S3 profile secret'
21+
kubectl create secret generic k10-oci-s3-secret \
22+
--namespace kasten-io \
23+
--type secrets.kanister.io/aws \
24+
--from-literal=aws_access_key_id=$AWS_ACCESS_KEY_ID \
25+
--from-literal=aws_secret_access_key=$AWS_SECRET_ACCESS_KEY
26+
27+
echo '-------Creating an OCI OS S3 profile'
28+
cat <<EOF | kubectl apply -f -
29+
apiVersion: config.kio.kasten.io/v1alpha1
30+
kind: Profile
31+
metadata:
32+
name: $OCI_MY_OBJECT_STORAGE_PROFILE
33+
namespace: kasten-io
34+
spec:
35+
type: Location
36+
locationSpec:
37+
credential:
38+
secretType: AwsAccessKey
39+
secret:
40+
apiVersion: v1
41+
kind: Secret
42+
name: k10-oci-s3-secret
43+
namespace: kasten-io
44+
type: ObjectStore
45+
objectStore:
46+
name: $(cat k10_migration_bucketname)
47+
objectStoreType: S3
48+
region: $OCI_MY_REGION
49+
endpoint: bmeup4b3jwcz.compat.objectstorage.ap-mumbai-1.oraclecloud.com
50+
EOF

0 commit comments

Comments
 (0)