Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
182 changes: 182 additions & 0 deletions tutorials/cap-operator-01-prepare/cap-operator-01-prepare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
---
title: Prepare for Deployment
description: Learn how to set up the SAP BTP, Kyma runtime for deploying the application.
parser: v2
auto_validation: true
time: 30
tags: [ tutorial>beginner, software-product>sap-cap-operator--kubernetes-environment, topic>cloud-operations, software-product-function>sap-cloud-application-programming-model, programming-tool>node-js, software-product>sap-business-technology-platform, software-product>sap-btp--kyma-runtime]
primary_tag: software-product>sap-cap-operator--kubernetes-environment
author_name: Anirudh Prasad
author_profile: https://github.com/anirudhprasad-sap
---

## You will learn

- How to configure entitlements.
- How to enable the SAP BTP Kyma runtime in your subaccount in SAP BTP.
- How to create an SAP HANA Cloud service instance in the SAP BTP cockpit.
- How to enable the CAP Operator community module in your Kyma cluster.

## Prerequisites

- You have an [enterprise global account](https://help.sap.com/docs/btp/sap-business-technology-platform/getting-global-account#loiod61c2819034b48e68145c45c36acba6e) in SAP BTP. To use services for free, you can sign up for an SAP BTPEA (SAP BTP Enterprise Agreement) or a Pay-As-You-Go for SAP BTP global account and use the free tier services only. See [Using Free Service Plans](https://help.sap.com/docs/btp/sap-business-technology-platform/using-free-service-plans?version=Cloud).
- You have a platform user. See [User and Member Management](https://help.sap.com/docs/btp/sap-business-technology-platform/user-and-member-management).
- You're an administrator of the global account in SAP BTP.
- You have a subaccount in SAP BTP to deploy the services and applications.

> This tutorial follows the guidance provided in the [SAP BTP Developer's Guide](https://help.sap.com/docs/btp/btp-developers-guide/what-is-btp-developers-guide).

### Configure the entitlements

To deploy the Incident Management sample application, you need the following entitlements:

| Service | Plan | Quota required |
| ------------- | :-----------: | ----: |
| Kyma runtime | free (Environment) | 1 |
| SAP HANA Cloud | hana-free | 1 |
| SAP HANA Cloud | tools (Application) | 1 |
| SAP HANA Schemas & HDI Containers | hdi-shared | 1 |
| HTML5 Application Repository Service | app-host | 1 |
| HTML5 Application Repository Service | app-runtime | 1 |
| Destination Service | lite | 1 |
| SaaS Provisioning Service | application | 1 |
| Service Manager | container | 1 |
| Authorization and Trust Management Service | broker | 1 |

> You can find more information about entitlements in [Configure Entitlements and Quotas](https://help.sap.com/docs/btp/sap-business-technology-platform/configure-entitlements-and-quotas-for-subaccounts).

### Enable SAP BTP, Kyma runtime

Let's enable your subaccount to use the SAP BTP, Kyma runtime.

1. Navigate to your subaccount and choose **Enable Kyma** under the **Kyma Environment** tab.

<!-- border; size:540px --> ![Enable Kyma](./img/enable-kyma.png)

2. In the **Enable Kyma** popup, change the values for **Instance Name** and **Cluster Name** as needed and choose **Create**.

<!-- border; size:540px --> ![Enable Kyma popup](./img/enable-kyma-popup.png)

> Make sure that the instance name is CLI-friendly. CLI-friendly names make it easier to manage your instances with the SAP BTP command-line interface as well.
>
> A CLI-friendly name is a short string (up to 32 characters) that contains only alphanumeric characters (A-Z, a-z, 0-9), periods, underscores, and hyphens. It can't contain white spaces.
>
> When enabling the runtime, you notice that the instance name is generated automatically for you. You can use that name or replace it with the name of your choice.


### Subscribe to SAP HANA Cloud Administration Tools

1. Navigate to your subaccount and choose **Services** &rarr; **Service Marketplace** on the left.

2. Type **SAP HANA Cloud** in the search box and choose **Create**.

<!-- border; size:540px --> ![Create an SAP HANA Cloud tools instance](./img/create-hana-tools.png)

3. In the **New Instance or Subscription** popup, select **tools** from the dropdown in the **Plan** field and choose **Create**.

<!-- border; size:540px --> ![SAP HANA Cloud tools instance creation popup](./img/create-hana-tools-popup.png)

4. Choose **View Subscription** and wait until the status changes to **Subscribed**.

<!-- border; size:540px --> ![View subscription](./img/view-subscription.png)

<!-- border; size:540px --> ![Status subscribed](./img/hanatools-status-subscribed.png)

5. In your SAP BTP subaccount, choose **Security** &rarr; **Role Collections** in the left-hand pane.

6. Choose role collection **SAP HANA Cloud Administrator**.

7. Choose **Edit**.

<!-- border; size:540px --> ![Edit role](./img/hana-edit-role.png)

8. In the **Users** section, enter your user and select the icon to add the user.

<!-- border; size:540px --> ![Add user](./img/hana-add-user.png)

> Keep the `Default Identity Provider` setting unless you have a custom identity provider configured.

9. Choose **Save**.

You've assigned the **SAP HANA Cloud Administrator** role collection to your user.

> Log out and log back in to make sure your new role collection is considered.

### Create an SAP HANA Cloud service instance

SAP HANA Cloud is used as a persistence layer.

Follow these steps to create an SAP HANA Cloud service instance in the SAP BTP cockpit:

1. In your SAP BTP subaccount, navigate to **Services** &rarr; **Instances and Subscriptions** in the left-hand pane.

2. Choose **SAP HANA Cloud**. You're redirected to SAP HANA Cloud multi-environment administration tools. Sign in with your SAP BTP cockpit username/email if necessary.

<!-- border; size:540px --> ![SAP HANA Cloud Go to application](./img/hana-goto-app.png)

3. In SAP HANA Cloud Central, choose **Create Instance**.

<!-- border; size:540px --> ![SAP HANA Cloud create instance](./img/hana-create-instance.png)

4. Choose *Confiure manually* as **Instance Configuration** and *SAP HANA Database* as **Instance Type**. Then, choose **Next Step**.

<!-- border; size:540px --> ![Create SAP HANA DB Step 1](./img/create-hana-db1.png)

5. In the **Instance Name** field, enter *application-hana-instance*.

6. In the **Administrator Password** and **Confirm Administrator Password** fields, enter a password for DBADMIN. Choose **Next Step**.

<!-- border; size:540px --> ![Create SAP HANA DB Step 2](./img/create-hana-db2.png)

7. At **SAP HANA Database: Size and Availability**, choose **Next Step**.

8. In **SAP HANA Database: Connections**, select the **All IP addresses** radio button, and choose **Next Step**.

<!-- border; size:540px --> ![Create SAP HANA DB Step 3](./img/create-hana-db3.png)

9. At **SAP HANA Database: Advanced Settings**, choose **Next Step**.

10. At **Data Lake: General**, choose **Review and Create**.

11. Choose **Create Instance**.

The creation of the database instance can take some minutes to complete.

> Your SAP HANA Cloud service instance automatically stops overnight, according to the time zone of the region where the server is located. This means you need to restart your instance every day before you start working with it.

### Map your SAP HANA Cloud service instance to your Kyma cluster

1. Go to SAP HANA Cloud Central. If you've closed it, open it again by following these steps:

- In your SAP BTP subaccount, navigate to **Services** &rarr; **Instances and Subscriptions**.
- Choose **SAP HANA Cloud**. You're redirected to SAP HANA Cloud multi-environment administration tools. Sign in with your SAP BTP cockpit username/email if necessary.

2. For the **application-hana-instance** instance, choose **Manage Configuration**.

<!-- border; size:540px --> ![Manage instance configuration](./img/hana-config.png)

3. Select the **Instance Mapping** tab and choose **Add Mapping**.

<!-- border; size:540px --> ![Add instance mapping](./img/hana-add-mapping.png)

4. Select **Kyma** from the dropdown under **Environment Type**.

5. Under **Environment Instance ID**, paste the GUID of your Kyma cluster. Here's how to find it:

- Open your Kyma dashboard.
- Choose **Namespaces** on the left and choose **kyma-system**.
- Navigate to **Configuration** &rarr; **Config Maps** and choose **sap-btp-operator-config**.
- You can see the GUID of your Kyma cluster in the **CLUSTER_ID** section.

<!-- border; size:540px --> ![Add environment instance ID](./img/hana-kyma-cluster-id.png)

> If no namespace is provided, the instance is mapped to all namespaces in the cluster.

6. Choose **Review and Save**. In the popup, choose **Save Changes**.

<!-- border; size:540px --> ![Save changes](./img/hana-save-mapping.png)

You've mapped your SAP HANA Cloud service instance to your Kyma cluster.

> For more information, see [Map an SAP HANA Database to another Environment Context](https://help.sap.com/docs/HANA_CLOUD/9ae9104a46f74a6583ce5182e7fb20cb/1683421d02474567a54a81615e8e2c48.html) to add a new Cloud foundry or Kyma mapping.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
213 changes: 213 additions & 0 deletions tutorials/cap-operator-02-tools/cap-operator-02-tools.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
---
title: Install Tools for Deployment
description: Learn how to install the necessary tools for deploying the application
parser: v2
auto_validation: true
time: 30
tags: [ tutorial>beginner, software-product>sap-cap-operator--kubernetes-environment, topic>cloud-operations, software-product-function>sap-cloud-application-programming-model, programming-tool>node-js, software-product>sap-business-technology-platform, software-product>sap-btp--kyma-runtime]
primary_tag: software-product>sap-cap-operator--kubernetes-environment
author_name: Anirudh Prasad
author_profile: https://github.com/anirudhprasad-sap
---

## You will learn

- How to install the tools required for deploying CAP applications in the SAP BTP, Kyma runtime.
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
- [kubelogin](https://github.com/int128/kubelogin)
- [helm](https://helm.sh/docs/intro/install/)
- [pack](https://buildpacks.io/docs/tools/pack/#install)
- A container management app such as [Docker Desktop](https://www.docker.com/products/docker-desktop/) or [Rancher Desktop](https://rancherdesktop.io/).

## Prerequisites

- You've configured the respective entitlements, enabled the Kyma runtime in your subaccount, and created an SAP HANA Cloud service instance in the SAP BTP cockpit. Follow the steps in the [Prepare for Deployment](cap-operator-01-prepare) tutorial that is part of the [Application Lifecycle Management using CAP Operator](<TODO>) tutorial group.
- You have an [enterprise global account](https://help.sap.com/docs/btp/sap-business-technology-platform/getting-global-account#loiod61c2819034b48e68145c45c36acba6e) in SAP BTP. To use services for free, you can sign up for an SAP BTPEA (SAP BTP Enterprise Agreement) or a Pay-As-You-Go for SAP BTP global account and use the free tier services only. See [Using Free Service Plans](https://help.sap.com/docs/btp/sap-business-technology-platform/using-free-service-plans?version=Cloud).
- You have a platform user. See [User and Member Management](https://help.sap.com/docs/btp/sap-business-technology-platform/user-and-member-management).
- You're an administrator of the global account in SAP BTP.
- You have a subaccount in SAP BTP to deploy the services and applications.
- For Windows, you need Chocolatey. Chocolatey is a package manager that speeds up and eases installation of the tools in this tutorial. See how to install Chocolatey in [Setup/Install](https://docs.chocolatey.org/en-us/choco/setup).
- You've prepared a container registry and you've logged in to the container registry through your CLI. A container registry is a repo where you can push your Docker images. You can use any container registry offering as long as it can be reached from the public internet. In case if you don't have access to a container registry, you can make use of the [Docker Registry Community Module](https://kyma-project.io/external-content/docker-registry/docs/user/README.html) from Kyma.

### Install kubectl

[OPTION BEGIN [macOS]]
1. To install kubectl, run the following command:
```Shell/Bash
brew install kubectl
```
2. Check if the installation is successful:
```Shell/Bash
kubectl version --client
```
You see a version number.
[OPTION END]

[OPTION BEGIN [Windows]]
You can install kubectl using Chocolatey.

1. To install kubectl, run the following command:
```Shell/Bash
choco install kubernetes-cli
```
2. Check if the installation is successful:
```Shell/Bash
kubectl version --client
```
You see something like:
`Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.3", GitCommit:"1e11e4a2108024935ecfcb2912226cedeafd99df", GitTreeState:"clean", BuildDate:"2020-10-14T12:50:19Z", GoVersion:"go1.15.2", Compiler:"gc", Platform:"windows/amd64"}`
[OPTION END]

[OPTION BEGIN [Linux]]
Follow the instructions for your preferred way of installing kubectl at [Install and Set Up kubectl on Linux](https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/).
[OPTION END]

### Install kubelogin

[OPTION BEGIN [macOS]]
To install kubelogin, run the following command:
```Shell/Bash
brew install int128/kubelogin/kubelogin
```
See [Setup](https://github.com/int128/kubelogin#setup) in the kubelogin docs for more details.
[OPTION END]

[OPTION BEGIN [Windows]]
You can install kubelogin using Chocolatey:

```Shell/Bash
choco install kubelogin
```

See [Setup](https://github.com/int128/kubelogin#setup) in the kubelogin docs for more details.
[OPTION END]

[OPTION BEGIN [Linux]]
To install kubelogin, run the following command:
```Shell/Bash
brew install int128/kubelogin/kubelogin
```

See [Setup](https://github.com/int128/kubelogin#setup) in the kubelogin docs for more details.
[OPTION END]

### Log in to your Kyma cluster

1. Choose `KubeconfigURL` under the **Kyma Environment** tab in your subaccount.

<!-- border; size:540px --> ![Kubeconfig URL](./img/kubeconfigURL.png)

A `kubeconfig.yaml` file is downloaded.

<!-- border; size:540px --> ![Kubeconfig yaml](./img/kubeconfig_yaml.png)

2. Copy the `kubeconfig.yaml` file to the `~/.kube/` directory and rename it to `config`. Replace or rename any existing file with the same name.

There are two additional steps for Windows users only:

3. Go to `C:\ProgramData\chocolatey\bin`.

4. Rename `kubelogin.exe` to `kubectl-oidc_login.exe`.

### Install helm

[OPTION BEGIN [macOS]]
There's a multitude of options to install Helm. You can see the full list at [Installing Helm](https://helm.sh/docs/intro/install/). We have also listed some options:

To install Helm, run the following command:
```Shell/Bash
brew install helm
```
[OPTION END]

[OPTION BEGIN [Windows]]
There's a multitude of options to install Helm. You can see the full list at [Installing Helm](https://helm.sh/docs/intro/install/). We have also listed some options:

You can install Helm using Chocolatey.

1. To install Helm, run the following command:
```Shell/Bash
choco install kubernetes-helm
```
2. Check if the installation is successful:
```Shell/Bash
helm version
```
You see something like `version.BuildInfo{Version:"v3.8.0", GitCommit:"d14138609b01886f544b2025f5000351c9eb092e", GitTreeState:"clean", GoVersion:"go1.17.5"}`.
[OPTION END]


### Install Paketo (pack)

[OPTION BEGIN [macOS]]
Pack lets you build container images that are collaboratively maintained, making it easier to maintain and update.

```Shell/Bash
brew install buildpacks/tap/pack
```
[OPTION END]

[OPTION BEGIN [Windows]]
Pack lets you build container images that are collaboratively maintained, making it easier to maintain and update.

You can install pack using Chocolatey with the following command:
```Shell/Bash
choco install pack
```
As an alternative, you can install `pack` manually:

1. Download `pack` for your platform from [GitHub](https://github.com/buildpacks/pack/releases).
2. Extract the `pack` binary.
3. Enter **Edit the System Environment Variables** in the Windows search box (Windows icon in the task bar). The **System Properties** dialog is opened.
4. Choose **Environment Variables...**.
5. Choose your `Path` environment variable under *User Variables for `<your_user_name>`* and choose **Edit**.
6. Choose **Browse** and navigate to the folder where you extracted the `pack` binary.
7. Choose **OK** to add `pack` to your `Path` environment variable.
[OPTION END]

[OPTION BEGIN [Linux]]
Pack lets you build container images that are collaboratively maintained, making it easier to maintain and update.

Follow the instructions to install the [pack CLI](https://buildpacks.io/docs/tools/pack/#install).
[OPTION END]

### Install a container management app

[OPTION BEGIN [Docker Desktop]]

Kyma runs on containers. For this tutorial, you need an application that enables you to manage container images on your desktop (build, push, pull, and run) and a Docker-compatible command-line interface. We provide two examples - Docker Desktop and Rancher Desktop. You can choose one of these or any other app suitable for this purpose.

* **macOS**: Download the installer from [Install Docker Desktop on Mac](https://docs.docker.com/desktop/mac/install/) and follow the instructions to install and set up Docker Desktop.

* **Windows**: Download the installer from [Install Docker Desktop on Windows](https://docs.docker.com/desktop/windows/install/) and follow the instructions to install and set up Docker Desktop.

[OPTION END]
[OPTION BEGIN [Rancher Desktop]]

Kyma runs on containers. For this tutorial, you need an application that enables you to manage container images on your desktop (build, push, pull, and run) and a Docker-compatible command-line interface. We provide two examples - Docker Desktop and Rancher Desktop. You can choose one of these or any other app suitable for this purpose.

* **macOS**:

1. Go to the [releases](https://github.com/rancher-sandbox/rancher-desktop/releases) page.
2. Download the Rancher Desktop installer for macOS.

> The macOS installer is called `Rancher.Desktop-<version.architecture>.dmg`. Here's an example with the current latest version: `Rancher.Desktop-1.2.1.x86_64.dmg`.

3. Run the installer. When the installation is complete, drag the Rancher Desktop icon to the **Applications** folder.

> You can find details about installation requirements and steps to install or uninstall in [macOS](https://docs.rancherdesktop.io/getting-started/installation#macos).

* **Windows**:

1. Go to the [releases](https://github.com/rancher-sandbox/rancher-desktop/releases) page.
2. Download the Rancher Desktop installer for Windows.

> The Windows installer is called `Rancher.Desktop.Setup.<version>.exe`. Here's an example with the current latest version: `Rancher.Desktop.Setup.1.2.1.exe`.

3. Run the installer. When the installation is complete, choose **Finish**.

> You can find details about installation requirements and steps to install or uninstall in [Windows](https://docs.rancherdesktop.io/getting-started/installation#windows).

* **Linux**: There are several ways to install Rancher Desktop on Linux. You can find details about installation requirements and steps to install or uninstall in [Linux](https://docs.rancherdesktop.io/getting-started/installation#linux).

[OPTION END]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading