diff --git a/docs-source/spring/content/platform/vscode-plugin/_index.md b/docs-source/spring/content/platform/vscode-plugin/_index.md new file mode 100644 index 000000000..7b2620975 --- /dev/null +++ b/docs-source/spring/content/platform/vscode-plugin/_index.md @@ -0,0 +1,217 @@ +--- +title: "Oracle Backend for Spring Boot VS Code plugin" +--- + +**Developer Preview 0.3.6 - April, 2023** + +Oracle Backend for Spring Boot VS Code plugin is an extension to browse and deploy applications on the Oracle Backend for Spring Boot platform. This plugin allows to inspect the content of an Oracle Backend for Spring Boot deployment, in terms of applications, services and related configurations. It simplifies the access to the Platform Services installed, like Grafana, Spring, Apisix, Eureka and Jaeger creating ssh tunnels on-demand, and providing access to their respective web admin consoles. It allows to add credentials to access and bind services to the Oracle Autonomous DB included into Oracle Backend for Spring Boot deployment. This plug-in replicates the functionalities available in [OBaas CLI](../../development/cli) and simplify the access to Oracle Backend for Spring Boot deployments from a development IDE like VS Code. + +Oracle Free Use Terms and Conditions [License](https://oracle.gallerycdn.vsassets.io/extensions/oracle/oracledevtools/21.5.0/1662759024144/Microsoft.VisualStudio.Services.Content.License) + +## Prerequisites + +Already installed and configured: + +* The Kubernetes command-line tool (**kubectl**) +* Oracle Cloud Infrastructure Command Line Interface (CLI) + +as required for the Oracle Backend for Spring Boot [setup](../../setup/). + +## Installation + +* Download the plug-in from [here](https://github.com/oracle/microservices-datadriven/releases/tag/OBAAS-1.0.0) + +* On the VS Code right menu bar, click on **Extensions** item: + + ![Extensions list](./images/extensions.jpg) + +* From the up-right corner menu, choose **Install from VSIX...**: + + ![Extensions list](./images/install.jpg) + +and upload plug-in binaries previously downloaded. + +* Re-start VS Code to make fully operative the plugin. + +* If you don't see the plugin in the left bar, with the Oracle logo, as shown here: + + ![Additional](images/additional.jpg) + +click on **Additional Views** menu to select the **eBaaS Explorer**. + +## Using VS Code plugin + +Selecting the plugin from the left plugin menu bar, the Oracle Backend for Spring Boot VS Code plugin will ask to specify the Kubernetes config file full path as shown here: + +![kubeConfig](./images/getKubeConfig.jpg) + +By default it's shown the path in the user's Home directory **.kube/config** in which normally **kubectl** stores all the information regarding the K8S clusters configured. You could set the full path of another Kubernetes config file. +If the file is correctly loaded, the plugin will show the list of contexts available in which select one: + +![kubeContextList](./images/choseContext.jpg) + +In positive case, you should see a tree view with one node and the context chosen: + +![onenode](./images/onenode.jpg) + +If the file path it hasn't been correctly set, it will shown an error message: + +![kubeFileError](./images/reloadWindowError.jpg) + +To restart the plugin and proceed again in Kubernetes config file setting, in command palette execute a window reload: + +![kubeReload](./images/reloadWindow.jpg) + +### How to access to cluster + +Until you create a dedicated ssh tunnel to the Kubernetes cluster, and you don't connect to Oracle Backend for Spring Boot admin services, you will not be able to browse resources included into the Oracle Backend for Spring Boot deployment. To do this, follow these steps: + +* Select the cluster and click on the wheel symbol to set the credentials: + + ![Credentials](./images/credentials.jpg) + + On top menu, it will be required the Oracle Backend for Spring Boot admin **password**: + + ![Credentials](./images/password.jpg) + + and **admin** Oracle Backend for Spring Boot's user for the deployment: + + ![Credentials](./images/admin.jpg) + + Two message boxes will confirm credentials have been set correctly: + + ![confirmCredentials](./images/confirm.jpg) + + **NOTE**: if you don't execute this steps and try to expand the kubernetes context, you will receive a message: + + ![setCredentials](./images/oractlCred.jpg) + +* Select again the cluster and click the right mouse button and choose **Create tunnel** menu item. VS Code will open a new terminal that will try to open a tunnel to the Kubernetes cluster on a local port, starting from 8081: + + ![Tunnel](./images/tunnel.jpg) + + Before proceed to connection, please wait until the tunnel is established and the terminal shows a message like this: + + ![okTunnel](./imaeges/oktunnel.jpg) + + NOTE: if the K8s cluster it's not related to an Oracle Backend for Spring Boot deployment, the tunnel creation will fail. In this case in command palette execute a window reload to chose another cluster. If you have any problem in connection, you could start another tunnel: the plugin will try on another local port to connect to the cluster. + +* Again select the cluster and by clicking the right mouse button choose **Connect** menu item. This will create a session with credentials set at the first step. + +### Explore resources + +As soon as completed the steps to create tunnel and you get connected to the backend, it's possible to expand or refresh the tree related to the deployment. + + ![Browse](./images/browse.jpg) + +You'll see four top classes of resources that can be exploded in underlying items: + +* **applications**: the list of applications deployed and the services holding +* **ADB**: in this release we have one ADB in which are stored configuration and schema related to services deployed +* **platformServices**: the list of Oracle Backend for Spring Boot deployed services, like Grafana, Spring, Apisix, Eureka and Jaeger. +* **oBaasConf**: the list of keys defined by application, stored in the ADB provisioned and available to share configuration information among services in each application. + +Let's go to show the operations you can do on each item of browse tree. + +## Applications + +Open the list clicking on the arrow at the left of **applications**: + + ![Applications](./images/applications.jpg) + +and then expand the application about you want to know which services includes: + + ![Application](./images/application.jpg) + +At root level, by clicking the right mouse button on **applications** leaf, chose **Add application** to create a new application. On VS Code Command Palette will appear the prompt to set the application name it will be created: + + ![AppName](./images/appName.jpg) + +To show the list updated, click on the **Refresh** icon on right side of **applications** item. + + ![Refresh](./images/refreshApplications.jpg) + +On each application, you can **Add service -> upload .jar** or **Delete Application**. + +### Add Service + +The Add Service command imply the upload of a Spring Boot microservice in an Application context. +Clicking **Add service -> upload .jar** menu item on a specific application: + + ![upload](./images/uploadJar.jpg) + +in the VS Code Command Palette prompt will be required the parameters needed, in this order: + +* A popup will be opened to select the local Spring Boot **.jar file** +* if you need to bind the service to an user/schema in DB: + + ![bind](./images/bindingTF.jpg) + +* **Service Name** +* **DB User Password** you have to set only if you have chosen to bind a schema on DB the service you are deploying: + + ![bind](./images/bindigDBpwd.jpg) + +* **Spring Binding prefix** (Default: spring.datasource) +* **Image Version** (Default: 0.1) +* **Java image** (Default: ghcr.io/graalvm/jdk:ol7-java17-22.2.0) +* **Redeploy** (Default: false) +* **Add Health probe** (Default: false) +* **Service Port** (Default: 8080) +* **Service Profile** (Default: obaas) + +At the end of parameters collection, it will be started the binding and upload process that will generate a sequence of messages showing the status. These messages will end with "Service deployed successfully!" or "Deploy failed". According to the size and network constraints, the process will take more or less time to terminate. + +### Delete Service + +You can delete an existing service or one you have deployed from VS Code extension. In either cases, you have to select the service and click the right mouse button to select the only command available, i.e. **Delete service**. Also in this case, you should refresh the tree at application level to have an updated view and, sometimes, more than one time. + +### Delete Application + +This command will remove the application and all the services included. At the end of process it will be shown a message "Delete successful" or "Delete application failed!". After that you can refresh the tree, at single **application** level and then at **applications** level. Take in consideration that the termination of pods and application isn't synchronous operation: so it could happen you have to refresh more than one times to have a clean view. + +## ADB database + +For each Oracle Backend for Spring Boot is provisioned an Oracle Autonomous Transaction Processing Database to hold the schema related to the Spring Boot services and configuration details. To store the Admin DB Password you can click the wheel shown next to the ADB database item. In the VS Code Command Palette will be prompted the password: + + ![ADB](./images/database.jpg) + +## platformServices + +This leaf of tree can be expanded to show the services available in the Oracle Backend for Spring Boot platform. For each of them, by clicking the right mouse button on the leaf you can open an ssh tunnel to the service on a specific local port automatically chosen. At the end, it will prompted a link to open in the default web browser the admin console of each platform services. +For example, by clicking the right mouse button on **grafana console**: + + ![Apisix](./images/grafana.jpg) + +it will be opened a tunnel and a message with a button opening a web browser on the admin Grafana's console will be shown: + + ![GrafanaWeb](./images/grafana-browser.jpg) + +NOTE: if something goes wrong, like port already used or a timeout opening the connection, you can open another ssh tunnel: it will be automatically opened on another port. + +## oBaasConf + +Oracle Backend for Spring Boot offers to developers a store for the metadata and configurations useful to share info among pods in an application. The VS Code plug-in can browse the content of this key-value store, add, update and delete keys according the needs. +Expanding the leaf **oBaasConf** you will see the applications deployed and, expanding each of them, the key-value pair, as shown in the following pictures: + + ![Configurations](./images/configurations.jpg) + +Moving mouse on each key-value pair, you can see the other metadata related to the key, **profile** and **label**. +In the following picture, the key **spring.datasource.url** with value **'jdbc:oracle:thin:@$....'** has the property **application** coming from the root, i.e. **cloudbank**, **profile**=**1.0** and **label**=**kube**. + + ![detailConf](./dimages/detailsConf.jpg) + +The operation that can be done are: + +* **Add key**: by clicking the right mouse button on an **oBaasConf** or **service-conf** item, in the VS Code Command Palette will be requested: + * Service name + * Label + * Profile + * PropKey + * Value + + NOTE: you can add a config properties also for a Service not yet deployed. In some case it is mandatory to prepare properties before deploy services in order to correctly startup them. + +* **Edit key**: by clicking the right mouse button on a selected key, in the VS Code Command Palette will be requested to update the current content **Value** + +* **Delete key**: by clicking the right mouse button on a selected key, it will possible delete it. diff --git a/docs-source/spring/content/platform/vscode-plugin/images/additional.jpg b/docs-source/spring/content/platform/vscode-plugin/images/additional.jpg new file mode 100644 index 000000000..67981622f Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/additional.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/admin.jpg b/docs-source/spring/content/platform/vscode-plugin/images/admin.jpg new file mode 100644 index 000000000..fc940d1b6 Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/admin.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/apisisx.jpg b/docs-source/spring/content/platform/vscode-plugin/images/apisisx.jpg new file mode 100644 index 000000000..909c9809c Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/apisisx.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/appName.jpg b/docs-source/spring/content/platform/vscode-plugin/images/appName.jpg new file mode 100644 index 000000000..a54df2743 Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/appName.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/application.jpg b/docs-source/spring/content/platform/vscode-plugin/images/application.jpg new file mode 100644 index 000000000..29729afa1 Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/application.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/applications.jpg b/docs-source/spring/content/platform/vscode-plugin/images/applications.jpg new file mode 100644 index 000000000..53c6afcf0 Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/applications.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/bindigDBpwd.jpg b/docs-source/spring/content/platform/vscode-plugin/images/bindigDBpwd.jpg new file mode 100644 index 000000000..78d145fc3 Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/bindigDBpwd.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/bindingTF.jpg b/docs-source/spring/content/platform/vscode-plugin/images/bindingTF.jpg new file mode 100644 index 000000000..f271762c0 Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/bindingTF.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/browse.jpg b/docs-source/spring/content/platform/vscode-plugin/images/browse.jpg new file mode 100644 index 000000000..5f550280c Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/browse.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/choseContext.jpg b/docs-source/spring/content/platform/vscode-plugin/images/choseContext.jpg new file mode 100644 index 000000000..a492af2af Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/choseContext.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/clusters.jpg b/docs-source/spring/content/platform/vscode-plugin/images/clusters.jpg new file mode 100644 index 000000000..9e6934caa Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/clusters.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/configurations.jpg b/docs-source/spring/content/platform/vscode-plugin/images/configurations.jpg new file mode 100644 index 000000000..d19bb467a Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/configurations.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/confirm.jpg b/docs-source/spring/content/platform/vscode-plugin/images/confirm.jpg new file mode 100644 index 000000000..6b1d61289 Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/confirm.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/credentials.jpg b/docs-source/spring/content/platform/vscode-plugin/images/credentials.jpg new file mode 100644 index 000000000..199bdbffa Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/credentials.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/database.jpg b/docs-source/spring/content/platform/vscode-plugin/images/database.jpg new file mode 100644 index 000000000..72e20fe6d Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/database.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/dbCredentials.jpg b/docs-source/spring/content/platform/vscode-plugin/images/dbCredentials.jpg new file mode 100644 index 000000000..023624798 Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/dbCredentials.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/detailsConf.jpg b/docs-source/spring/content/platform/vscode-plugin/images/detailsConf.jpg new file mode 100644 index 000000000..9afbb589c Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/detailsConf.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/extensions.jpg b/docs-source/spring/content/platform/vscode-plugin/images/extensions.jpg new file mode 100644 index 000000000..2e7f767f7 Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/extensions.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/getKubeConfig.jpg b/docs-source/spring/content/platform/vscode-plugin/images/getKubeConfig.jpg new file mode 100644 index 000000000..aa25f4a59 Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/getKubeConfig.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/grafana-browser.jpg b/docs-source/spring/content/platform/vscode-plugin/images/grafana-browser.jpg new file mode 100644 index 000000000..500940233 Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/grafana-browser.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/grafana.jpg b/docs-source/spring/content/platform/vscode-plugin/images/grafana.jpg new file mode 100644 index 000000000..58b86397a Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/grafana.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/install.jpg b/docs-source/spring/content/platform/vscode-plugin/images/install.jpg new file mode 100644 index 000000000..2c5a04254 Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/install.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/menubar.jpg b/docs-source/spring/content/platform/vscode-plugin/images/menubar.jpg new file mode 100644 index 000000000..79fa6bbb5 Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/menubar.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/oktunnel.jpg b/docs-source/spring/content/platform/vscode-plugin/images/oktunnel.jpg new file mode 100644 index 000000000..5cec932fe Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/oktunnel.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/onenode.jpg b/docs-source/spring/content/platform/vscode-plugin/images/onenode.jpg new file mode 100644 index 000000000..6d91c6282 Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/onenode.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/oractlCred.jpg b/docs-source/spring/content/platform/vscode-plugin/images/oractlCred.jpg new file mode 100644 index 000000000..53efdb378 Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/oractlCred.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/password.jpg b/docs-source/spring/content/platform/vscode-plugin/images/password.jpg new file mode 100644 index 000000000..25d27fe61 Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/password.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/refreshApplications.jpg b/docs-source/spring/content/platform/vscode-plugin/images/refreshApplications.jpg new file mode 100644 index 000000000..e11e87a94 Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/refreshApplications.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/reloadWindow.jpg b/docs-source/spring/content/platform/vscode-plugin/images/reloadWindow.jpg new file mode 100644 index 000000000..731d613aa Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/reloadWindow.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/reloadWindowError.jpg b/docs-source/spring/content/platform/vscode-plugin/images/reloadWindowError.jpg new file mode 100644 index 000000000..3167598b7 Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/reloadWindowError.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/serviceName.jpg b/docs-source/spring/content/platform/vscode-plugin/images/serviceName.jpg new file mode 100644 index 000000000..af5fa6859 Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/serviceName.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/tunnel.jpg b/docs-source/spring/content/platform/vscode-plugin/images/tunnel.jpg new file mode 100644 index 000000000..2268b6d38 Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/tunnel.jpg differ diff --git a/docs-source/spring/content/platform/vscode-plugin/images/uploadJar.jpg b/docs-source/spring/content/platform/vscode-plugin/images/uploadJar.jpg new file mode 100644 index 000000000..4975a84a7 Binary files /dev/null and b/docs-source/spring/content/platform/vscode-plugin/images/uploadJar.jpg differ diff --git a/docs-source/spring/data/menu/main.yaml b/docs-source/spring/data/menu/main.yaml index 7217c9121..89d37e1e7 100644 --- a/docs-source/spring/data/menu/main.yaml +++ b/docs-source/spring/data/menu/main.yaml @@ -29,6 +29,8 @@ main: ref: "/development/cli" - name: Vault ref: "/platform/vault" + - name: VS Code plugin + ref: "/platform/vscode-plugin" - name: Observability ref: "/observability" sub: