Note:
- This tutorial requires access to Oracle Cloud. To sign up for a free account, see Get started with Oracle Cloud Infrastructure Free Tier.
- It uses example values for Oracle Cloud Infrastructure credentials, tenancy, and compartments. When completing your lab, substitute these values with ones specific to your cloud environment.
Prepare and configure OCI Resource Manager Stack for creating extra nodes on OKE
Introduction
This is part two 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
Configure OCI Resource Manager Stack and create a new node pool on the OKE cluster.
Prerequisites
-
Completion of the previous tutorial in this learning path, Part 1/6 - Install and configure an OKE cluster.
-
Note the following values from your OCI tenancy:
compartment_id
: OCID of the compartmentregion
: Region name (in this tutorial, we are using “sa-saopaulo-1”)ssh_public_key
: The key you created on your bastion ˜/.ssh/id_rsa.pubextra_node_pool_subnet
: OCID of the node’s subnet from your OKE VCNoke_cluster_id
: Get the OCID from your OKE cluster
Task 1: Create the OCI Resource Manager stack using OCI-CLI command line
-
Go to your bastion jump-box console and install git bastion virtual machine jump-box.
sudo yum install git -y
-
Get the task1_step_2_package.zip that contains the Terraform files to add new node on OKE and save it on the jump-box host.
cd $HOME wget https://docs.us.oracle.com/en/learn/resource-manager-airflow-oke-part2/files/task1_step_2_package.zip unzip task1_step_2_package.zip
-
Modify the variables related to your tenant with the variables you have noted.
-
Edit the
vars_to_stack.json
file and replace the values of each required variable.{"compartment_id": "ocid1.compartment.oc1..xxx", "region": "sa-saopaulo-1", "ssh_public_key": "ssh-rsa AAAxxx", "extra_node_pool_subnet": "ocid1.subnet.oc1.sa-saopaulo-1.xxx", "oke_cluster_id": "ocid1.cluster.oc1.sa-saopaulo-1.xxx", "kubernetes_version": "v1.25.4" }
Important TIP: To avoid parsing errors regarding your ssh-key, you must remove the line break. Run the following command to get your ssh public key:
cat ~/.ssh/id_rsa.pub | tr '' '\n'
-
-
Now run the OCI-CLI command to create the resource manager stack on your tenant. Make sure you replace the compartment id with the one for your tutorial.
export COMPARTMENT_ID="place_your_compartment_id_here" oci resource-manager stack create --compartment-id $COMPARTMENT_ID --config-source ./extra_nodes.zip --variables file://vars_to_stack.json --display-name "CLI Extra nodes" --description "New nodes for workload only labeled" --working-directory ""
-
Take note of the id created on your stack manager from the console as shown in the following image.
-
Your resource manager stack has been created and you’re good to proceed with the next part of this lab.
Next Step
To proceed to the next tutorial in this learning path, click here.
Related Links
Acknowledgments
- Author - Joao Tarla (Oracle LAD A-Team Solution Engineer)
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.
Prepare and configure OCI Resource Manager Stack for creating extra nodes on OKE
F79741-01
April 2023
Copyright © 2023, Oracle and/or its affiliates.