Skip to content

Microservices application ci/cd to OKE with Azure Devops including Nginx ingress, ADB via database operator and 23ai container sidecar database

Notifications You must be signed in to change notification settings

mikarinneoracle/microservices-OKE-azure-devops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build and deploy a microservices NodeJS application to OKE with Azure DevOps

This Azure DevOps ci/cd pipeline example builds and deploys a microservices application consisting of the following NodeJS microservices:

  • UI single page web app with Bootstrap html and CSS and VueJS scripting under /ui
  • Price with Autonomous Database access for the Price table and data under /price
  • Options with 23ai sidecar database container for the Options table and data under /options

The ci/cd pipeline will also:

  • Create an ADB instance for the Price database and to get access for it using the database wallet (mutual TLS; thick driver) in the Price microservice
  • under /adb. The prereq is that Oracle Database Operator for Kubernetes is installed in the OKE cluster which can be done as cluster add-on from OCI Console.
  • Run a Kubernetes job to create Price schemas with example data under /adb-job This keeps trying (via restarts) until ADB is up and running the job can connect succesfully to it.
  • Create Oracle 23ai database container for the Options database to be run as a sidecar for the Options microservice using it via local TLS (no wallet; thin driver) under /options. 23ai database sidecar will be created using deployment initContainers and /adb-job sidecar will create the schema and data to it. This keeps trying (via restarts) until 23ai sidecar is up and running the sidecar can connect succesfully to it.
  • Create nginx-ingress to access the application from Internet under /ingress-nginx

In addition:

Please note that I found out that the default 50MB of disk is a bit on the low side for the deployments to run smoothly with the 23ai side car, so I recommend adjusting disk to 200MB on the worker nodes in oke.yaml

Application will look like this:

Pipeline vars

Multiple vars need to be set for the pipeline to run (with example values):

  • COMPARTMENT: ocid1.compartment.oc1..aaaaaaaa...qgq
  • K8S_CONNECTION_NAME: OKE cluster Azure pipelines service connection name
  • CONTAINER_REGISTRY: OCI Registry (OCIR) Azure pipelines service connection name
  • OCIR: OCIR registry name e.g. fra.ocir.io
  • NAMESPACE: Tenancy namespace, to get it with oci cli do oci os ns get

Prerequisites and tips

  • Setup instance-principal OCI policies for the Azure DevOps agent and OKE. Any 404 error is an indication that a policy is missing. Agent runs as instance-principal.
  • Create following OCIR repos in advance before running the pipeline under the target compartment, otherwise they will be created automatically under the tenancy root compartment which is not a good idea:
    • azure-test-ui
    • azure-test-price
    • azure-test-options
    • azure-test-adb-job
  • Install Oracle Database Operator for Kubernetes to OKE cluster as cluster add-on from OCI Console.
  • If issues creating the ingress, download the latest ingress YAML by following these instructions and replace nginx-ingress-1.12.1.yaml YAML with it.

About

Microservices application ci/cd to OKE with Azure Devops including Nginx ingress, ADB via database operator and 23ai container sidecar database

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published