Note:

Run microservices to automatically create and destroy OCI resources

Introduction

This is the final part of a six-part tutorial series that shows you how to deploy a temporary set of resources on an OKE cluster using Golang microservices representing the usage of OCI SDK, OCI-CLI, Resource Manager, OCI Devops and Helm to deploy and destroy Apache Airflow.

Objective

In this tutorial you will run the microservices to start the process flow to create and destroy the whole set of OCI resources.

Process Flow

Prerequisites

Task 1: Set up your laptop host to invoke the microservices on OKE

In previous steps of this tutorial, you changed the bastion jump-box host /etc/hosts file by adding the proper load balancer IP and host names for each service (go-login, go-microservice and airflow). In order to reproduce that on your local machine, you must copy those entries from bastion host jump-box to your local machine.

  1. Open you bastion host jump-box shell and check the current values of the /etc/hosts file.

    cat /etc/hosts
    

    T1_1

  2. Change your /etc/hosts file and add three lines for go-login, go-microservice and airflow just like it was added to the bastion jump-box.

    sudo vi /etc/hosts
    # Paste the copied lines from bastion host /etc/hosts file.
    

    Note:

Task 2: Call go-login and go-microservice to start the process flow for CREATION

We will go through this process flow by invoking go-login and go-microservice.

  1. Open your bastion host terminal that has already been prepared with /etc/hosts (ips for the Load balancer).

     #1 - Get the TOKEN from login microservice
     TOKEN=$(curl -s -v -X GET http://go-login.superocilab.com/login)
    
     #2 call the service passing the TOKEN  
     curl -H 'Accept: application/json' -H "Token: ${TOKEN}" http://go-microservice.superocilab.com/oci-init
    
    

    T2_1

    Note: By now, all the process flow has been started, you may check the status using the following steps.

    • Open the Resource Manager, “Stack” page and check the job status.

      T2_1

    • Open the OKE cluster page, click “Node Pools” and check the status of “extra-node-pool” creation.

      T2_1

    • Open your DevOps project, click Build pipelines and check status for airflow-helm.

    • Check if the build pipeline for airflow-helm is running and waiting for the stack to be completed.

      Note: Depending on the elapsed time for the new node-pool creation, this build pipeline will be in a waiting status, it may take up to 10 min depending on OCI creation backends.

      T2_1

      T2_1

    • Open your DevOps project, click Deployment pipelines and check status for “airflow-helm-deploy”.

      T2_1

  2. Open your browser and open the airflow app: http://airflow.superocilab.com.

    • Note: This will only work if you have correctly set up your /etc/hosts file. T2_1

    • The default user/password for airflow is : admin/admin

      T2_1

Task 3: Call go-login and go-microservice to start the process flow for DESTRUCTION

Acknowledgments

More Learning Resources

Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

For product documentation, visit Oracle Help Center.