You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guides/deployment/to-kyma.md
+31-52Lines changed: 31 additions & 52 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,7 +68,7 @@ Deploying apps on the SAP BTP Kyma Runtime requires two main artifact types:
68
68
69
69
The following diagram illustrates the deployment workflow:
70
70
71
-

71
+

72
72
73
73
74
74
## Prerequisites {#prerequisites}
@@ -79,9 +79,8 @@ The following diagram illustrates the deployment workflow:
79
79
+ Install [Docker Desktop or Docker for Linux](https://docs.docker.com/get-docker/)
80
80
+ Download and install the following command line tools:
81
81
+[`kubectl` command line client](https://kubernetes.io/docs/tasks/tools/) for Kubernetes
82
-
+[`pack` command line tool](https://buildpacks.io/docs/tools/pack/)
82
+
+[`pack` command line tool](https://buildpacks.io/docs/for-platform-operators/how-to/integrate-ci/pack/)
83
83
+[`helm` command line tool](https://helm.sh/docs/intro/install/)
84
-
+[`ctz` command line tool](https://www.npmjs.com/package/ctz)
85
84
+ Make sure your SAP HANA Cloud is [mapped to your namespace](https://community.sap.com/t5/technology-blogs-by-sap/consuming-sap-hana-cloud-from-the-kyma-environment/ba-p/13552718#toc-hId-569025164)
86
85
+ Ensure SAP HANA Cloud is accessible from your Kyma cluster by [configuring trusted source IPs](https://help.sap.com/docs/HANA_CLOUD/9ae9104a46f74a6583ce5182e7fb20cb/0610e4440c7643b48d869a6376ccaecd.html)
87
86
@@ -96,34 +95,19 @@ Download the Kubernetes configuration from SAP BTP and move it to _$HOME/.kube/c
96
95
SAP BTP doesn't provide a container image registry (or container repository), but you can choose from offerings of hosted open source and private container image registries, as well as solutions that can be run on premise or in your own cloud infrastructure.
97
96
98
97
::: tip Ensure network access
99
-
100
98
Verify the Kubernetes cluster has network access to the container registry, especially if hosted behind a VPN or within a restricted network environment.
101
-
102
99
:::
103
100
104
101
#### Set Up Your Cluster for a Private Container Registry
105
102
106
103
To use a docker image from a private repository, you need to [create an image pull secret](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) and configure this secret for your containers.
107
104
108
-
::: details Use this script to create the docker pull secret...
# The 2nd 'docker-registry' above is our default secret name.
122
-
```
105
+
:::info Interactive setup
106
+
If a pull secret does not exist for your namespace when deploying your application, the CLI will prompt you to set up the pull secret interactively.
123
107
:::
124
108
125
109
::: warning Assign limited permissions to the technical user
126
-
It is recommended to use a technical user for this secret that has only read permission, because users with access to the Kubernetes cluster can reveal the password from the secret.
110
+
For this secret, use a technical user with read-only permissions. This limits the risk, as anyone with access to the Kubernetes cluster could retrieve the password from the secret and potentially modify or publish images to the registry.
127
111
:::
128
112
129
113
<spanid="afterprivatereg" />
@@ -166,9 +150,9 @@ cds add workzone
166
150
CAP provides a configurable [Helm chart](https://helm.sh/) for Node.js and Java applications, which can be added like so:
167
151
168
152
```sh
169
-
cds add helm
153
+
cds add kyma
170
154
```
171
-
> You will be asked to provide a Kyma domain, the secret name to pull images and your container registry name.
155
+
> You will be asked to provide a Kyma cluster domain and your container registry name.
172
156
173
157
::: details Running `cds build` now creates a _gen_/_chart_ folder
174
158
@@ -184,34 +168,47 @@ They support the deployment of your CAP service, database, UI content, and the c
184
168
You can now quickly deploy the application like so:
185
169
186
170
```sh
187
-
cds up -2 k8s
171
+
cds up -2 k8s [ -n<your-namespace> ]
188
172
```
189
173
190
174
::: details Essentially, this automates the following steps...
kubectl rollout status deployment bookshop-srv --timeout=8m
209
204
kubectl rollout status deployment bookshop-approuter --timeout=8m
210
205
kubectl rollout status deployment bookshop-sidecar --timeout=8m
211
206
```
212
207
213
208
:::
214
209
210
+
_This command uses checksums to detect changes in your code. If any modifications are found, it automatically triggers a rebuild. The checksums are reflected in the Docker image tags._
211
+
215
212
This process can take a few minutes to complete and logs output like this:
216
213
217
214
```log
@@ -257,24 +254,13 @@ Specify the repository where you want to push the images:
257
254
...
258
255
repository: <your-container-registry>
259
256
```
260
-
261
257
:::
262
258
263
-
Now, we use the `ctz` build tool to build all the images:
264
-
265
-
```sh
266
-
ctz containerize.yaml
267
-
```
268
-
269
-
This will start containerizing your modules based on the configuration in _containerize.yaml_. After finishing, it will ask whether you want to push the images or not. Type `y` and press enter to push your images. You can also use the above command with `--push` flag to auto-confirm. If you want more logs, you can use the `--log` flag with the above command.
270
-
271
-
[Learn more about the `ctz` build tool.](https://www.npmjs.com/package/ctz/){.learn-more style="margin-top:10px"}
272
-
273
259
### Customize Helm Chart {#customize-helm-chart}
274
260
275
261
#### About CAP Helm Charts {#about-cap-helm}
276
262
277
-
The following files are added to a _chart_ folder by executing `cds add helm`:
263
+
The following files are added to a _chart_ folder by executing `cds add kyma`:
278
264
279
265
```zsh
280
266
chart/
@@ -323,7 +309,7 @@ imagePullSecret:
323
309
# Kubernetes cluster ingress domain (used for application URLs)
324
310
domain: <cluster-domain>
325
311
326
-
# Container image registry
312
+
# Container image registry where to pull the image from
327
313
image:
328
314
registry: <registry-server>
329
315
```
@@ -494,13 +480,6 @@ parametersFrom:
494
480
```
495
481
:::
496
482
497
-
The `jsonParameters` key can also be specified using the `--set file` flag while installing/upgrading Helm release. For example, `jsonParameters` for the `xsuaa` property can be defined using the following command:
498
-
499
-
```sh
500
-
helm install bookshop ./chart \
501
-
--set-file xsuaa.jsonParameters=xs-security.json
502
-
```
503
-
504
483
> You can explore more configuration options in the subchart's directory _gen/chart/charts/service-instance_.
505
484
506
485
#### Configuration Options for Service Bindings
@@ -573,18 +552,18 @@ srv: # Key is the target service, e.g. 'srv'
573
552
574
553
Modifying the Helm chart allows you to customize it to your needs. However, this has consequences if you want to update with the latest changes from the CAP template.
575
554
576
-
You can run `cds add helm` again to update your Helm chart. It has the following behavior for modified files:
555
+
You can run `cds add kyma` again to update your Helm chart. It has the following behavior for modified files:
577
556
578
-
1. Your changes of the _chart/values.yaml_ and _chart/Chart.yaml_ will not be modified. Only new or missing properties will be added by `cds add helm`.
557
+
1. Your changes of the _chart/values.yaml_ and _chart/Chart.yaml_ will not be modified. Only new or missing properties will be added by `cds add kyma`.
579
558
2. To modify any of the generated files such as templates or subcharts, copy the files from _gen/chart_ folder and place it in the same level inside the _chart_ folder. After the next `cds build` executions the generated chart will have the modified files.
580
559
3. If you want to have some custom files such as templates or subcharts, you can place them in the _chart_ folder at the same level where you want them to be in _gen/chart_ folder. They will be copied as is.
581
560
582
561
### Extend
583
562
584
-
Instead of modifying consider extending the CAP Helm chart. Just make sure adding new files to the Helm chart does not conflict with `cds add helm`.
563
+
Instead of modifying consider extending the CAP Helm chart. Just make sure adding new files to the Helm chart does not conflict with `cds add kyma`.
585
564
586
565
::: tip Consider Kustomize
587
-
A modification-free approach to change files is to use [Kustomize](https://kustomize.io/) as a [post-processor](https://helm.sh/docs/topics/advanced/#post-rendering) for your Helm chart. This might be usable for small changes if you don't want to branch-out from the generated `cds add helm` content.
566
+
A modification-free approach to change files is to use [Kustomize](https://kustomize.io/) as a [post-processor](https://helm.sh/docs/topics/advanced/#post-rendering) for your Helm chart. This might be usable for small changes if you don't want to branch-out from the generated `cds add kyma` content.
0 commit comments