Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
e08545e
Completed the first draft of the APM spring boot on K8S workshop for OCI
yutakats Aug 11, 2022
456b90d
Updating task titles etc
yutakats Aug 11, 2022
fcdff38
Updated the estimated time
yutakats Aug 11, 2022
24512e8
Changed lab directory names
yutakats Aug 12, 2022
17a09e3
Numerous updates done to the APM SB-HOL
yutakats Aug 12, 2022
643182a
minor adjustments to go with the self-qa task list
yutakats Aug 13, 2022
89d1d03
corrected a help link and a typo
yutakats Aug 13, 2022
5f5c165
Corrected the format to go with the guidelines
yutakats Aug 13, 2022
e050183
added changes based on the team QA feedbacks
yutakats Aug 15, 2022
dc9d76e
additional changes based on the feedbacks
yutakats Aug 15, 2022
44d2679
corrected a typo
yutakats Aug 15, 2022
21a2d7a
Additional fix based on the feedbacks
yutakats Aug 15, 2022
d59c32e
first draft of the WLS lab for OCW
yutakats Aug 17, 2022
2ea205f
Corrected a typo in a service name configured for APM java agent inst…
yutakats Aug 18, 2022
3d317cc
first submission of the WSM 11254
yutakats Aug 26, 2022
e8de205
applied enhancements to the APM demo lab
yutakats Aug 26, 2022
b08ad51
a few minor fixes done based on the lint checker
yutakats Aug 26, 2022
91a475d
title fix to comply the lint checker
yutakats Aug 26, 2022
4123d1b
spelling corrections
yutakats Aug 26, 2022
90707c1
updated the estimated time
yutakats Aug 26, 2022
0eaaaf4
Updated the APM with WLS HOL
yutakats Aug 30, 2022
9075533
Updated based on the feedbacks and spelling checker
yutakats Aug 30, 2022
fb9e493
APM Helidon lab - updates for ocw
yutakats Aug 30, 2022
465c569
Self QA on helidon apm lab.
yutakats Aug 31, 2022
9fc43c7
additional updates to the APM helidon workshop
yutakats Aug 31, 2022
c10acb8
helidon-apm lab -self qa. additional changes
yutakats Aug 31, 2022
41fda15
Update 3-1-1-2-filesystem.png
yutakats Aug 31, 2022
4fa9397
Updated WLS APM workshop with Lint checker result
yutakats Aug 31, 2022
b23ebc8
Update access-env.md
yutakats Aug 31, 2022
c04b05a
Updated the Help section for all 4 hols
yutakats Aug 31, 2022
9024a03
Updated Index.html for 4 APM workshops
yutakats Sep 1, 2022
972fea5
Merge branch 'main' into main
yutakats Sep 1, 2022
4685c45
Editing made based on the non-team feedbacks.
yutakats Sep 2, 2022
1df24ce
Merge branch 'main' of https://github.com/yutakats/oci
yutakats Sep 2, 2022
17a4dc3
Merge branch 'main' into main
yutakats Sep 2, 2022
3f4bfbc
Update create-file-system.md
yutakats Sep 9, 2022
b0b19ef
Update introduction.md
yutakats Sep 11, 2022
43050ec
Update introduction.md
yutakats Sep 11, 2022
9829021
corrected missing & misplaced steps
yutakats Sep 15, 2022
a55f89a
adjustments required as the Java agent version has updated
yutakats Sep 15, 2022
e56cb11
Added steps to the workshop as the Green button was enabled.
yutakats Sep 19, 2022
8764ad4
Updated the clean up steps including the deletion of domain and compa…
yutakats Oct 1, 2022
32d808c
Updated the acknowledgement section
yutakats Oct 1, 2022
55eb125
removed steps to enter name at the compartment deletion
yutakats Oct 3, 2022
66caa57
minor spacing adjustments on names at acknowledgements
yutakats Oct 3, 2022
7128e2f
Merge branch 'main' into main
yutakats Oct 3, 2022
72dc00f
Update cleanup.md
yutakats Oct 3, 2022
d5f2fab
Merge branch 'main' of https://github.com/yutakats/oci
yutakats Oct 3, 2022
f340b32
Added a promotion to another HOL at the end of the workshop
yutakats Oct 3, 2022
9b94ca4
Updated a note section, mentioning a new feature
yutakats Oct 3, 2022
2015fc4
added additional image to the workshop intro section
yutakats Oct 3, 2022
2701972
adding introduction lab to two other hols.
yutakats Oct 4, 2022
912d9bf
Made the promotion labs optional
yutakats Oct 4, 2022
99daf01
Merge branch 'main' into main
yutakats Oct 4, 2022
448158b
running periodic maintenance for Native cloud app APM workshop
yutakats Oct 29, 2022
4362134
Merge branch 'main' of https://github.com/yutakats/oci
yutakats Oct 29, 2022
cee660b
updated links to other APM workshops
yutakats Dec 15, 2022
4224a10
Quarterly update on springboot workshop
yutakats Dec 16, 2022
2b97789
Updated the WLS workshop with Agent 1.8 & general OCI UI changes.
yutakats Dec 16, 2022
869149f
Merge branch 'main' into main
yutakats Dec 17, 2022
915cfeb
Merge remote-tracking branch 'upstream/main'
yutakats Dec 17, 2022
f71a7d4
Merge branch 'main' of https://github.com/yutakats/oci
yutakats Dec 17, 2022
7fcf2c7
Revert "running periodic maintenance for Native cloud app APM workshop"
yutakats Dec 19, 2022
34e438a
Updated image file names
yutakats Dec 19, 2022
afa55a5
Replaced the image with the corporate approved one
yutakats Dec 20, 2022
4372fd6
Replaced the local file image with the file link from the corporate page
yutakats Dec 20, 2022
9cf7945
Merge remote-tracking branch 'upstream/main'
yutakats Mar 17, 2023
9da451a
Quarterly update - APM microservices w/SpringBoot
yutakats Mar 24, 2023
f630ab7
Merge branch 'main' into main
malcherm Mar 27, 2023
e4d92a5
Quarterly QA WSM ID: 9104
yutakats Mar 27, 2023
11bb8c2
Updated a note in the info section with more clarifications on requir…
yutakats Mar 27, 2023
0c01ca9
Update additional changes on SB+MS workshop
yutakats Mar 28, 2023
b03ce5c
removing a debugging code left over in the file
yutakats Mar 29, 2023
46139bf
changes requested by the approver
yutakats Mar 29, 2023
4a8cbe2
Merge branch 'main' into main
yutakats Mar 29, 2023
2d70c54
changed the lab folder names for existing two projects
yutakats Apr 10, 2023
a47c46a
Merge branch 'main' of https://github.com/yutakats/oci
yutakats Apr 10, 2023
4ccee7b
Update create-file-system.md
yutakats Apr 10, 2023
23b70f1
Update create-block-volume.md
yutakats Apr 11, 2023
1503d25
Merge branch 'main' into main
yutakats Apr 11, 2023
4827a7e
Added OCW folders
yutakats May 5, 2023
dbdd0cd
Merge branch 'main' into main
yutakats May 5, 2023
f0d9701
Updated a manifest file
yutakats May 5, 2023
b931f73
Merge branch 'main' of https://github.com/yutakats/oci
yutakats May 5, 2023
1632ca5
Merge remote-tracking branch 'upstream/main'
yutakats May 11, 2023
b3c87f7
Updated images
yutakats May 12, 2023
d667526
Merge remote-tracking branch 'upstream/main'
yutakats May 18, 2023
fcb0a2c
WMSID 11254 - adding sections for CW
yutakats May 23, 2023
9008d2e
WSMID 11254 added images to the CW labs
yutakats May 23, 2023
424de4f
WSMID 11254
yutakats May 23, 2023
b28e741
WSMID 11254 correcting typos
yutakats May 23, 2023
2c6ad3b
Merge remote-tracking branch 'upstream/main'
yutakats May 23, 2023
22e5111
WSMID 11254 Typo correction
yutakats May 23, 2023
5f3fe00
WSMID 11254 added a new lab
yutakats May 24, 2023
26c2572
Merge remote-tracking branch 'upstream/main'
yutakats May 24, 2023
56ff4e1
Merge remote-tracking branch 'upstream/main'
yutakats May 25, 2023
c4e53a6
WSMID 11254 updated the new lab for CW
yutakats May 25, 2023
de6fba3
WSMID 11254 added corrections
yutakats May 25, 2023
f29bc7e
WMSID 11254 minor corrections
yutakats May 25, 2023
9872a8e
WSMID 11254 updated estimated time
yutakats May 26, 2023
36e57dc
Merge remote-tracking branch 'upstream/main'
yutakats May 26, 2023
1a680f8
WMS ID 11254 updates based on the feedbacks
yutakats May 30, 2023
4b46407
WMS ID 11254 minor change
yutakats May 30, 2023
f298219
Merge remote-tracking branch 'upstream/main'
yutakats Jun 5, 2023
9e08ef7
WSM ID: 11254 Update with QA feedback
yutakats Jun 5, 2023
03f89c5
Merge remote-tracking branch 'upstream/main'
yutakats Jun 6, 2023
c376e39
WMSID 11254 updated introduction
yutakats Jun 6, 2023
af80ae5
Merge remote-tracking branch 'upstream/main'
yutakats Jul 22, 2023
1664386
Merge remote-tracking branch 'upstream/main'
yutakats Aug 1, 2023
b0e62ad
WSMID 11254 Updating images
yutakats Aug 2, 2023
2e5b0af
Merge remote-tracking branch 'upstream/main'
yutakats Aug 2, 2023
595bf53
WSMID11254 - added CW24 folders
yutakats Jun 5, 2024
6c9429c
WMSID11254 CW-updates
yutakats Jun 8, 2024
a5e5828
WMSID11254 updated images
yutakats Jun 10, 2024
ac2cec2
WMSID11254 image updates
yutakats Jun 11, 2024
9212283
Merge remote-tracking branch 'upstream/main'
yutakats Jun 12, 2024
02c3e63
WMS ID: 7962 Quarterly Updates
yutakats Jul 2, 2024
5e6b9cc
WMS ID: 7962: updated last modified dates
yutakats Jul 2, 2024
78ee4f4
WMSID 11254 removed MFA
yutakats Jul 7, 2024
d074ca9
Merge branch 'main' into main
yutakats Jul 7, 2024
28c49f6
Merge remote-tracking branch 'upstream/main'
yutakats Nov 24, 2024
82f7ec2
WMSID 11191 Quarterly update
yutakats Nov 24, 2024
9aa6e1e
WSM ID 11191 implementing QA feedbacks
yutakats Nov 26, 2024
5fb7c8f
WSM ID 11191 Adding changes based on the QA
yutakats Nov 27, 2024
3103a6a
wsm id 11191 QA feedback implementation
yutakats Nov 28, 2024
90867b8
WMS ID 11191 updating images
yutakats Nov 29, 2024
78654e2
WMS ID 11191 removed old images
yutakats Nov 29, 2024
7874283
WMS ID 11191 -removed duplicated md file
yutakats Nov 29, 2024
7b366a1
WMSID 11191 removed obsolete file reference
yutakats Nov 29, 2024
0e08188
WMS ID 11191 further QA feedbacks
yutakats Nov 30, 2024
5249676
WMS ID 11191 QA feedbacks
yutakats Nov 30, 2024
55f3f00
WMS ID 11191 Update images
yutakats Nov 30, 2024
146378e
WSM ID 11191 Corrected explanation of the lab
yutakats Nov 30, 2024
c745972
WMS ID 11191 further clarification added to the conclusion of the wor…
yutakats Nov 30, 2024
837315d
WMS ID 11191 - corrected cases and grammatical errors
yutakats Dec 2, 2024
c3b344f
Merge remote-tracking branch 'upstream/main'
yutakats Dec 3, 2024
c084742
WSM ID 11191 - updated the get started URL
yutakats Dec 4, 2024
16eb394
WSM ID 11191 updated contents based on the lint checker suggestions
yutakats Dec 4, 2024
b4e24a9
WSM ID 11191 - test update image name change
yutakats Dec 5, 2024
aa91ff7
WMS ID test checkin to test image name change
yutakats Dec 5, 2024
479d2dd
WMS ID 11191 - temporarily removing files with case changes
yutakats Dec 5, 2024
2acc363
WMS ID 11191 - adding back the image files with lower case (no name c…
yutakats Dec 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,52 +1,46 @@
# Introduction

## About this Workshop

## About this workshop
This workshop walks you through how to configure Spring Boot microservices deployed on Kubernetes for monitoring with the Oracle Application Performance Monitoring (APM) service. This enables automatic OpenTracing instrumentation and metrics collection that is used to provide full, end-to-end monitoring and diagnostics for the application.

In this workshop, you will provision the APM Java agent in either a file system (Paid Oracle account) or block volumes (Paid or Free tier account) mounted in the Oracle Cloud, deploy the agent to the Kubernetes cluster, instrument the APM Browser agent by inserting JavaScript code to a webpage and view traces and spans in APM Trace Explorer.
In this workshop, you will instrument the application using the OpenTelemetry (OTEL) Operator, which automatically inject and configure APM Java Agent to the Kubernetes cluster, instrument the APM Browser agent by inserting JavaScript code to a webpage and view traces and spans in APM Trace Explorer.

>**Note:** The same approach demonstrated for Spring Boot Java microservices on Kubernetes can be used to configure other types of java application servers, such as WebLogic, deployed on Kubernetes.

![Workshop app architecture](images/apm_microservices_setup.png " ")
Estimated Time: 45 minutes

Estimated Time: 75 minutes
## Task 1: Know before you run

### About Oracle Cloud Infrastructure Application Performance Management (OCI APM)

The diagram below provides an overview of the OCI APM Service, its features, components, and some of the other OCI services it integrates with.

![APM architecture](images/apm_diagram.png " ")

Among other capabilities, OCI APM includes an implementation of a Distributed Tracing system. It collects and processes transaction trace data (spans) from the monitored application and makes it available for viewing, dashboarding, exploration, alerts, etc. For more information on APM and Trace Explorer please refer to Application Performance Monitoring > **[Use Trace Explorer](https://docs.oracle.com/en-us/iaas/application-performance-monitoring/doc/use-trace-explorer.html)** section in the OCI Documentation.
Among other capabilities, OCI APM includes an implementation of a Distributed Tracing system. It collects and processes transaction trace data (spans) from the monitored application and makes it available for viewing, dash boarding, exploration, alerts, etc. For more information on APM and Trace Explorer please refer to Application Performance Monitoring > **[Use Trace Explorer](https://docs.oracle.com/en-us/iaas/application-performance-monitoring/doc/use-trace-explorer.html)** section in the OCI Documentation.

In the workshop, you will learn how to instrument a Java microservices application deployed on a Kubernetes cluster with APM agents. You will also learn how to create an APM domain in the Oracle Cloud and use Trace Explorer to search and view traces/spans in the APM User Interface.
In the workshop, you will learn how to automatically instrument a Java micro services application deployed on a Kubernetes cluster with APM agents. You will also learn how to create an APM domain in the Oracle Cloud and use Trace Explorer to search and view traces/spans in the APM User Interface.

>**Note:** Creating a file system requires OCI quota and permissions. If you are running the workshop in a free tier with 30 day free trial, please select to create block volumes. After completion of Lab 3, select **Lab 4 (Free Trial) "Create and configure block volumes"**, then proceed to **Lab 5 (Free Trial) "Instrument server monitoring on the block volumes"**.

### Objectives

In this workshop, you will:
* Create an APM domain, obtain Data Upload Endpoint and Data Keys
* Create a file system or block volumes in the Oracle Cloud Infrastructure, and mount it in the Kubernetes pods
* Download, provision and deploy the APM Java agent
* Apply custom storage configuration to the Kubernetes pods
* Instrument APM Browser agent
* Install OpenTelemetry Operator and deploy the APM Java agent
* Configure Kubernetes custom resource to automatically inject APM Browser Agent
* Use APM Trace Explorer to view traces, spans, and span dimensions

### Prerequisites


* An Oracle Free Tier with a 30-day free trial or Paid Cloud Account - Please view this workshop's LiveLabs landing page to see which environments are supported.

* An Oracle Free Tier with a 30-day free trial or Paid Cloud Account - Please view this workshop's LiveLabs landing page to see which environments are supported.


>**Note:** If you have a **Free Trial** account when your Free Trial expires, your account will be converted to an **Always Free** account. You will not be able to conduct Free Tier workshops unless the Always Free environment is available.
**[Click here for the Free Tier FAQ page.](https://www.oracle.com/cloud/free/faq.html)**

If you are running the workshop in a Paid Cloud Account, ensure you have the permissions below:
* Oracle Cloud resources and permissions to create a file system. See **[Creating File Systems](https://docs.oracle.com/en-us/iaas/Content/File/Tasks/creatingfilesystems.htm)** and **[Service Limits](https://docs.oracle.com/en-us/iaas/Content/General/Concepts/servicelimits.htm#top)** in the Oracle Cloud documentation.
* Oracle Cloud Account Administrator role or manage apm-domains permission in the target compartment. See **[Perform Oracle Cloud Infrastructure Prerequisites (APM)](https://docs.oracle.com/en-us/iaas/application-performance-monitoring/doc/perform-oracle-cloud-infrastructure-prerequisite-tasks.html)** in the Oracle Cloud documentation.

* Oracle Cloud Account Administrator role or manage apm-domains permission in the target compartment. See **[Perform Oracle Cloud Infrastructure Prerequisites (APM)](https://docs.oracle.com/en-us/iaas/application-performance-monitoring/doc/perform-oracle-cloud-infrastructure-prerequisite-tasks.html)** in the Oracle Cloud documentation.

### More APM Workshops

Expand All @@ -59,4 +53,4 @@ If you are running the workshop in a Paid Cloud Account, ensure you have the per
- **Contributors** - Steven Lemme, Senior Principal Product Manager,
Anand Prabhu, Sr. Member of Technical Staff,
Avi Huber, Vice President, Product Management
- **Last Updated By/Date** - Yutaka Takatsu, March 2023
- **Last Updated By/Date** - Yutaka Takatsu, November, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,28 @@ Watch the video below for a quick walk-through of the lab.

2. Make sure the **apmworkshop** is selected in the Compartment field, then click **Create cluster**

![Oracle Cloud console, Clusters in Compartment](images/1-2-OKE.png " ")
![Oracle Cloud console, Clusters in Compartment](images/1-2-oke.png " ")

3. Quick Create pane is pre-selected. Keep the default selection and click **Submit**.

![Oracle Cloud console, Create cluster](images/1-3-OKE.png " ")
![Oracle Cloud console, Create cluster](images/1-3-oke.png " ")

4. Name the cluster as **apmlab-cluser1**. Accept the default setting for other fields and click **Next**.

![Oracle Cloud console, Create cluster](images/1-4-OKE.png " ")
![Oracle Cloud console, Create cluster](images/1-5-OKE.png " ")
![Oracle Cloud console, Create cluster](images/1-4-oke.png " ")
![Oracle Cloud console, Create cluster](images/1-5-oke.png " ")

5. Review the configuration, and click **Create cluster**.

![Oracle Cloud console, Create cluster](images/1-6-OKE.png " ")
![Oracle Cloud console, Create cluster](images/1-6-oke.png " ")

6. Make sure all verification steps are cleared. Click **Close**.

![Oracle Cloud console, Create cluster](images/1-7-OKE.png " ")
![Oracle Cloud console, Create cluster](images/1-7-oke.png " ")

7. This will start to create a cluster, and takes 7 to 10 minutes to complete. While waiting for the creation of the cluster, you can proceed to the next lab to create an APM domain. In Lab 3, we will resume the steps to build the application.

![Oracle Cloud console, Create cluster](images/1-8-OKE.png " ")
![Oracle Cloud console, Create cluster](images/1-8-oke.png " ")



Expand All @@ -75,4 +75,4 @@ You may now **proceed to the next lab**.
- **Contributors** - Steven Lemme, Senior Principal Product Manager,
Anand Prabhu, Sr. Member of Technical Staff,
Avi Huber, Vice President, Product Management
* **Last Updated By/Date** - Yutaka Takatsu, August 2022
* **Last Updated By/Date** - Yutaka Takatsu, November, 2024
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.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ Watch the video below for a quick walk-through of the lab.
1. From the OCI menu, select **Observability & Management**, then **Administration**.
![Oracle Cloud console Menu](images/2-1-domain.png " ")

2. Select the **apmworkshop** compartment from the pulldown menu.
2. Select the **apmworkshop** compartment from the pulldown menu. Then click **Create APM Domain**.
![Oracle Cloud console Menu](images/2-1-2-domain.png " ")
3. Click **Create APM Domain**.
![Oracle Cloud console, Create APM Domain](images/2-2-domain.png " ")


4. Name your APM domain as **apmworkshop** and select the compartment you created. Add a check to the **“Create as Always Free Domain”**, then click **Create**.
![Oracle Cloud console, Create APM Domain](images/2-3-domain.png " ")

Expand Down Expand Up @@ -71,4 +71,4 @@ You may now **proceed to the next lab**.
Steven Lemme, Senior Principal Product Manager,
Anand Prabhu, Sr. Member of Technical Staff,
Avi Huber, Vice President, Product Management
* **Last Updated By/Date** - Yutaka Takatsu, December 2022
* **Last Updated By/Date** - Yutaka Takatsu, November, 2024
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.
222 changes: 222 additions & 0 deletions oci-apm-springboot/03-build-app/build-app.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
# Build a microservices application

## Introduction

This workshop uses Spring Boot-based Java microservices as a target application to trace against. In this lab, you will deploy the application to the Kubernetes cluster you created in Lab 1.

Estimated time: 10 minutes

### Objectives

* Build a microservices application for monitoring

### Prerequisites

* Completion of the preceding labs in this workshop

## Task 1: Verify OKE

1. Go back to the Kubernetes cluster page where you left Lab 1, and check the status of the cluster. Open the navigation menu from the top left corner (aka. hamburger menu) in the Oracle Cloud console, and select **Developer Services** > **Kubernetes Clusters (OKE)**.

![Oracle Cloud console, Cluster details](images/1-1-menu.png " ")

2. Click the **apmlab-cluser1** link from the table.

![Oracle Cloud console, Navigation Menu](images/1-2-menu.png " ")

3. If the status of the cluster is **Active**, creation was successful. If it is still in a **Creating** status, it may take a few more minutes to complete. (Usually, it takes 7 to 10 minutes to finish the jobs to create a cluster).

![Oracle Cloud console, Cluster details](images/1-9-oke.png " ")

## Task 2: Access the OKE in the Oracle Cloud shell


1. Click **Access Cluster** on the cluster details page.

![Oracle Cloud console, Cluster details](images/2-1-oke.png " ")

2. Make sure the **Cloud Shell Access** is selected. Click the **Copy** link from the command to access kubeconfig for the cluster.

![Oracle Cloud console, Cluster details](images/2-2-oke.png " ")

3. Then click **Launch Cloud Shell**.

![Oracle Cloud console, Cluster details](images/2-2-2-oke.png " ")

4. Oracle Cloud Shell window opens at the lower side of the browser screen.

![Oracle Cloud console, Cluster details](images/2-3-oke.png " ")

5. Paste the copied command to the command shell prompt. Then hit enter.

![Oracle Cloud console, Cluster details](images/2-4-oke.png " ")

>**Note:** Save the command to a text file on your laptop, and execute it whenever you start a new Cloud Shell session while working in the labs in this workshop.

## Task 3: Create a configuration file

1. In the Cloud Shell, type down the command below to create a work directory.

``` bash
<copy>
mkdir ~/sb-hol;cd ~/sb-hol
</copy>
```

![Oracle Cloud console, Cloud Shell](images/3-1-mkdir.png " ")

2. Use text editor (such as the vi editor tool) to create a configuration file within the directory.

``` bash
<copy>
vi wstore.yaml
</copy>
```
![Oracle Cloud console, Cloud Shell](images/3-2-wstore.png " ")

>**Note**: If you are using the vi editor, type i to enter Insert mode, and make the text editable. Use allow keys to navigate the text and make changes to where you set the cursor. To save a file, press the Esc key, then type :wq to write and quit the file. If you do not wish a change, press Esc then type :q! to discard your changes. Please refer to the editor's references for more usage.


3. Copy the content below and paste it into the configuration file.

``` bash
<copy>
apiVersion: v1
kind: Service
metadata:
name: wstore-frontend
spec:
type: LoadBalancer
selector:
app: wstore-front
ports:
- protocol: TCP
port: 80
targetPort: 8080
externalTrafficPolicy: Local
---
apiVersion: v1
kind: Service
metadata:
name: wstore-backend
spec:
type: NodePort
selector:
app: wstore-back
ports:
- protocol: TCP
port: 8080
targetPort: 8080
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: wstore-front
spec:
serviceName: "wstore-frontend"
replicas: 1
selector:
matchLabels:
app: wstore-front
template:
metadata:
labels:
app: wstore-front
spec:
containers:
- name: wstore
image: iad.ocir.io/axfo51x8x2ap/p-winestore:latest
command: ["java", "-jar", "./wineStore.jar", "--spring.config.location=file:/spring/wstore.properties"]
ports:
- containerPort: 8080
imagePullSecrets:
- name: ocirsecret
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: wstore-back
spec:
serviceName: "wstore-backend"
replicas: 2
selector:
matchLabels:
app: wstore-back
template:
metadata:
labels:
app: wstore-back
spec:
containers:
- name: wstore
image: iad.ocir.io/axfo51x8x2ap/p-winestore:latest
command: ["java", "-jar", "./wineStore.jar", "--spring.config.location=file:/spring/wstore.properties"]
ports:
- containerPort: 8080
imagePullSecrets:
- name: ocirsecret

</copy>
```
![Oracle Cloud console, Cloud Shell](images/3-3-wstore-content.png " ")

>**Note**: Make sure to keep the same space indentation when pasting the code into the file.



## Task 4: Deploy the application

1. Execute the command below to deploy the application to the cluster.
``` bash
<copy>
kubectl apply -f ~/sb-hol/wstore.yaml
</copy>
```

Verify the 2 services and 2 stateful sets are created.

![Oracle Cloud console, Cloud Shell](images/4-1-apply.png " ")


2. Run the kubectl command below to display the status of the pod creation. Wait until the statuses become 'Running'. This may take a few minutes.

``` bash
<copy>
kubectl get pods
</copy>
```

![Oracle Cloud console, Cloud Shell](images/4-2-pods.png " ")

3. Run the kubectl command below to display the deployed services.

``` bash
<copy>
kubectl get svc
</copy>
```

4. Copy the External IP of the wstore-frontend service

![Oracle Cloud console, Cloud Shell](images/4-3-svc.png " ")

5. Refer to the below example and construct a URL, and paste it into a browser's address bar. If you see the WineCellar content as in the below screenshot, the deployment was successful.

``` bash
<copy>
http://<IP of the wstore-frontend service>/winestore/
</copy>
```
![Oracle Cloud console, Cloud Shell](images/4-4-app.png " ")

>**Note:** It may take a few minutes to complete the deployment and start loading the page content on the screen for the first time.

You may now **proceed to the next lab**.

## Acknowledgements

* **Author** - Yutaka Takatsu, Product Manager, Enterprise and Cloud Manageability
- **Contributors** - Steven Lemme, Senior Principal Product Manager,
Anand Prabhu, Sr. Member of Technical Staff,
Avi Huber, Vice President, Product Management
* **Last Updated By/Date** - Yutaka Takatsu, November, 2024
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