diff --git a/code/day2-operations/deployment/docker/Dockerfile-day2-approuter b/code/day2-operations/deployment/docker/Dockerfile-day2-approuter index f1591d4..382fc3c 100644 --- a/code/day2-operations/deployment/docker/Dockerfile-day2-approuter +++ b/code/day2-operations/deployment/docker/Dockerfile-day2-approuter @@ -1,4 +1,4 @@ -FROM --platform=linux/amd64 node:20 +FROM --platform=linux/amd64 node:18 WORKDIR /app COPY code/day2-operations/source/day2-approuter/package.json . diff --git a/code/day2-operations/deployment/docker/Dockerfile-day2-ui b/code/day2-operations/deployment/docker/Dockerfile-day2-ui index f4b8631..68f4431 100644 --- a/code/day2-operations/deployment/docker/Dockerfile-day2-ui +++ b/code/day2-operations/deployment/docker/Dockerfile-day2-ui @@ -4,10 +4,14 @@ WORKDIR /app COPY code/day2-operations/source/day2-ui/package*.json ./ RUN npm install COPY code/day2-operations/source/day2-ui/. . + +# Set the environment variable for Node.js +ENV NODE_OPTIONS=--openssl-legacy-provider + RUN npm run build # production stage -FROM nginx:stable-alpine as production-stage +FROM --platform=linux/amd64 nginx:stable-alpine as production-stage COPY --from=build-stage /app/resources /usr/share/nginx/html EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/code/day2-operations/source/day2-ui/public/index.html b/code/day2-operations/source/day2-ui/public/index.html index cb1d076..4cae005 100644 --- a/code/day2-operations/source/day2-ui/public/index.html +++ b/code/day2-operations/source/day2-ui/public/index.html @@ -4,7 +4,7 @@ - + <%= htmlWebpackPlugin.options.title %> diff --git a/code/easyfranchise/deployment/docker/Dockerfile-approuter b/code/easyfranchise/deployment/docker/Dockerfile-approuter index 1bf3852..91e44ec 100644 --- a/code/easyfranchise/deployment/docker/Dockerfile-approuter +++ b/code/easyfranchise/deployment/docker/Dockerfile-approuter @@ -1,4 +1,4 @@ -FROM --platform=linux/amd64 node:20 +FROM --platform=linux/amd64 node:18 WORKDIR /app diff --git a/code/easyfranchise/deployment/docker/Dockerfile-ui b/code/easyfranchise/deployment/docker/Dockerfile-ui index 923dab0..9bf1149 100644 --- a/code/easyfranchise/deployment/docker/Dockerfile-ui +++ b/code/easyfranchise/deployment/docker/Dockerfile-ui @@ -1,9 +1,13 @@ # build stage -FROM --platform=linux/amd64 node:14-alpine as build-stage +FROM --platform=linux/amd64 node:18-alpine as build-stage WORKDIR /app COPY code/easyfranchise/source/ui/package*.json ./ RUN npm install COPY code/easyfranchise/source/ui/. . + +# Set the environment variable for Node.js +ENV NODE_OPTIONS=--openssl-legacy-provider + RUN npm run build # production stage diff --git a/code/setup/easyfranchise-deployment.sh b/code/setup/easyfranchise-deployment.sh old mode 100644 new mode 100755 index 0a8bbfb..697c8d9 --- a/code/setup/easyfranchise-deployment.sh +++ b/code/setup/easyfranchise-deployment.sh @@ -402,8 +402,20 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then echo '-----------------------------------' cat ./../easyfranchise/deployment/k8s/db-secret.yaml | sed "s~~$DB_SQLENDPOINT~g" | sed "s~~$DB_ADMIN~g" | sed "s~~$DB_ADMIN_PASSWORD~g" | echo "$(cat -)" echo '-----------------------------------' - else - cat ./../easyfranchise/deployment/k8s/db-secret.yaml | sed "s~~$DB_SQLENDPOINT~g" | sed "s~~$DB_ADMIN~g" | sed "s~~$DB_ADMIN_PASSWORD~g" | kubectl apply -f - || true + else + log 'Creating DB Secret...' + + cat ./../easyfranchise/deployment/k8s/db-secret.yaml | \ + sed "s~~$DB_SQLENDPOINT~g" | \ + sed "s~~$DB_ADMIN~g" | \ + sed "s~~$DB_ADMIN_PASSWORD~g" | \ + kubectl apply -f - + + if [ $? -eq 0 ]; then + log "kubectl apply successful" + else + log "kubectl apply failed" + fi || true fi echo log "Registry Secrets" @@ -422,8 +434,19 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then if [ "$DRY_RUN" = true ]; then log "Skipped for Dry Run" else + log "Creating backend and integration ConfigMaps..." kubectl apply -n backend -f ./../easyfranchise/deployment/k8s/backend-configmap.yaml - kubectl apply -n integration -f ./../easyfranchise/deployment/k8s/backend-configmap.yaml + if [ $? -eq 0 ]; then + log "Successfully applied backend-configmap.yaml in the backend namespace" + else + log "Failed to apply backend-configmap.yaml in the backend namespace" + fi + kubectl apply -n integration -f ./../easyfranchise/deployment/k8s/backend-configmap.yaml + if [ $? -eq 0 ]; then + log "Successfully applied backend-configmap.yaml in the integration namespace" + else + log "Failed to apply backend-configmap.yaml in the integration namespace" + fi fi echo diff --git a/documentation/meter/deploy/README.md b/documentation/meter/deploy/README.md index 62de46c..92012a6 100644 --- a/documentation/meter/deploy/README.md +++ b/documentation/meter/deploy/README.md @@ -116,12 +116,12 @@ When we speak about **docker-repository**, we mean the combination of account an 4. If the deployment was successful, you should see the following output: ``` bash - Release "day2-service" has been upgraded. Happy Helming! + Release "day2-service" does not exist. Installing it now. NAME: day2-service - LAST DEPLOYED: Mon May 9 15:50:59 2022 - NAMESPACE: default + LAST DEPLOYED: Fri Dec 8 10:50:59 2023 + NAMESPACE: day2-operations STATUS: deployed - REVISION: 3 + REVISION: 1 TEST SUITE: None ``` @@ -147,12 +147,12 @@ When we speak about **docker-repository**, we mean the combination of account an 4. If the deployment was successful, you should see the following output: ``` bash - Release "day2-approuter" has been upgraded. Happy Helming! + Release "day2-approuter" does not exist. Installing it now. NAME: day2-approuter - LAST DEPLOYED: Mon May 9 15:49:58 2022 - NAMESPACE: default + LAST DEPLOYED: Fri Dec 8 10:55:59 2023 + NAMESPACE: day2-operations STATUS: deployed - REVISION: 3 + REVISION: 1 TEST SUITE: None ``` @@ -178,11 +178,11 @@ When we speak about **docker-repository**, we mean the combination of account an 4. If the deployment was successful, you should see the following output: ``` bash - Release "day2-ui" has been upgraded. Happy Helming! + Release "day2-ui" does not exist. Installing it now. NAME: day2-ui - LAST DEPLOYED: Mon May 9 15:51:56 2022 + LAST DEPLOYED: Fri Dec 8 10:58:59 2023 NAMESPACE: day2-operations STATUS: deployed - REVISION: 3 + REVISION: 1 TEST SUITE: None ``` diff --git a/documentation/meter/run-apps-kyma/README.md b/documentation/meter/run-apps-kyma/README.md index 57ef0fd..4c1aaec 100644 --- a/documentation/meter/run-apps-kyma/README.md +++ b/documentation/meter/run-apps-kyma/README.md @@ -5,7 +5,7 @@ This chapter explains how to check that the metering scenario was deployed corre ## Check that the Database is running 1. Open your **EasyFranchise-Day2** account in SAP BTP Cockpit. -1. Choose **Services** > **Instances And Subsections** in the left navigation tree. +1. Choose **Services** > **Instances and Subscriptions** in the left navigation tree. 1. Select your Database and expand the "..." and select **View Dashboard** 1. Check in the opened dashboard that the database status is **running**. @@ -13,7 +13,7 @@ This chapter explains how to check that the metering scenario was deployed corre If it's not already done, you have to create metering data by using the Easy Franchise UI now. -1. Open the **City Scooter** subaccount in the SAP BTP Cockpit and go to **Instances and Subscriptions**. ![Open City Scooter Account](./images/base_ui_open.png) +1. Open the **City Scooter** subaccount in the SAP BTP Cockpit and go to **Instances and Subscriptions**. ![Open City Scooter Account](./images/2023_base_ui_open.png) 1. You can open the base mission UI by clicking the application **Easy Franchise (easyfranchise-day2...)**, where you will need to login. Then the City Scooter UI **Franchises Overview** should be displayed. ![Base Mission UI](./images/ef_base_mission_ui.png) @@ -23,9 +23,18 @@ Opening the Easy Franchise UI is enough to trigger new metering data in the data To view the metering data you have to open the day2 UI that you deployed in the last chapter. -1. Return to the **EasyFranchise-Day2** subaccount in the SAP BTP Cockpit. Select the **Overview** to see the link to the **Kyma Dashboard** under **Kyma Environment**. +1. Return to the **EasyFranchise** subaccount in the SAP BTP Cockpit. -1. Open the **Kyma Dashboard** and select the namespace **day2-operations**. Then go to **API Rules** under **Discovery and Network** ![API Rules in Kyma Dashboard](./images/get_ui_url.png) +1. Go to **Security** > **Users**, select your name and choose **Assign Role Collection**. +![Add Role Collection](./images/2023-add-day2-operator-role.png) + +1. Select the role **Easy Franchise Day 2 Operator** and choose**Assign Role Collection**. +![Role Day2 Operator](./images/2023_add_role.png) + +1. Now navigate to the **Overview** section and open the Kyma dashboard. + +1.Select the namespace **day2-operations** and go to **API Rules** under **Discovery and Network**. +![API Rules in Kyma Dashboard](./images/2023_get_ui_url.png) 1. Select the **Host URL** to open the Day2 UI to get the list of active users per tenant. All data is aggregated for the selected month. If you followed the previous steps, you should see at least one entry for the current month. ![Metering Dashboard](./images/meter_ui.png) diff --git a/documentation/meter/run-apps-kyma/images/2023-add-day2-operator-role.png b/documentation/meter/run-apps-kyma/images/2023-add-day2-operator-role.png new file mode 100644 index 0000000..8d1f14e Binary files /dev/null and b/documentation/meter/run-apps-kyma/images/2023-add-day2-operator-role.png differ diff --git a/documentation/meter/run-apps-kyma/images/2023_add_role.png b/documentation/meter/run-apps-kyma/images/2023_add_role.png new file mode 100644 index 0000000..2f5d7c6 Binary files /dev/null and b/documentation/meter/run-apps-kyma/images/2023_add_role.png differ diff --git a/documentation/meter/run-apps-kyma/images/2023_base_ui_open.png b/documentation/meter/run-apps-kyma/images/2023_base_ui_open.png new file mode 100644 index 0000000..8f1c46c Binary files /dev/null and b/documentation/meter/run-apps-kyma/images/2023_base_ui_open.png differ diff --git a/documentation/meter/run-apps-kyma/images/2023_get_ui_url.png b/documentation/meter/run-apps-kyma/images/2023_get_ui_url.png new file mode 100644 index 0000000..603ba58 Binary files /dev/null and b/documentation/meter/run-apps-kyma/images/2023_get_ui_url.png differ