The following cloud brick enables you to create a decoupled Oracle Kubernetes Engine Nodepool associated to a particular OKE Cluster
The following is the reference architecture associated to this brick.
In this case you can take advantage of the decoupled nature of this module and provision as many nodepools as required. You later on can use node affinity to have different types of workload based nodepools (such as GPU enabled ones)
- Pre existent OKE Cluster
If Flex shape is in use
########## FLEX SHAPE IN USE ##########
########## SAMPLE TFVAR FILE ##########
########## PROVIDER SPECIFIC VARIABLES ##########
region = "foo-region-1"
tenancy_ocid = "ocid1.tenancy.oc1..abcdefg"
user_ocid = "ocid1.user.oc1..aaaaaaabcdefg"
fingerprint = "fo:oo:ba:ar:ba:ar"
private_key_path = "/absolute/path/to/api/key/your_api_key.pem"
########## PROVIDER SPECIFIC VARIABLES ##########
########## ARTIFACT SPECIFIC VARIABLES ##########
ssh_public_key = "/path/to/public/ssh/key/pub_key"
ssh_private_key = "/path/to/public/ssh/key/priv_key"
ssh_public_is_path = true
ssh_private_is_path = true
oke_cluster_compartment_name = "MY_ARTIFACT_COMPARTMENT"
oke_network_compartment_name = "MY_NETWORK_COMPARTMENT"
oke_availability_domain_map = { "ad1" : "aBCD:foo-REGION-1-AD-1", "ad2" : "aBCD:foo-REGION-1-AD-2" , "ad2" : "aBCD:foo-REGION-1-AD-3" }
oke_cluster_name = "my_k8_cluster"
oke_nodepool_network_subnet_name = "node_pool_subnet"
k8s_version = "K8_Version"
node_pool_name = "my_node_pool"
node_pool_shape = "VM.Standard.E4.Flex"
is_flex_shape = true
nodepool_shape_config_ocpus = 1
nodepool_shape_config_memory_in_gbs = 16
number_of_nodes = 3
k8s_label_map = { "SampleLabel1" : "SomeText", "SampleLabel1" : "AnotherText" }
########## ARTIFACT SPECIFIC VARIABLES ##########
########## SAMPLE TFVAR FILE ##########
########## FLEX SHAPE IN USE ##########
If Flex shape is not in use
########## FLEX SHAPE NOT IN USE ##########
########## SAMPLE TFVAR FILE ##########
########## PROVIDER SPECIFIC VARIABLES ##########
region = "foo-region-1"
tenancy_ocid = "ocid1.tenancy.oc1..abcdefg"
user_ocid = "ocid1.user.oc1..aaaaaaabcdefg"
fingerprint = "fo:oo:ba:ar:ba:ar"
private_key_path = "/absolute/path/to/api/key/your_api_key.pem"
########## PROVIDER SPECIFIC VARIABLES ##########
########## ARTIFACT SPECIFIC VARIABLES ##########
ssh_public_key = "/path/to/public/ssh/key/pub_key"
ssh_private_key = "/path/to/public/ssh/key/priv_key"
ssh_public_is_path = true
ssh_private_is_path = true
oke_cluster_compartment_name = "MY_ARTIFACT_COMPARTMENT"
oke_network_compartment_name = "MY_NETWORK_COMPARTMENT"
oke_availability_domain_map = { "ad1" : "aBCD:foo-REGION-1-AD-1", "ad2" : "aBCD:foo-REGION-1-AD-2" , "ad2" : "aBCD:foo-REGION-1-AD-3" }
oke_cluster_name = "my_k8_cluster"
oke_nodepool_network_subnet_name = "node_pool_subnet"
k8s_version = "K8_Version"
node_pool_name = "my_node_pool"
node_pool_shape = "VM.Standard2.1"
number_of_nodes = 5
k8s_label_map = { "SampleLabel1" : "SomeText", "SampleLabel1" : "AnotherText" }
########## ARTIFACT SPECIFIC VARIABLES ##########
########## SAMPLE TFVAR FILE ##########
########## FLEX SHAPE NOT IN USE ##########
- You can couple as many nodepools as required
- Variables
ssh_public_is_path
andssh_private_is_path
should always be set totrue
if the keys are using a full or relative path. If you hard code this as variable, then turn them tofalse
- Variable
oke_cluster_name
should be the display name of corresponding cluster. If using a modular coupled approach, this name can be obtained from OKE module output - Variable
oke_nodepool_network_subnet_name
should be the subnet where the nodepool will be created. If the nodepool is required to be kept private, then subnet must be private too - Variable
k8s_version
should be passed on following standardv1.xx.yy
. For currently supported versions, please refer to the following link - If using flex shapes, consider using the correct tfvars file definition
- Always prefer using nodepool size in odd number
The following is the base provider definition to be used with this module
terraform {
required_version = ">= 0.13.5"
}
provider "oci" {
region = var.region
tenancy_ocid = var.tenancy_ocid
user_ocid = var.user_ocid
fingerprint = var.fingerprint
private_key_path = var.private_key_path
disable_auto_retries = "true"
}
provider "oci" {
alias = "home"
region = data.oci_identity_region_subscriptions.home_region_subscriptions.region_subscriptions[0].region_name
tenancy_ocid = var.tenancy_ocid
user_ocid = var.user_ocid
fingerprint = var.fingerprint
private_key_path = var.private_key_path
disable_auto_retries = "true"
}
Name | Version |
---|---|
terraform | >= 0.13.5 |
Name | Version |
---|---|
oci | 4.36.0 |
oci.home | 4.36.0 |
random | 3.1.0 |
No modules.
Name | Type |
---|---|
oci_containerengine_node_pool.oke_node_pool | resource |
oci_identity_tag.release | resource |
oci_identity_tag_namespace.devrel | resource |
random_id.tag | resource |
oci_containerengine_clusters.OKECLUSTERS | data source |
oci_core_images.OL79 | data source |
oci_core_subnets.NODEPOOLSUBNET | data source |
oci_core_vcns.VCN | data source |
oci_identity_compartments.COMPARTMENTS | data source |
oci_identity_compartments.NWCOMPARTMENTS | data source |
oci_identity_region_subscriptions.home_region_subscriptions | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
fingerprint | API Key Fingerprint for user_ocid derived from public API Key imported in OCI User config | any |
n/a | yes |
is_flex_shape | Boolean that describes if the shape is flex or not | bool |
false |
no |
k8s_label_map | Define the list of Kubernetes Labels to apply in nodepool | map(any) |
n/a | yes |
k8s_version | Declares K8 Version | any |
n/a | yes |
node_metadata | A list of key/value pairs to add to each underlying Oracle Cloud Infrastructure nodepool in the node pool on launch. | map(any) |
{} |
no |
node_pool_name | Node Pool Name for K8 Cluster | any |
n/a | yes |
node_pool_shape | Shape to be used in node pool members | any |
n/a | yes |
nodepool_shape_config_memory_in_gbs | (Updatable) The total amount of memory available to the nodepool, in gigabytes. | string |
"" |
no |
nodepool_shape_config_ocpus | (Updatable) The total number of OCPUs available to the nodepool. | string |
"" |
no |
number_of_nodes | Number of Nodes inside Node Pool | any |
n/a | yes |
oke_availability_domain_map | The name of the availability domain in which this node is placed | map(any) |
n/a | yes |
oke_cluster_compartment_id | Defines the compartment OCID where the OKE cluster was created | string |
"" |
no |
oke_cluster_compartment_name | Defines the compartment name where the OKE cluster was created | string |
"" |
no |
oke_cluster_name | OKE cluster display name | any |
n/a | yes |
oke_network_compartment_name | Defines the compartment where the Network is currently located | any |
n/a | yes |
oke_nodepool_compartment_id | Defines the compartment OCID where the OKE nodepool is created | string |
"" |
no |
oke_nodepool_compartment_name | Defines the compartment name where the OKE nodepool is created | string |
"" |
no |
oke_nodepool_network_subnet_name | Defines the specific Subnet to be used for this resource | any |
n/a | yes |
private_key_path | Private Key Absolute path location where terraform is executed | any |
n/a | yes |
region | Target region where artifacts are going to be created | any |
n/a | yes |
source_type | The source type of this option. IMAGE means the OCID is of an image | string |
"IMAGE" |
no |
ssh_private_is_path | Describes if SSH Private Key is located on file or inside code | bool |
false |
no |
ssh_private_key | Private key to log into machine | any |
n/a | yes |
ssh_public_is_path | Describes if SSH Public Key is located on file or inside code | bool |
false |
no |
ssh_public_key | Defines SSH Public Key to be used in order to remotely connect to compute nodepool | string |
n/a | yes |
tenancy_ocid | OCID of tenancy | any |
n/a | yes |
user_ocid | User OCID in tenancy. Currently hardcoded to user [email protected] | any |
n/a | yes |
Name | Description |
---|---|
node_details | Node Pool Member Details |
node_pool | Node pool details |
oke_nodepools | Node Pools configured inside OKE |
This project is open source. Please submit your contributions by forking this repository and submitting a pull request! Oracle appreciates any contributions that are made by the open source community.
Copyright (c) 2021 Oracle and/or its affiliates.
Licensed under the Universal Permissive License (UPL), Version 1.0.
See LICENSE for more details.