github.com/kyma-project/kyma-environment-broker@v0.0.1/docs/user/05-10-provisioning-kyma-environment.md (about) 1 # Provision SAP BTP, Kyma runtime using Kyma Environment Broker 2 3 This tutorial shows how to provision SAP BTP, Kyma runtime on Azure using Kyma Environment Broker (KEB). 4 5 ## Prerequisites 6 7 - Compass with: 8 * Runtime Provisioner [configured](https://github.com/kyma-project/control-plane/blob/main/docs/provisioner/08-02-provisioning-gardener.md) for Azure provider 9 * KEB configured and chosen [overrides](https://kyma-project.io/#/04-operation-guides/operations/03-change-kyma-config-values) set up 10 11 ## Steps 12 13 1. Export these values as environment variables: 14 15 ```bash 16 export BROKER_URL={KYMA_ENVIRONMENT_BROKER_URL} 17 export INSTANCE_ID={INSTANCE_ID} 18 export GLOBAL_ACCOUNT_ID={GLOBAL_ACCOUNT_ID} 19 export NAME={RUNTIME_NAME} 20 export USER_ID={USER_ID} 21 export REGION={CLUSTER_REGION} 22 ``` 23 24 > **NOTE:** INSTANCE_ID and NAME must be unique. It is recommended to use UUID as an INSTANCE_ID. 25 26 2. Get the [access token](../contributor/01-10-authorization.md#get-the-access-token). Export this variable based on the token you got from the OAuth client: 27 28 ```bash 29 export AUTHORIZATION_HEADER="Authorization: Bearer $ACCESS_TOKEN" 30 ``` 31 32 Alternatively, you can perform `kubectl port-forward` on the chosen Pod to expose it on your local machine. Expose it on port `8080`: 33 34 ```bash 35 kubectl port-forward -n kcp-system deployments/kcp-kyma-environment-broker 8080 36 ``` 37 38 3. Make a call to KEB to create a Kyma runtime on Azure. Find the list of possible request parameters in the [Service description](03-10-service-description.md) document. 39 40 ```bash 41 curl --request PUT "https://$BROKER_URL/oauth/v2/service_instances/$INSTANCE_ID?accepts_incomplete=true" \ 42 --header 'X-Broker-API-Version: 2.14' \ 43 --header 'Content-Type: application/json' \ 44 --header "$AUTHORIZATION_HEADER" \ 45 --data-raw "{ 46 \"service_id\": \"47c9dcbf-ff30-448e-ab36-d3bad66ba281\", 47 \"plan_id\": \"4deee563-e5ec-4731-b9b1-53b42d855f0c\", 48 \"context\": { 49 \"globalaccount_id\": \"$GLOBAL_ACCOUNT_ID\" 50 \"user_id\": \"$USER_ID\" 51 }, 52 \"parameters\": { 53 \"name\": \"$NAME\", 54 \"region\": \"$REGION\" 55 } 56 }" 57 ``` 58 59 A successful call returns the operation ID: 60 61 ```json 62 { 63 "operation":"8a7bfd9b-f2f5-43d1-bb67-177d2434053c" 64 } 65 ``` 66 67 4. Check the operation status as described in the [Check operation status](05-30-operation-status.md) document. 68 69 ## SAP BTP Service Operator 70 71 If you need a SAP BTP Service Operator component installed, obtain [SAP BTP Service Operator access credentials](https://github.com/SAP/sap-btp-service-operator/blob/v0.2.5/README.md#setup) and provide them in the provisioning request. See the following example: 72 ```bash 73 curl --request PUT "https://$BROKER_URL/oauth/v2/service_instances/$INSTANCE_ID?accepts_incomplete=true" \ 74 --header 'X-Broker-API-Version: 2.14' \ 75 --header 'Content-Type: application/json' \ 76 --header "$AUTHORIZATION_HEADER" \ 77 --data-raw "{ 78 \"service_id\": \"47c9dcbf-ff30-448e-ab36-d3bad66ba281\", 79 \"plan_id\": \"4deee563-e5ec-4731-b9b1-53b42d855f0c\", 80 \"context\": { 81 \"globalaccount_id\": \"$GLOBAL_ACCOUNT_ID\", 82 \"user_id\": \"$USER_ID\", 83 \"sm_operator_credentials\": { 84 \"clientid\": \"$clientid\", 85 \"clientsecret\": \"$clientsecret\", 86 \"sm_url\": \"$sm_url\", 87 \"url\": \"$url\", 88 \"xsappname\": \"$xsappname\" 89 }, 90 }, 91 \"parameters\": { 92 \"name\": \"$NAME\", 93 \"region\": \"$REGION\" 94 } 95 }" 96 ``` 97 98 ```json 99 "sm_operator_credentials": { 100 "clientid": "testClientID", 101 "clientsecret": "testClientSecret", 102 "sm_url": "https://service-manager.kyma.com", 103 "url": "https://test.auth.com", 104 "xsappname": "testXsappname" 105 } 106 ```