|
| 1 | +--- |
| 2 | +author_name: Iwona Hahn |
| 3 | +author_profile: https://github.com/iwonahahn |
| 4 | +title: Add Helm Chart |
| 5 | +description: Learn how to add a Helm chart to your project and configure container image, pull secret, cluster domain, and SAP HANA secret in the Helm chart. |
| 6 | +keywords: cap |
| 7 | +auto_validation: true |
| 8 | +time: 5 |
| 9 | +tags: [ tutorial>beginner, software-product-function>sap-cloud-application-programming-model, programming-tool>node-js, software-product>sap-business-technology-platform, software-product>sap-fiori] |
| 10 | +primary_tag: software-product-function>sap-cloud-application-programming-model |
| 11 | +--- |
| 12 | + |
| 13 | +## Prerequisites |
| 14 | + - [Set Up Local Development using VS Code](btp-app-set-up-local-development) |
| 15 | + - [Create a Directory for Development](btp-app-create-directory) |
| 16 | + - [Create a CAP-Based Application](btp-app-create-cap-application) |
| 17 | + - [Create an SAP Fiori Elements-Based UI](btp-app-create-ui-fiori-elements) |
| 18 | + - [Add Business Logic to Your Application](btp-app-cap-business-logic) |
| 19 | + - [Create a UI Using Freestyle SAPUI5](btp-app-create-ui-freestyle-sapui5) |
| 20 | + - [Add More Than One Application to the Launch Page](btp-app-launchpage) |
| 21 | + - [Implement Roles and Authorization Checks in CAP](btp-app-cap-roles) |
| 22 | + - [Prepare for SAP BTP Development](btp-app-kyma-prepare-btp) |
| 23 | + - [Prepare Your K... Development Environment](btp-app-kyma-prepare-dev-environment) |
| 24 | + - [Setup HANA Cloud for K...](btp-app-kyma-hana-cloud-setup) |
| 25 | + - [Prepare User Authentication and Authorization (XSUAA) Setup](btp-app-kyma-prepare-xsuaa) |
| 26 | + |
| 27 | + |
| 28 | +## Details |
| 29 | +### You will learn |
| 30 | + - How to add a Helm chart to your project. |
| 31 | + - How to configure container image. |
| 32 | + - How to configure pull secret. |
| 33 | + - How to configure cluster domain. |
| 34 | + - How to configure HANA secret. |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | +To start with this tutorial use the result in the [`prepare-xsuaa`](https://github.com/SAP-samples/cloud-cap-risk-management/tree/prepare-xsuaa) branch. |
| 39 | + |
| 40 | +--- |
| 41 | + |
| 42 | +[ACCORDION-BEGIN [Step 1: ](Add Helm chart)] |
| 43 | +1. In your project root directory, run: |
| 44 | + |
| 45 | + ``` |
| 46 | + cds add helm |
| 47 | + ``` |
| 48 | +
|
| 49 | +2. This will create a directory `chart` with the CAP Helm chart in your project directory. |
| 50 | +
|
| 51 | +[DONE] |
| 52 | +[ACCORDION-END] |
| 53 | +--- |
| 54 | +[ACCORDION-BEGIN [Step 2: ](Configure Container Image)] |
| 55 | +1. Open the file `chart/values.yaml`. |
| 56 | +
|
| 57 | +2. Replace the placeholder `<your-container-registry>` with your docker server URL. |
| 58 | +
|
| 59 | + ```YAML[3,8] |
| 60 | + srv: |
| 61 | + image: |
| 62 | + repository: <your-container-registry>/cpapp-srv |
| 63 | + tag: latest |
| 64 | + ... |
| 65 | + hana_deployer: |
| 66 | + image: |
| 67 | + repository: <your-container-registry>/cpapp-hana-deployer |
| 68 | + tag: latest |
| 69 | + ``` |
| 70 | +
|
| 71 | + > Looking for your docker server URL? |
| 72 | +
|
| 73 | + > The docker server URL is the same as provided in Step 2 of [Create container registry secret](btp-app-#create-container-registry-secret). It's also the path used for docker login, so you can quickly check it by running the following command in your terminal: |
| 74 | +
|
| 75 | + > ```json |
| 76 | + > cat ~/.docker/config.json |
| 77 | + > ``` |
| 78 | +
|
| 79 | +[DONE] |
| 80 | +[ACCORDION-END] |
| 81 | +--- |
| 82 | +[ACCORDION-BEGIN [Step 3: ](Configure pull secret)] |
| 83 | +1. In the `chart/values.yaml` file, make sure that the pull secret is defined: |
| 84 | +
|
| 85 | + ```YAML[4] |
| 86 | + global: |
| 87 | + domain: null |
| 88 | + imagePullSecret: |
| 89 | + name: container-registry |
| 90 | + srv: |
| 91 | + ... |
| 92 | + bindings: |
| 93 | + ... |
| 94 | + image: |
| 95 | + repository: <your-container-registry>/cpapp-srv |
| 96 | + ... |
| 97 | + ``` |
| 98 | + > The name of the secret created in ([Create container registry secret](btp-app-#create-container-registry-secret)) and the entry for `imagePullSecret` should match. |
| 99 | +
|
| 100 | +
|
| 101 | +
|
| 102 | +[DONE] |
| 103 | +[ACCORDION-END] |
| 104 | +--- |
| 105 | +[ACCORDION-BEGIN [Step 4: ](Configure cluster domain)] |
| 106 | +The HTML5 applications need the Internet-accessible URL of the CAP service. For that the Helm chart needs to know the domain name to access the cluster. |
| 107 | +
|
| 108 | +1. Get the host name pattern of the cluster with the following command: |
| 109 | +
|
| 110 | + ```YAML |
| 111 | + kubectl get gateway -n kyma-system kyma-gateway -o jsonpath='{.spec.servers[0].hosts[0]}' |
| 112 | + ``` |
| 113 | +
|
| 114 | + Result should look like: |
| 115 | +
|
| 116 | + ``` |
| 117 | + *.c-<xyz123>.sap.kyma.ondemand.com |
| 118 | + ``` |
| 119 | +
|
| 120 | + where `<xyz123>` is a placeholder for a string of characters that's unique for your cluster. |
| 121 | +
|
| 122 | +2. Add the result without the leading `*.` in the `domain` property of your `chart/values.yaml` file. For example: |
| 123 | +
|
| 124 | + ```YAML[2] |
| 125 | + global: |
| 126 | + domain: c-<xyz123>.sap.kyma.ondemand.com |
| 127 | + ``` |
| 128 | +
|
| 129 | +[DONE] |
| 130 | +[ACCORDION-END] |
| 131 | +--- |
| 132 | +[ACCORDION-BEGIN [Step 5: ](Configure SAP HANA secret)] |
| 133 | +1. Open the file `chart/values.yaml`. |
| 134 | +
|
| 135 | +2. Add the binding `db` pointing to the SAP HANA HDI container secret: |
| 136 | +
|
| 137 | + ```YAML[5-6] |
| 138 | + srv: |
| 139 | + bindings: |
| 140 | + auth: |
| 141 | + ... |
| 142 | + db: |
| 143 | + fromSecret: cpapp-db |
| 144 | + ``` |
| 145 | +
|
| 146 | +3. Point the binding `hana` of the SAP HANA `deployer` to the SAP HANA HDI container secret: |
| 147 | +
|
| 148 | + ```YAML[5] |
| 149 | + hana_deployer: |
| 150 | + ... |
| 151 | + bindings: |
| 152 | + hana: |
| 153 | + fromSecret: cpapp-db |
| 154 | + ``` |
| 155 | +
|
| 156 | +[VALIDATE_1] |
| 157 | +The result of this tutorial can be found in the [`kyma-add-helm-chart`](https://github.com/SAP-samples/cloud-cap-risk-management/tree/kyma-add-helm-chart) branch. |
| 158 | +
|
| 159 | +
|
| 160 | +[ACCORDION-END] |
| 161 | +--- |
0 commit comments