Skip to content

Commit 6b55631

Browse files
committed
namespace change, setup_complete added
1 parent bc10540 commit 6b55631

20 files changed

+179
-332
lines changed

mtdrworkshop/backend/backend.md

Lines changed: 8 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Estimated time: ~25-minutes.
88

99
### Objectives
1010

11-
* Set values for environment variables
1211
* Build and deploy the Docker image of the application
1312
* Deploy the image on the Oracle Kubernetes Engine (OKE)
1413
* Describe the steps for Undeploying
@@ -38,71 +37,31 @@ The backend is implemented using the following Java classes (under ./backend/src
3837

3938
![](images/Backend-APIs.png " ")
4039

40+
## **Task 1**: Build and push the Docker images to the OCI Registry
4141

42-
## **STEP 1**: Set values for workshop environment variables
42+
1. Edit ./backend/src/main/java/com/oracle/todoapp/Main.java
4343

44-
1. Set the root directory of the workshop
45-
```
46-
<copy>export MTDRWORKSHOP_LOCATION=~/mtdrworkshop</copy>
47-
```
48-
2. Run source addAndSourcePropertiesInBashrc.sh
49-
50-
The following command will set the values of environment variables in mtdrworkshop.properties and source ~/.bashrc
51-
52-
```
53-
<copy>cd $MTDRWORKSHOP_LOCATION; source addAndSourcePropertiesInBashrc.sh
54-
</copy>
55-
```
56-
57-
## **STEP 2**: Build and push the Docker images to the OCI Registry
58-
59-
1. Ensure that the "DOCKER_REGISTRY" variable is set
60-
61-
Example: `<region-key>.ocir.io/<object-storage-namespace>/<firstname.lastname>/<repo-name>`
62-
If the variable is not set or is an empty string, the push will fail (but the docker image will be built).
63-
64-
2. Make sure to be in backend/target/classes/wallet directory then execute
65-
```
66-
<copy>unzip ~/mtdrworkshop/setup-dev-environment/wallet.zip</copy>
67-
```
68-
69-
3. Pick mtdrb_tp service alias (see the list of aliases in
70-
./backend/target/classes/wallet/tnsnames.ora)
71-
72-
![](images/tnsnames-ora.png " ")
73-
74-
4. Edit ./backend/target/classes/application.yaml to set the database service and user password
75-
![](images/application-yaml.png " ")
76-
77-
5. Copy the edited ./backend/target/classes/application.yaml to ./backend/src/main/resources/application.yaml
78-
79-
6. Edit ./backend/src/main/java/com/oracle/todoapp/Main.java
8044
- Locate the following code fragment
45+
8146
![](images/CORS-Main.png " ")
8247
- Replace `eu-frankfurt-1` in `"https://objectstorage.eu-frankfurt-1.oraclecloud.com"` by your region
8348

8449
- Save the file
8550

86-
7. Run `build.sh` script to build and push the
87-
microservices images into the repository
51+
2. Run `build.sh` script to build and push the helidon-se image into the repository
8852

8953
```
9054
<copy>cd $MTDRWORKSHOP_LOCATION/backend; ./build.sh</copy>
9155
```
9256
In a couple of minutes, you should have successfully built and pushed the images into the OCIR repository.
9357
94-
8. Check your container registry from the root compartment
58+
3. Check your container registry in your compartment
9559
- Go to the Console, click the hamburger menu in the top-left corner and open
9660
**Developer Services > Container Registry**.
61+
62+
![](psong_images/container_registry.png)
9763
98-
![](images/Registry-root-compart.png " ")
99-
100-
9. Mark Access as Public (if Private)
101-
(**Actions** > **Change to Public**):
102-
103-
![](images/Public-access.png " ")
104-
105-
## **STEP 3**: Deploy on Kubernetes and Check the Status
64+
## **STEP 2**: Deploy on Kubernetes and Check the Status
10665
10766
1. Run the `deploy.sh` script
10867

mtdrworkshop/backend/deploy.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ mv -- /tmp/todolistapp-helidon-se-deployment-$CURRENTTIME.yaml todolistapp-helid
3838

3939

4040
if [ -z "$1" ]; then
41-
kubectl apply -f $SCRIPT_DIR/todolistapp-helidon-se-deployment-$CURRENTTIME.yaml -n msdataworkshop
41+
kubectl apply -f $SCRIPT_DIR/todolistapp-helidon-se-deployment-$CURRENTTIME.yaml -n mtdrworkshop
4242
else
43-
kubectl apply -f <(istioctl kube-inject -f $SCRIPT_DIR/todolistapp-helidon-se-deployment-$CURRENTTIME.yaml) -n msdataworkshop
43+
kubectl apply -f <(istioctl kube-inject -f $SCRIPT_DIR/todolistapp-helidon-se-deployment-$CURRENTTIME.yaml) -n mtdrworkshop
4444
fi
4545

46-
#kubectl apply -f $SCRIPT_DIR/order-service.yaml -n msdataworkshop
46+
#kubectl apply -f $SCRIPT_DIR/order-service.yaml -n mtdrworkshop
4747

4848
#kubectl create -f $SCRIPT_DIR/todolistapp-helidon-se-service.yaml -n todoapplication
98.4 KB
Loading

mtdrworkshop/backend/src/main/k8s/todolistapp-helidon-se-deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ spec:
4242
- name: database.user
4343
value: "TODOUSER"
4444
- name: database.url
45-
value: "jdbc:oracle:thin:@%TODO_PDB_NAME%_tp?TNS_ADMIN=/msdataworkshop/creds"
45+
value: "jdbc:oracle:thin:@%TODO_PDB_NAME%_tp?TNS_ADMIN=/mtdrworkshop/creds"
4646
- name: todo.table.name
4747
value: "todoitem"
4848
- name: OCI_REGION
@@ -55,7 +55,7 @@ spec:
5555
optional: true
5656
volumeMounts:
5757
- name: creds
58-
mountPath: /msdataworkshop/creds
58+
mountPath: /mtdrworkshop/creds
5959
ports:
6060
- containerPort: 8080
6161
## if you want to use a livenessProbe or readinessProbe, need to add a handler to the code -petersong

mtdrworkshop/backend/undeploy.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66

77
echo delete frontend deployment and service...
88

9-
kubectl delete deployment todolistapp-helidon-se-deployment
10-
kubectl delete service todolistapp-helidon-se-service
9+
kubectl -n mtdrworkshop delete deployment todolistapp-helidon-se-deployment
10+
kubectl -n mtdrworkshop delete service todolistapp-helidon-se-service
21.3 KB
Loading
179 KB
Loading
65.4 KB
Loading
8.02 KB
Loading
14.2 KB
Loading

0 commit comments

Comments
 (0)