Skip to content

Commit 073cefc

Browse files
committed
Added steps for kyma deployment
1 parent f214b1c commit 073cefc

File tree

1 file changed

+105
-7
lines changed

1 file changed

+105
-7
lines changed

README.md

Lines changed: 105 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ CAP Java based Incident Management Application.
2323
```
2424
4. Go to `localhost:8080` and you will get the list of exposed endpoints.
2525
5. Test the following endpoint: `http://localhost:8080/odata/v4/ProcessorService/Incidents`
26-
6. When you are prompted to authenticate, use the following credentials:
27-
- Username: alice
26+
6. When you are prompted to authenticate, use the following credentials:</br>
27+
- Username: alice</br>
2828
- Password:
2929
7. To access the Incident Management Application WebApp, use the following url : `http://localhost:8080/incidents/webapp/index.html`
30-
7. When you are testing `AdminService` endpoints, use the following credentials:
31-
- Username: admin
32-
- password: admin
33-
## Deploy and Test Incidents Management Application on BTP CF
30+
7. When you are testing `AdminService` endpoints, use the following credentials:</br>
31+
- Username: admin</br>
32+
- Password: admin
33+
## Deploy and Test Incidents Management Application on BTP Cloud Foundry Runtime
3434

3535
1. In the root folder do:
3636
```sh
@@ -40,4 +40,102 @@ CAP Java based Incident Management Application.
4040
```sh
4141
cf deploy mta_archives/incident-management_1.0.0-SNAPSHOT.mtar
4242
```
43-
This will deploy your application, create and bind the required services to your application. Now you can test your application from and http client tool e.g Insomnia.
43+
This will deploy your application, create and bind the required services to your application. Now you can test your application from and http client tool e.g Insomnia.
44+
45+
## Deploy and Test Incidents Management Application on BTP Kyma Runtime
46+
47+
Follow the following [tutorial](https://developers.sap.com/tutorials/deploy-to-kyma.html) till `step 8` to prepare your application for Kyma Runtime.
48+
49+
### Build images
50+
51+
Build the CAP Java Service and the database image
52+
1. Create the productive CAP build for your application:
53+
```sh
54+
cds build --production
55+
```
56+
2. Build the CAP Java Service image:
57+
```sh
58+
pack build <your-container-registry>/incident-management-srv:<image-version>\
59+
--path srv/target/*-exec.jar \
60+
--builder paketobuildpacks/builder-jammy-base \
61+
--publish
62+
```
63+
3. Build the database image:
64+
```sh
65+
pack build <your-container-registry>/incident-management-hana-deployer:<image-version> \
66+
--path db \
67+
--builder paketobuildpacks/builder-jammy-base \
68+
--publish
69+
```
70+
### Add Helm Charts
71+
CAP provides a configurable Helm chart for Java applications.
72+
1. Run the following command in your project root folder:
73+
```sh
74+
cds add helm
75+
```
76+
2. Add your container image settings to your **chart/values.yaml** file:
77+
```yaml
78+
...
79+
srv:
80+
image:
81+
repository: <your-container-registry>/incident-management-srv
82+
tag: <incident-management-srv-image-version>
83+
...
84+
hana-deployer:
85+
image:
86+
repository: <your-container-registry>/incident-management-hana-deployer
87+
tag: <incident-management-hana-deployer-image-version>
88+
...
89+
90+
```
91+
3. Run the following command to get the domain name of your Kyma cluster:
92+
```sh
93+
kubectl get gateway -n kyma-system kyma-gateway \
94+
-o jsonpath='{.spec.servers[0].hosts[0]}'
95+
96+
```
97+
Result should look like this:
98+
```sh
99+
*.<xyz123>.kyma.ondemand.com
100+
101+
```
102+
4. Add the result without the leading *. in the domain property to the chart/values.yaml file so that the URL of your CAP service can be generated:
103+
```yaml
104+
global:
105+
domain: <cluster domain>
106+
...
107+
108+
```
109+
5. Replace `<your-cluster-domain>` with your cluster domain in the xsuaa section of the **chart/values.yaml** file. In case the `oauth2-configuration:` section is missing from your **values.yaml** file, make sure to add it altogether like that::
110+
```yaml
111+
xsuaa:
112+
serviceOfferingName: xsuaa
113+
servicePlanName: application
114+
parameters:
115+
xsappname: incidents
116+
tenant-mode: dedicated
117+
oauth2-configuration:
118+
redirect-uris:
119+
- https://*.<your-cluster-domain>/**
120+
121+
122+
```
123+
### Deploy CAP Helm chart
124+
Follow `step 11` i.e `Deploy CAP Helm chart` of following [tutorial](https://developers.sap.com/tutorials/deploy-to-kyma.html)
125+
126+
### Assign the User Roles
127+
Follow [user-role-assignment](https://developers.sap.com/tutorials/user-role-assignment.html) to assign roles to users.
128+
- Assign `support` and `admin` role to access the application services.
129+
130+
### Access your service
131+
1. Login to your kyma cluster and namespace where you deployed your application
132+
2. Go to **Configurations** -> **Secrets** -> **incident-management-srv-auth** and under `data` section, click on decode icon.
133+
3. Use the following credentials :</br>
134+
clientid</br>
135+
clientsecret</br>
136+
url</br>
137+
Append `/oauth/token` to `url` and use these credentials to generate xsuaa token to access your service.
138+
139+
For details, refere `Test Your Application` section of following [documentation](https://github.com/SAP-samples/btp-developer-guide-cap/blob/main/documentation/auditlog/5-deploy-to-kyma.md).
140+
141+

0 commit comments

Comments
 (0)