This tutorial shows how to provision SAP BTP, Kyma runtime on Azure using Kyma Environment Broker (KEB).
-
Export these values as environment variables:
export BROKER_URL={KYMA_ENVIRONMENT_BROKER_URL} export INSTANCE_ID={INSTANCE_ID} export GLOBAL_ACCOUNT_ID={GLOBAL_ACCOUNT_ID} export NAME={RUNTIME_NAME} export USER_ID={USER_ID} export REGION={CLUSTER_REGION}
[!NOTE] INSTANCE_ID and NAME must be unique. It is recommended to use UUID as an INSTANCE_ID.
-
Get the access token. Export this variable based on the token you got from the OAuth client:
export AUTHORIZATION_HEADER="Authorization: Bearer $ACCESS_TOKEN"
Alternatively, you can perform
kubectl port-forward
on the chosen Pod to expose it on your local machine. Expose it on port8080
:kubectl port-forward -n kcp-system deployments/kcp-kyma-environment-broker 8080
-
Make a call to KEB to create a Kyma runtime on Azure. Find the list of possible request parameters in the Service Description document.
curl --request PUT "https://$BROKER_URL/oauth/v2/service_instances/$INSTANCE_ID?accepts_incomplete=true" \ --header 'X-Broker-API-Version: 2.14' \ --header 'Content-Type: application/json' \ --header "$AUTHORIZATION_HEADER" \ --data-raw "{ \"service_id\": \"47c9dcbf-ff30-448e-ab36-d3bad66ba281\", \"plan_id\": \"4deee563-e5ec-4731-b9b1-53b42d855f0c\", \"context\": { \"globalaccount_id\": \"$GLOBAL_ACCOUNT_ID\" \"user_id\": \"$USER_ID\" }, \"parameters\": { \"name\": \"$NAME\", \"region\": \"$REGION\" } }"
A successful call returns the operation ID:
{ "operation":"8a7bfd9b-f2f5-43d1-bb67-177d2434053c" }
-
Check the operation status as described in the Check Operation Status document.
If you need the SAP BTP service operator component installed, obtain the SAP BTP service operator access credentials and provide them in the provisioning request. See the following example:
curl --request PUT "https://$BROKER_URL/oauth/v2/service_instances/$INSTANCE_ID?accepts_incomplete=true" \
--header 'X-Broker-API-Version: 2.14' \
--header 'Content-Type: application/json' \
--header "$AUTHORIZATION_HEADER" \
--data-raw "{
\"service_id\": \"47c9dcbf-ff30-448e-ab36-d3bad66ba281\",
\"plan_id\": \"4deee563-e5ec-4731-b9b1-53b42d855f0c\",
\"context\": {
\"globalaccount_id\": \"$GLOBAL_ACCOUNT_ID\",
\"user_id\": \"$USER_ID\",
\"sm_operator_credentials\": {
\"clientid\": \"$clientid\",
\"clientsecret\": \"$clientsecret\",
\"sm_url\": \"$sm_url\",
\"url\": \"$url\",
\"xsappname\": \"$xsappname\"
},
},
\"parameters\": {
\"name\": \"$NAME\",
\"region\": \"$REGION\"
}
}"
"sm_operator_credentials": {
"clientid": "testClientID",
"clientsecret": "testClientSecret",
"sm_url": "https://service-manager.kyma.com",
"url": "https://test.auth.com",
"xsappname": "testXsappname"
}